LARBS/user.sh

84 lines
2.6 KiB
Bash
Raw Normal View History

2017-09-25 03:11:10 +02:00
#!/bin/bash
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m'
printf "${BLUE}Changing directory to /home/$USER...\n${NC}"
cd /home/$USER
2017-10-02 23:04:53 +02:00
error() { dialog --title "Error!" --msgbox "We've run into a fatal-ish error. Check the LARBS.log file for more information" 10 60 && clear && exit ;}
2017-09-25 03:11:10 +02:00
printf "${BLUE}Activating Pulseaudio if not already active...\n${NC}"
pulseaudio --start
printf "${BLUE}Installing packer as an AUR manager...\n${NC}"
2017-09-29 04:44:36 +02:00
aurinstall() { curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/$1.tar.gz && tar -xvf $1.tar.gz && cd $1 && makepkg --noconfirm -si && cd .. && rm -rf $1 $1.tar.gz ;}
2017-10-05 00:09:55 +02:00
qm=$(pacman -Qm | awk '{print $1}')
2017-10-05 00:09:55 +02:00
aurcheck() {
2017-10-05 10:58:36 +02:00
for arg in "$@"
do
if [[ $qm = *"$arg"* ]]; then
echo $arg is already installed.
2017-10-05 00:09:55 +02:00
else
2017-10-05 10:58:36 +02:00
echo $arg not installed
printf "${BLUE}\nNow installing $arg...\n${NC}"
aurinstall $arg && printf "${BLUE}\n$arg now installed.\n${NC}"
2017-10-05 00:09:55 +02:00
fi
2017-10-05 10:58:36 +02:00
done
2017-10-05 00:11:35 +02:00
}
2017-10-05 00:09:55 +02:00
aurcheck packer || (echo "Error installing packer." >> LARBS.log && error)
2017-09-25 03:11:10 +02:00
printf "${BLUE}Installing AUR programs...\n${NC}"
printf "${BLUE}(May take some time.)\n${NC}"
2017-10-05 10:58:36 +02:00
#Add the needed gpg key for neomutt
gpg --recv-keys 5FAF0A6EE7371805
2017-10-05 00:09:55 +02:00
aurcheck i3-gaps vim-pathogen neofetch i3lock tamzen-font-git neomutt unclutter-xfixes-git urxvt-resize-font-git polybar-git python-pywal xfce-theme-blackbird || (echo "Error installing AUR packages. Check your internet connections and pacman keys." >> LARBS.log && error)
2017-10-05 10:58:36 +02:00
#packer --noconfirm -S ncpamixer-git speedometer cli-visualizer
2017-10-05 10:58:36 +02:00
2017-09-30 06:45:54 +02:00
choices=$(cat choices)
for choice in $choices
do
case $choice in
1)
printf "\n${BLUE}Now installing LaTeX packages...\n${NC}"
2017-10-05 00:09:55 +02:00
aurcheck vim-live-latex-preview
git clone https://github.com/lukesmithxyz/latex-templates.git && mkdir -p /home/$USER/Documents/LaTeX && rsync -va latex-templates /home/$USER/Documents/LaTeX && rm -rf latex-templates
2017-09-30 06:45:54 +02:00
;;
6)
printf "\n${BLUE}Now installing extra fonts...\n${NC}"
2017-10-05 00:09:55 +02:00
aurcheck ttf-ancient-fonts
2017-09-30 06:45:54 +02:00
;;
7)
printf "\n${BLUE}Now installing transmission-remote-cli...\n${NC}"
2017-10-05 00:09:55 +02:00
aurcheck transmission-remote-cli-git
2017-09-30 06:45:54 +02:00
;;
esac
done
2017-10-05 00:20:48 +02:00
browsers=$(cat browch)
for choice in $browsers
do
case $choice in
3)
printf "\n${BLUE}Now installing Palemoon...\n${NC}"
aurcheck palemoon-bin
;;
4)
printf "\n${BLUE}Now installing Waterfox...\n${NC}"
aurcheck waterfox-bin
;;
esac
done
2017-09-25 03:11:10 +02:00
printf "${BLUE}Downloading config files...\n${NC}"
2017-09-29 04:44:36 +02:00
git clone https://github.com/lukesmithxyz/voidrice.git && rsync -va voidrice/ /home/$USER && rm -rf voidrice
2017-09-25 03:11:10 +02:00
printf "${BLUE}Generating bash/ranger/qutebrowser shortcuts...\n${NC}"
python ~/.config/Scripts/shortcuts.py