dotfiles/install.sh

89 lines
2.8 KiB
Bash
Raw Normal View History

2021-12-30 18:12:27 -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
cp -a ~/.bash_profile $backup/
cp -a ~/.bashrc $backup/
cp -a ~/.profile $backup/
cp -a ~/.emacs $backup/
cp -a ~/.emacs.d $backup/
cp -a ~/.Xresources $backup/
cp -a $config_dir/bspwm $backup/
cp -a $config_dir/dunst $backup/
cp -a $config_dir/kitty $backup/
cp -a $config_dir/nvim $backup/
cp -a $config_dir/polybar $backup/
2021-12-30 18:12:27 -05:00
<<<<<<< HEAD
=======
cp -a $config_dir/ranger $backup/
>>>>>>> 4f3a112 (Fix rebase conflicts)
2021-12-30 18:12:27 -05:00
cp -a $bin_dir $backup/
# Delete current files and folders
rm -rf ~/.bash_profile
rm -rf ~/.bashrc
rm -rf ~/.profile
rm -rf ~/.emacs
rm -rf ~/.emacs.d
rm -rf ~/.Xresources
rm -rf $config_dir/bspwm
rm -rf $config_dir/dunst
rm -rf $config_dir/kitty
rm -rf $config_dir/nvim
rm -rf $config_dir/polybar
2021-12-30 18:12:27 -05:00
<<<<<<< HEAD
=======
rm -rf $config_dir/ranger/
>>>>>>> 4f3a112 (Fix rebase conflicts)
2021-12-30 18:12:27 -05:00
rm -rf $bin_dir
# 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 11:20:20 -05:00
ln -sf $dotfiles_dir/Xresources ~/.Xresources
2021-12-30 18:12:27 -05:00
# Create $config_dir, sub-directories, and symlinks
2022-01-15 13:47:02 -05:00
mkdir -p $config_dir/{bspwm,dunst,kitty,nvim,polybar,rofi,sxhkd}
2021-12-30 18:12:27 -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
#ln -sf $dotfiles_dir/config/kitty/gruvbox.conf $config_dir/kitty/gruvbox.conf
ln -sf $dotfiles_dir/config/kitty/zenburn.conf $config_dir/kitty/zenburn.conf
2021-12-30 18:12:27 -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:09:09 -05:00
ln -sf $dotfiles_dir/config/rofi/config.everforest.rasi $config_dir/rofi/config.rasi
2022-01-21 11:20:20 -05:00
#ln -sf $dotfiles_dir/config/rofi/config.gruvbox.rasi $config_dir/rofi/config.rasi
2021-12-17 23:09:09 -05:00
#ln -sf $dotfiles_dir/config/rofi/config.zenburn.rasi $config_dir/rofi/config.rasi
2021-12-30 18:12:27 -05:00
ln -sf $dotfiles_dir/config/sxhkd/sxhkdrc $config_dir/sxhkd/sxhkdrc
# Create $bin_dir and symlinks
mkdir -p $bin_dir
ln -sf $dotfiles_dir/bin/mirror-outputs $bin_dir
2021-12-17 23:09:09 -05:00
ln -sf $dotfiles_dir/bin/single-polybar-launcher $bin_dir
2021-12-30 18:12:27 -05:00
ln -sf $dotfiles_dir/bin/toggle-wifi $bin_dir
# Finishing up
source ~/.bashrc
source ~/.bash_profile
source ~/.profile
2021-12-30 18:12:27 -05:00
xrdb ~/.Xresources