From 391076bda4568cee12054eaa8345fcc7538581f7 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Thu, 1 Apr 2021 22:32:07 +0200 Subject: [PATCH] Add installpackages, installdotfiles, gensshkey scripts --- script/gensshkey | 6 ++++++ script/installdotfiles | 32 ++++++++++++++++++++++++++++++++ script/installpackages | 21 +++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100755 script/gensshkey create mode 100755 script/installdotfiles create mode 100755 script/installpackages diff --git a/script/gensshkey b/script/gensshkey new file mode 100755 index 0000000..5a1d5ea --- /dev/null +++ b/script/gensshkey @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# +# Generate a new SSH keypair. +# https://medium.com/risan/upgrade-your-ssh-key-to-ed25519-c6e8d60d3c54 + +ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob@$(hostname -s)" diff --git a/script/installdotfiles b/script/installdotfiles new file mode 100755 index 0000000..56fea02 --- /dev/null +++ b/script/installdotfiles @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# +# Set up basic symlinks and directory structure when installing dotfiles. + +set -e + +# General +mkdir -p $HOME/dev +ln -s $HOME/dev/dotfiles/script $HOME/script + +# ZSH +mkdir -p $HOME/.config/zsh/functions +ln -s $HOME/dev/dotfiles/zshenv $HOME/.zshenv +ln -s $HOME/dev/dotfiles/zshrc $HOME/.config/zsh/.zshrc + +# Tmux +ln -s $HOME/dev/dotfiles/tmux.conf $HOME/.tmux.conf + +# Vim +mkdir -p $HOME/.vim/pack/git-plugins/{opt,start} +ln -s $HOME/dev/dotfiles/vimrc $HOME/.vimrc +ln -s $HOME/dev/dotfiles/vim/after $HOME/.vim/after + +# Git +ln -s $HOME/dev/dotfiles/gitconfig $HOME/.gitconfig +mkdir -p $HOME/.config/git +ln -s $HOME/dev/dotfiles/gitignore $HOME/.config/git/ignore + +# Alacritty +ln -s $HOME/dev/dotfiles/alacritty.yml $HOME/.config/alacritty.yml + +echo "Done" diff --git a/script/installpackages b/script/installpackages new file mode 100755 index 0000000..f57a88e --- /dev/null +++ b/script/installpackages @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Install packages for a new Arch or Manjaro installation. Requires sudo + +if [[ $euid > 0 ]]; then + echo "requires administrative privileges" + exit 1 +fi + +pacman -S --needed base-devel \ + git \ + exa \ + fzf \ + tmux \ + ttf-ubuntu-font-family # Ubuntu Mono font for Alacritty + +# https://rustup.rs/ +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + +# https://github.com/dandavison/delta#installation +cargo install git-delta