1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-24 04:22:50 -05:00
dotfiles/configure.sh

149 lines
2.9 KiB
Bash
Raw Normal View History

2017-07-24 20:58:23 -04:00
#!/bin/zsh
2017-12-06 15:38:22 -05:00
# Print Header
2017-07-24 20:58:23 -04:00
lnh() {
print -Pn '%B%F{green}### '
print -n $1
print -P ' ###%f%b'
}
2017-12-06 15:38:22 -05:00
# Print subheader
ln() {
print -Pn '%B%F{yellow}>>> '
print -n $1
print -P '%f%b'
2017-07-24 20:58:23 -04:00
}
2017-12-06 15:38:22 -05:00
pac_install() {
if ! (pacman -Q $1 >/dev/null 2>&1);
then
ln "Installing $1 from Official Repos..."
sudo pacman -S $1 --noconfirm
fi;
2017-07-24 21:09:14 -04:00
}
2017-12-06 15:38:22 -05:00
aur_install() {
if ! (pacman -Q $1 >/dev/null 2>&1);
then
ln "Installing $1 from AUR..."
yaourt -S $1 --noconfirm
fi;
2017-07-24 21:09:14 -04:00
}
2017-07-24 20:58:23 -04:00
2017-12-06 15:38:22 -05:00
svc_install() {
sudo cp -v "$1" '/etc/systemd/system'
}
svc_install_user() {
sudo cp -v "$1" '/etc/systemd/user'
}
svc_enable() {
sudo systemctl enable $1
}
svc_enable_user() {
systemctl --user enable $1
2017-07-24 20:58:23 -04:00
}
install_i3() {
2017-12-06 15:38:22 -05:00
lnh "Installing i3"
ln "Installing Packages"
aur_install i3-gaps
aur_install i3blocks-gaps-git
aur_install i3lock
aur_install i3lock-fancy-dualmonitors-git
pac_install compton
ln "Installing Services"
svc_install cfg/systemd/system/suspend@.service # suspend locker
svc_install_user cfg/systemd/user/locker.service # xautolock
2017-08-01 23:07:30 -04:00
2017-12-06 15:38:22 -05:00
ln "Enabling Services"
sudo systemctl daemon-reload
svc_enable suspend@$USER.service
svc_enable_user locker.service
2017-08-01 23:07:30 -04:00
2017-12-06 15:38:22 -05:00
ln "Installing Configuration Files"
2017-07-24 21:13:59 -04:00
cp -v cfg/compton/config ~/.config/compton/config
cp -v cfg/termite/ncmpcpp_config ~/.config/termite/ncmpcpp_config
2017-07-24 20:58:23 -04:00
2017-12-06 15:38:22 -05:00
ln "Installing Tools"
2017-08-01 23:47:28 -04:00
mkdir -pv ~/Documents/tools
2017-07-24 21:13:59 -04:00
cp -v cfg/i3/tools/wallpaper.sh ~/Documents/tools/
cp -v cfg/wallpapers/wallpaper* ~/Pictures/
2017-07-24 20:58:23 -04:00
2017-07-24 21:09:14 -04:00
lnh "Select a Platform"
2017-07-24 20:58:23 -04:00
platform_opt=("Desktop" "Laptop")
select opt in "${platform_opt[@]}"
do
case $opt in
"Desktop")
2017-12-06 15:38:22 -05:00
lnh "Platform Not Supported with i3"
exit
2017-07-24 20:58:23 -04:00
break
;;
"Laptop")
install_i3_laptop
break
;;
*) echo "Invalid Option";;
esac
done
}
install_i3_laptop() {
2017-12-06 15:38:22 -05:00
ln "Installing Laptop Configuration Files"
2017-07-26 14:05:09 -04:00
cp -v cfg/i3blocks/laptop/config ~/.config/i3blocks/config
2017-08-01 23:47:28 -04:00
cp -rv cfg/i3blocks/laptop/blocks ~/.config/i3blocks/blocks
2017-08-01 23:07:30 -04:00
}
configure_common() {
2017-12-06 15:38:22 -05:00
ln "Installing Common Configuration Files"
2017-08-03 21:02:02 -04:00
# powerlevel9k
sudo git clone https://github.com/bhilburn/powerlevel9k.git /usr/share/oh-my-zsh/themes/powerlevel9k
2017-12-06 15:38:22 -05:00
# zsh
cp -v cfg/zshrc ~/.zshrc
# neovim
cp -v cfg/nvim/init.vim ~/.config/nvim
nvim +PlugInstall +qall
# mpd
awk '{gsub(/lain/,"'$USER'")}1' cfg/mpd/mpd.conf > mpd.conf.temp && mv mpd.conf.temp cfg/mpd/mpd.conf
cp -rv cfg/mpd ~/.config/mpd
# beets
mkdir -pv ~/Music/beets
2017-08-02 00:56:32 -04:00
cp -rv cfg/beets ~/.config/beets
2017-12-06 15:38:22 -05:00
# ncmpcpp
cp -v cfg/ncmpcpp/config ~/.ncmpcpp/
ln "Installing Common Services"
svc_enable_user mpd
svc_enable NetworkManager
2017-07-24 20:58:23 -04:00
}
2017-12-06 15:38:22 -05:00
lnh "Select a Window Manager"
2017-07-24 20:58:23 -04:00
wm_opt=("Gnome" "i3")
select opt in "${wm_opt[@]}"
do
case $opt in
"Gnome")
2017-12-06 15:38:22 -05:00
lnh "Window Manager Not Supported"
exit
2017-07-24 20:58:23 -04:00
break
;;
"i3")
install_i3
break
;;
2017-08-01 23:07:30 -04:00
*) echo "Invalid Option";;
2017-07-24 20:58:23 -04:00
esac
done
2017-12-06 15:38:22 -05:00
configure_common