2021-12-17 23:14:15 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
backup=~/dotfiles_backup
|
|
|
|
log_file=~/dotfiles_install.log
|
|
|
|
dotfiles_dir=~/.dotfiles
|
|
|
|
config_dir=~/.config
|
|
|
|
bin_dir=~/.local/bin
|
|
|
|
|
|
|
|
|
|
|
|
## Logging
|
|
|
|
exec 3>&1 4>&2
|
|
|
|
trap 'exec 2>&4 1>&3' 0 1 2 3
|
|
|
|
exec 1>$log_file 2>&1
|
|
|
|
|
|
|
|
## Backup current files and folders
|
|
|
|
mkdir -p $backup
|
2022-10-23 17:15:32 -04:00
|
|
|
mv -f ~/{.bash_profile,.bashrc,.profile,.emacs,.emacs.d,.vimrc,.xinitrc,.Xresources} $backup/
|
|
|
|
mv -f $config_dir/{bspwm,dunst,kitty,nvim,polybar,rofi,sxhkd,tint2,xsettingsd} $backup/
|
|
|
|
mv -f $bin_dir $backup/
|
2021-12-17 23:14:15 -05:00
|
|
|
|
|
|
|
# Create HOME symlinks
|
|
|
|
ln -sf $dotfiles_dir/bashrc ~/.bashrc
|
|
|
|
ln -sf $dotfiles_dir/bash_profile ~/.bash_profile
|
|
|
|
ln -sf $dotfiles_dir/profile ~/.profile
|
|
|
|
ln -sf $dotfiles_dir/emacs.d ~/.emacs.d
|
|
|
|
ln -sf $dotfiles_dir/xinitrc ~/.xinitrc
|
|
|
|
ln -sf $dotfiles_dir/vimrc ~/.vimrc
|
2022-01-21 10:09:46 -05:00
|
|
|
ln -sf $dotfiles_dir/Xresources ~/.Xresources
|
2021-12-17 23:14:15 -05:00
|
|
|
|
|
|
|
# Create $config_dir, sub-directories, and symlinks
|
2022-10-23 17:15:32 -04:00
|
|
|
mkdir -p $config_dir/{bspwm,dunst,kitty,nvim,polybar,rofi,tint2,sxhkd,xsettingsd}
|
2021-12-17 23:14:15 -05:00
|
|
|
ln -sf $dotfiles_dir/config/bspwm/bspwmrc $config_dir/bspwm/bspwmrc
|
|
|
|
ln -sf $dotfiles_dir/config/dunst/dunstrc $config_dir/dunst/dunstrc
|
|
|
|
ln -sf $dotfiles_dir/config/kitty/kitty.conf $config_dir/kitty/kitty.conf
|
2022-10-23 17:15:32 -04:00
|
|
|
ln -sf $dotfiles_dir/config/kitty/gruvbox.conf $config_dir/kitty/gruvbox.conf
|
2022-01-20 21:53:07 -05:00
|
|
|
ln -sf $dotfiles_dir/config/kitty/zenburn.conf $config_dir/kitty/zenburn.conf
|
2021-12-17 23:14:15 -05:00
|
|
|
ln -sf $dotfiles_dir/config/nvim/init.vim $config_dir/nvim/init.vim
|
|
|
|
ln -sf $dotfiles_dir/config/polybar/config.ini $config_dir/polybar/config.ini
|
|
|
|
ln -sf $dotfiles_dir/config/polybar/colors.ini $config_dir/polybar/colors.ini
|
|
|
|
ln -sf $dotfiles_dir/config/polybar/modules.ini $config_dir/polybar/modules.ini
|
|
|
|
ln -sf $dotfiles_dir/config/polybar/custom_modules.ini $config_dir/polybar/custom_modules.ini
|
2021-12-17 23:14:15 -05:00
|
|
|
ln -sf $dotfiles_dir/config/rofi/config.everforest.rasi $config_dir/rofi/config.rasi
|
2022-10-23 17:15:32 -04:00
|
|
|
ln -sf $dotfiles_dir/config/rofi/config.gruvbox.rasi $config_dir/rofi/config.rasi
|
|
|
|
ln -sf $dotfiles_dir/config/rofi/config.zenburn.rasi $config_dir/rofi/config.rasi
|
2021-12-17 23:14:15 -05:00
|
|
|
ln -sf $dotfiles_dir/config/sxhkd/sxhkdrc $config_dir/sxhkd/sxhkdrc
|
2022-10-23 17:15:32 -04:00
|
|
|
ln -sf $dotfiles_dir/config/tint2/tint2rc $config_dir/tint2/tint2rc
|
|
|
|
ln -sf $dotfiles_dir/config/xsettingsd/xsettingsd.conf $config_dir/xsettingsd/xsettingsd.conf
|
2021-12-17 23:14:15 -05:00
|
|
|
|
|
|
|
# Create $bin_dir and symlinks
|
|
|
|
mkdir -p $bin_dir
|
|
|
|
ln -sf $dotfiles_dir/bin/mirror-outputs $bin_dir
|
|
|
|
ln -sf $dotfiles_dir/bin/single-polybar-launcher $bin_dir
|
|
|
|
ln -sf $dotfiles_dir/bin/toggle-wifi $bin_dir
|
2022-10-23 17:15:32 -04:00
|
|
|
ln -sf $dotfiles_dir/bin/tint2-launcher $bin_dir
|
2021-12-17 23:14:15 -05:00
|
|
|
|
|
|
|
# Finishing up
|
|
|
|
source ~/.bashrc
|
|
|
|
source ~/.bash_profile
|
2022-01-20 21:53:07 -05:00
|
|
|
source ~/.profile
|
2021-12-17 23:14:15 -05:00
|
|
|
xrdb ~/.Xresources
|