dotfiles/entropy/initialize.sh

125 lines
4.2 KiB
Bash
Raw Permalink Normal View History

2020-12-21 14:13:39 +00:00
#!/usr/bin/env bash
set -euo pipefail
printf '\033[33m
/$$
| $$
/$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$
/$$__ $$| $$__ $$|_ $$_/ /$$__ $$ /$$__ $$ /$$__ $$| $$ | $$
| $$$$$$$$| $$ \ $$ | $$ | $$ \__/| $$ \ $$| $$ \ $$| $$ | $$
| $$_____/| $$ | $$ | $$ /$$| $$ | $$ | $$| $$ | $$| $$ | $$
| $$$$$$$| $$ | $$ | $$$$/| $$ | $$$$$$/| $$$$$$$/| $$$$$$$
\_______/|__/ |__/ \___/ |__/ \______/ | $$____/ \____ $$
| $$ /$$ | $$
| $$ | $$$$$$/
|__/ \______/
This script will now install the dotfiles and configurations for `entropy`.
\033[39m'
printf '\033[31m[note] Note that you have to manually link the nixos configuration and rebuild the system before running this script.
\033[39m'
echo "[note] Please make sure a GPG private key is installed."
echo "[note] Finally, you should have a working ssh key in place to interact with github and other servers. Note that the existing SSH config will be overwritten."
read -p "Are you ready to go? [y/n] " ready
if [ $ready != "y" ]; then
exit
fi
# sudo -v
# general preparations
mkdir -p ~/.config
# set up pass
printf "\033[33m[info] Linking config files\033[39m"
# this must be run in the home network
git clone felix@decima:~/pass-backup ~/.password-store
# set up vim
printf "\033[33m[info] Setting up vim\033[39m"
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
ln -s $PWD/.vimrc ~/.vimrc
vim -c "PlugInstall"
# set up nvim
printf "\033[33m[info] Setting up nvim\033[39m"
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
ln -s $PWD/nvim ~/.config/nvim
nvim -c "PlugInstall"
2021-10-14 14:15:27 +00:00
# set up emacs
printf "\033[33m[info] Setting up emacs\033[39m"
git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d
2020-12-21 14:13:39 +00:00
# set up mail
printf "\033[33m[info] Configuring Neomutt - your GPG password may be required.\033[39m"
cd mail
# generate mbsyncrc
sed -e "s/{{PASSWORD}}/$(pass mail/tud | head -1)/" -e "s/{{USER}}/$(pass mail/tud-user)/" template.mbsyncrc > .mbsyncrc
sed -e "s/{{USER}}/$(pass mail/tud-user)/" template.msmtprc > .msmtprc
# link files
cd ..
ln -s $PWD/mail/neomutt/ ~/.config/neomutt
ln -s $PWD/mail/.mailcap ~/.mailcap
ln -s $PWD/mail/.mbsyncrc ~/.mbsyncrc
ln -s $PWD/mail/.msmtprc ~/.msmtprc
ln -s $PWD/mail/.notmuch-config ~/.notmuch-config
mkdir -p ~/.mail/tu-dresden
notmuch new
2022-08-08 08:27:16 +00:00
# set up vpn connections
2020-12-21 14:13:39 +00:00
printf "\033[33m[info] Configuring OpenVPN\033[39m"
cd vpn
pass mail/tud-user | head -1 >> credentials.txt
pass mail/tud | head -1 >> credentials.txt
2022-08-08 08:27:16 +00:00
pass mail/tud | head -1 > openconnect.txt
chmod 600 credentials.txt
chmod 600 openconnect.txt
2020-12-21 14:13:39 +00:00
cd ..
ln -s $PWD/vpn ~/.config/vpn
# link other dotfiles
printf "\033[33m[info] Linking config files\033[39m"
ln -s $PWD/kitty/ ~/.config/kitty
2021-05-18 13:01:16 +00:00
ln -s $PWD/alacritty ~/.config/alacritty
2024-08-12 19:48:00 +00:00
ln -s $PWD/wezterm ~/.config/wezterm
2021-03-29 08:15:23 +00:00
ln -s $PWD/nyxt/ ~/.config/next
ln -s $PWD/mako/ ~/.config/mako
2020-12-21 14:13:39 +00:00
ln -s $PWD/.urlview ~/.urlview
2022-10-27 09:48:35 +00:00
ln -s $PWD/.tmux.conf ~/.tmux.conf
2020-12-21 14:13:39 +00:00
ln -s $PWD/.gitconfig ~/.gitconfig
ln -s $PWD/git-commit-template.txt ~/.gitcommit_template
2023-03-22 09:12:24 +00:00
ln -s $PWD/.bashrc ~/.bashrc
2020-12-21 14:13:39 +00:00
mkdir -p ~/.config/fish/
2023-03-22 09:12:24 +00:00
ln -s $PWD/fish/config.fish ~/.config/fish/config.fish
mkdir -p ~/.config/fish/functions
ln -s $PWD/fish/fish_user_key_bindings.fish ~/.config/fish/functions/fish_user_key_bindings.fish
2021-05-18 13:01:16 +00:00
## i3 things
2020-12-21 14:13:39 +00:00
ln -s $PWD/i3 ~/.config/i3
ln -s $PWD/i3status-rust ~/.config/i3status-rust
ln -s $PWD/dunst ~/.config/dunst
2021-05-18 13:01:16 +00:00
## sway things
ln -s $PWD/sway ~/.config/sway
ln -s $PWD/kanshi ~/.config/kanshi
ln -s $PWD/mpv ~/.config/mpv
ln -s $PWD/waybar ~/.config/waybar
2020-12-21 14:13:39 +00:00
# set default browser, enable redshift etc
printf "\033[33m[info] Setting up some defaults\033[39m"
xdg-settings set default-web-browser firefox.desktop
mkdir -p ~/.config/systemd/user/default.target.wants
touch ~/.config/systemd/user/default.target.wants/redshift.service