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

174 lines
3.2 KiB
Bash
Raw Normal View History

2017-07-24 20:58:23 -04:00
#!/bin/zsh
lnh() {
print -Pn '%B%F{green}### '
print -n $1
print -P ' ###%f%b'
}
lnf() {
print -Pn '%B%F{yellow}>>>%f%b '
}
lnfb() {
2017-07-24 21:10:38 -04:00
print -P '%B%F{yellow}[[[%f%b'
2017-07-24 21:09:14 -04:00
}
2017-07-24 20:58:23 -04:00
lnfbe() {
2017-07-24 21:09:14 -04:00
print -P '%B%F{yellow}]]]'
}
2017-07-24 20:58:23 -04:00
ln() {
Print -Pn '%B%F{yellow}>>> '
Print -n $1
Print -P '%f%b'
}
install_i3() {
2017-08-01 23:07:30 -04:00
# Install Packages
2017-07-24 20:58:23 -04:00
if ! (pacman -Q i3-gaps >/dev/null 2>&1);
then
lnh "Installing i3-gaps from AUR..."
yaourt -S i3-gaps --noconfirm
fi;
if ! (pacman -Q i3blocks-gaps-git >/dev/null 2>&1);
then
lnh "Installing i3blocks-gaps-git from AUR..."
yaourt -S i3blocks-gaps-git --noconfirm
fi;
if ! (pacman -Q i3lock >/dev/null 2>&1);
then
lnh "Installing i3lock"
pacman -S i3lock --noconfirm
fi;
if ! (pacman -Q i3lock-fancy-dualmonitors-git >/dev/null 2>&1);
then
lnh "Installing i3lock-fancy"
yaourt -S i3lock-fancy-dualmonitors-git --noconfirm
fi;
if ! (pacman -Q compton >/dev/null 2>&1);
then
lnh "Installing Compton..."
pacman -S compton --noconfirm
fi;
2017-08-01 23:07:30 -04:00
### Install Service Files
lnh "Installing Services"
# Suspend locker
lnf
sudo cp -v cfg/systemd/system/suspend@.service /etc/systemd/system/
# Auto locker
lnf
sudo cp -v cfg/systemd/user/locker.service /etc/systemd/user
sudo systemctl daemon-reload
lnh "Enabling Services"
lnf
sudo systemctl enable suspend@$USER.service
lnf
systemctl --user enable locker.service
### Install Configuration Files
2017-07-24 20:58:23 -04:00
lnh "Installing General Configuration Files"
# Compton
lnf
2017-07-24 21:13:59 -04:00
cp -v cfg/compton/config ~/.config/compton/config
2017-08-01 23:07:30 -04:00
# NCMPCPP ws10 config
2017-07-24 20:58:23 -04:00
lnf
2017-07-24 21:13:59 -04:00
cp -v cfg/termite/ncmpcpp_config ~/.config/termite/ncmpcpp_config
2017-07-24 20:58:23 -04:00
### Install Tools
lnh "Installing General Tools"
2017-08-01 23:47:28 -04:00
lnf
mkdir -pv ~/Documents/tools
2017-07-24 20:58:23 -04:00
# Wallpaper Tool
lnf
2017-07-24 21:13:59 -04:00
cp -v cfg/i3/tools/wallpaper.sh ~/Documents/tools/
2017-07-24 21:10:38 -04:00
lnfb
2017-07-24 21:13:59 -04:00
cp -v cfg/wallpapers/wallpaper* ~/Pictures/
2017-07-24 21:10:38 -04:00
lnfbe
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")
break
;;
"Laptop")
2017-07-24 21:09:14 -04:00
lnh "Installing i3"
2017-07-24 20:58:23 -04:00
install_i3_laptop
break
;;
*) echo "Invalid Option";;
esac
done
}
install_i3_laptop() {
2017-07-26 14:00:04 -04:00
lnh "Installing Laptop Configuration Files"
# i3blocks
lnf
2017-07-26 14:05:09 -04:00
cp -v cfg/i3blocks/laptop/config ~/.config/i3blocks/config
2017-07-26 14:00:04 -04:00
lnfb
2017-08-01 23:47:28 -04:00
cp -rv cfg/i3blocks/laptop/blocks ~/.config/i3blocks/blocks
2017-07-26 14:00:04 -04:00
lnfbe
2017-08-01 23:07:30 -04:00
}
configure_common() {
2017-08-01 23:47:28 -04:00
### Install Config Files
2017-08-01 23:07:30 -04:00
lnh "Installing Common Configuration Files"
# ZSH
lnf
cp -v cfg/zshrc ~/.zshrc
# VIM
lnf
cp -v cfg/vimrc ~/.vimrc
vim +PlugInstall +qall
2017-08-01 23:47:28 -04:00
# MPD
awk '{gsub(/lain/,"'$USER'")}1' cfg/mpd/mpd.conf > mpd.conf.temp && mv mpd.conf.temp cfg/mpd/mpd.conf
lnfb
cp -rv cfg/mpd ~/.mpd
lnfbe
lnf
2017-08-02 00:56:32 -04:00
mkdir -pv ~/Music/beets
2017-08-01 23:47:28 -04:00
# NCMPCPP
lnf
cp -v cfg/ncmpcpp ~/.ncmpcpp
2017-08-02 00:56:32 -04:00
# Beets
lnfb
cp -rv cfg/beets ~/.config/beets
lnfbe
2017-08-01 23:47:28 -04:00
### Install Services
# MPD
systemctl --user enable mpd.service
systemctl --user start mpd.service
# NetworkManager
sudo systemctl enable NetworkManager.service
sudo systemctl start NetworkManager.service
2017-07-24 20:58:23 -04:00
}
echo "Select a Window Manager"
wm_opt=("Gnome" "i3")
select opt in "${wm_opt[@]}"
do
case $opt in
"Gnome")
echo "gnome"
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