2017-02-07 16:16:45 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-12-13 11:32:15 -06:00
|
|
|
# #
|
|
|
|
# _ _ _ #
|
|
|
|
# | |_ _| |_,___ __| | _____ __ #
|
|
|
|
# | | | | | __/ _ \/ ,` |/ _ \ \ / / #
|
|
|
|
# | | |_| | || __/ (_| | __/\ V / #
|
|
|
|
# |_|\__, |\__\___|\__,_|\___| \_/ #
|
|
|
|
# \__/ #
|
|
|
|
# #
|
|
|
|
# D O T F I L E S #
|
|
|
|
# #
|
2019-10-30 08:52:55 -05:00
|
|
|
|
2019-12-12 11:02:24 -06:00
|
|
|
# TODO: quiet mode?
|
2019-10-30 08:52:55 -05:00
|
|
|
|
|
|
|
dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/" && pwd)
|
2019-12-02 09:31:28 -06:00
|
|
|
source "${dfp}/bin/lib/setup_helpers.bash"
|
2019-10-30 08:52:55 -05:00
|
|
|
edfp="${dfp}/.env"
|
2017-02-07 16:16:45 -06:00
|
|
|
|
2019-03-29 13:30:15 -05:00
|
|
|
INTERACTIVE=1
|
|
|
|
|
|
|
|
while test $# -gt 0; do
|
|
|
|
case "$1" in
|
|
|
|
-x|--non-interactive)
|
|
|
|
INTERACTIVE=0
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2017-02-07 16:16:45 -06:00
|
|
|
links=(
|
2017-02-10 12:06:59 -06:00
|
|
|
# desktop environment files
|
2019-12-02 09:31:28 -06:00
|
|
|
"$dfp/apps/de/bspwm/bspwmrc" "$XDG_CONFIG_HOME/bspwm/bspwmrc"
|
|
|
|
"$dfp/apps/de/bspwm/fehbg" "$HOME/.fehbg"
|
|
|
|
"$dfp/apps/de/sway/config" "$XDG_CONFIG_HOME/sway/config"
|
|
|
|
"$dfp/apps/de/sxhkd/sxhkdrc" "$XDG_CONFIG_HOME/sxhkd/sxhkdrc"
|
|
|
|
"$dfp/apps/de/x/resources" "$HOME/.Xresources"
|
|
|
|
"$dfp/apps/de/x/initrc" "$HOME/.xinitrc"
|
|
|
|
"$dfp/apps/de/x/initrc" "$HOME/.vnc/xstartup"
|
|
|
|
"$dfp/apps/de/x/profile" "$HOME/.xprofile"
|
|
|
|
"$dfp/apps/de/x/modmap" "$HOME/.xmodmap"
|
|
|
|
"$dfp/apps/de/compton/compton.conf" "$XDG_CONFIG_HOME/compton.conf"
|
|
|
|
"$dfp/apps/de/dunst/dunstrc" "$XDG_CONFIG_HOME/dunst/dunstrc"
|
|
|
|
"$dfp/bin/lib/colors/xresources" "$HOME/.Xresources.colors"
|
2017-02-07 16:16:45 -06:00
|
|
|
|
2017-02-10 12:06:59 -06:00
|
|
|
# shell files
|
2019-12-02 09:31:28 -06:00
|
|
|
"$dfp/apps/shell/bash/bashrc" "$HOME/.bashrc"
|
|
|
|
"$dfp/apps/shell/bash/bash_profile" "$HOME/.bash_profile"
|
|
|
|
"$dfp/apps/shell/tmux/tmux.conf" "$HOME/.tmux.conf"
|
|
|
|
"$dfp/apps/shell/tmux/layouts" "$HOME/.tmux/layouts"
|
2017-02-08 11:54:30 -06:00
|
|
|
|
2017-02-10 12:06:59 -06:00
|
|
|
# text editor files
|
2017-12-21 12:34:02 -06:00
|
|
|
"$dfp/apps/neovim/" "$XDG_CONFIG_HOME/nvim"
|
|
|
|
"$dfp/apps/neovim/" "$HOME/.vim"
|
2017-05-05 01:47:33 -05:00
|
|
|
"$dfp/apps/neovim/init.vim" "$HOME/.vimrc"
|
2019-12-02 09:31:28 -06:00
|
|
|
"$dfp/bin/lib/colors/vim" "$XDG_CONFIG_HOME/nvim/colors/base16-donokai.vim"
|
2017-02-08 14:22:10 -06:00
|
|
|
|
2017-04-03 15:45:21 -05:00
|
|
|
# gtk configuration files
|
2019-12-02 09:31:28 -06:00
|
|
|
"$dfp/apps/de/gtk/2rc" "$HOME/.gtkrc-2.0"
|
|
|
|
"$dfp/apps/de/gtk/2rc" "$HOME/.gtkrc"
|
|
|
|
"$dfp/apps/de/gtk/3settings.ini" "$XDG_CONFIG_HOME/gtk-3.0/settings.ini"
|
2017-04-03 15:45:21 -05:00
|
|
|
|
2017-02-10 12:06:59 -06:00
|
|
|
# irc files
|
2017-05-05 01:47:33 -05:00
|
|
|
"$dfp/apps/irssi/" "$HOME/.irssi"
|
|
|
|
"$dfp/apps/weechat/" "$HOME/.weechat"
|
|
|
|
|
|
|
|
# qutebrowser config files
|
|
|
|
"$dfp/apps/qutebrowser/qutebrowser.conf" "$XDG_CONFIG_HOME/qutebrowser/qutebrowser.conf"
|
|
|
|
"$dfp/apps/qutebrowser/keys.conf" "$XDG_CONFIG_HOME/qutebrowser/keys.conf"
|
2017-04-03 14:38:53 -05:00
|
|
|
|
2019-02-27 23:29:49 -06:00
|
|
|
# sc-im config files and scripts
|
|
|
|
"$dfp/apps/scim/rc" "$HOME/.scimrc"
|
|
|
|
"$dfp/apps/scim/lua" "$HOME/.scim/lua"
|
|
|
|
|
2019-06-09 09:49:32 -05:00
|
|
|
# libinput configuration
|
2019-12-02 09:31:28 -06:00
|
|
|
"$dfp/apps/de/libinput/gestures.conf" "$XDG_CONFIG_HOME/libinput-gestures.conf"
|
2019-06-09 09:49:32 -05:00
|
|
|
|
2018-08-09 09:40:14 -05:00
|
|
|
# document viewer
|
|
|
|
"$dfp/apps/zathura/" "$XDG_CONFIG_HOME/zathura"
|
|
|
|
|
2019-10-31 10:46:50 -05:00
|
|
|
# htop
|
|
|
|
"$dfp/apps/htop/rc" "$XDG_CONFIG_HOME/htop/htoprc"
|
|
|
|
|
2017-04-27 15:49:57 -05:00
|
|
|
# terminal emulator
|
2017-12-21 12:34:02 -06:00
|
|
|
"$dfp/apps/alacritty/" "$XDG_CONFIG_HOME/alacritty"
|
2017-04-27 15:49:57 -05:00
|
|
|
|
2019-03-06 12:20:34 -06:00
|
|
|
# kitty config
|
|
|
|
"$dfp/apps/kitty/" "$XDG_CONFIG_HOME/kitty"
|
|
|
|
|
2017-04-27 17:22:57 -05:00
|
|
|
# rofi config
|
2017-05-05 01:47:33 -05:00
|
|
|
"$dfp/apps/rofi/config" "$XDG_CONFIG_HOME/rofi/config"
|
2017-04-27 17:22:57 -05:00
|
|
|
|
2017-04-03 14:38:53 -05:00
|
|
|
# bar files
|
2019-12-02 09:31:28 -06:00
|
|
|
"$dfp/apps/de/bar/polybar-config" "$XDG_CONFIG_HOME/polybar/config"
|
2017-02-10 12:06:59 -06:00
|
|
|
|
2017-11-14 17:31:30 -06:00
|
|
|
# ranger config
|
2017-12-21 12:34:02 -06:00
|
|
|
"$dfp/apps/ranger/" "$XDG_CONFIG_HOME/ranger"
|
2017-12-21 12:18:17 -06:00
|
|
|
|
|
|
|
# mutt config
|
|
|
|
"$dfp/apps/mutt/muttrc" "$XDG_CONFIG_HOME/.muttrc"
|
|
|
|
"$dfp/apps/mutt/muttrc" "$HOME/.muttrc"
|
2017-07-27 13:00:48 -05:00
|
|
|
|
|
|
|
# neofetch config
|
|
|
|
"$dfp/apps/neofetch/config" "$XDG_CONFIG_HOME/neofetch/config"
|
2017-02-28 10:56:23 -06:00
|
|
|
|
|
|
|
# git config
|
2017-05-05 01:47:33 -05:00
|
|
|
"$dfp/apps/git/config" "$HOME/.gitconfig"
|
2017-04-27 15:49:57 -05:00
|
|
|
|
|
|
|
# fontconfig
|
2019-12-02 09:31:28 -06:00
|
|
|
"$dfp/apps/de/fontconfig/" "$XDG_CONFIG_HOME/fontconfig"
|
2017-06-05 22:15:32 -05:00
|
|
|
|
|
|
|
# XDG user directories
|
2019-12-02 09:31:28 -06:00
|
|
|
"$dfp/apps/shell/user-dirs" "$XDG_CONFIG_HOME/user-dirs.dirs"
|
2017-02-07 16:16:45 -06:00
|
|
|
)
|
|
|
|
|
2019-10-30 08:52:55 -05:00
|
|
|
mkdir -p "$edfp/"
|
2019-11-01 20:59:47 -05:00
|
|
|
[[ ! -e "$HOME/.env" ]] && ln -s "$edfp/" "$HOME/.env"
|
2019-10-30 08:52:55 -05:00
|
|
|
mkdir -p "$edfp/bash.d/"
|
|
|
|
mkdir -p "$edfp/bin/"
|
|
|
|
mkdir -p "$edfp/x/"
|
|
|
|
mkdir -p "$HOME/.bin/"
|
|
|
|
|
|
|
|
touches=(
|
|
|
|
"$edfp/bash"
|
|
|
|
"$edfp/x/init"
|
|
|
|
"$edfp/x/profile"
|
|
|
|
"$edfp/x/resources"
|
|
|
|
"$edfp/vim"
|
|
|
|
"$edfp/bspwm"
|
|
|
|
"$edfp/bar"
|
|
|
|
"$edfp/app-launcher"
|
|
|
|
)
|
|
|
|
|
|
|
|
for t in "${touches[@]}"; do
|
|
|
|
touch "$t"
|
|
|
|
done
|
|
|
|
|
|
|
|
chmod 700 -R "$edfp"
|
|
|
|
chmod 700 -R "$HOME/.bin"
|
|
|
|
|
2019-03-29 13:30:15 -05:00
|
|
|
# TODO: pass interactive?
|
2018-11-08 09:34:17 -06:00
|
|
|
_dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-files.lock" "${links[@]}"
|
|
|
|
|
2019-03-29 13:30:15 -05:00
|
|
|
if [[ "$INTERACTIVE" = 1 ]]; then
|
2019-12-02 09:31:28 -06:00
|
|
|
echo -n -e "Do you want to run the bin/lib/sudo_setup script for changes to /etc"
|
2019-03-29 13:30:15 -05:00
|
|
|
echo -n -e "\nand other root directories?"
|
|
|
|
read -r -p " [y/N] " response
|
|
|
|
response=${response,,} # to lower case
|
|
|
|
if [[ $response =~ ^(yes|y)$ ]]; then
|
2019-12-02 09:31:28 -06:00
|
|
|
"$dfp/bin/lib/sudo_setup"
|
2019-03-29 13:30:15 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo -e "Dotfiles Installed! Running 'exec bash'...\n"
|
|
|
|
exec bash
|
2018-11-08 09:34:17 -06:00
|
|
|
fi
|