LARBS/install_packages.sh

110 lines
4.7 KiB
Bash
Raw Normal View History

#!/bin/bash
2017-10-06 17:46:31 +02:00
blue() { printf "\033[0;34m $* \033[0m\n" && (chmod 777 LARBS.log && echo $* >> LARBS.log) ;}
red() { printf "\033[0;31m $* \033[0m\n" && (chmod 777 LARBS.log && echo ERROR: $* >> LARBS.log) ;}
2017-10-06 07:36:28 +02:00
sudo pacman -S --noconfirm dialog || (echo "Error at script start: Are you sure you're running this as the root user? Are you sure you have an internet connection?" && exit)
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 ;}
cmd=(dialog --separate-output --checklist "Select additional packages to install with <SPACE>:" 22 76 16)
options=(1 "LaTeX packages" off
2 "Libreoffice Suite" off
3 "GIMP" off
4 "Blender" off
5 "Emacs" off
6 "Fonts for unicode and other languages" off
7 "transmission torrent client" off
)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
2017-10-06 07:34:18 +02:00
rm -f /home/$USER/.choices #Needed if write protected from root script.
echo $choices > /home/$USER/.choices
2017-10-06 20:10:06 +02:00
chmod 777 /home/$USER/.choices
clear
brow=(dialog --separate-output --checklist "Select a browser (none or multiple possible):" 22 76 16)
options=(1 "qutebrowser" off # any option can be set to default to "on"
2 "Firefox" off
3 "Palemoon" off
4 "Waterfox" off
)
browch=$("${brow[@]}" "${options[@]}" 2>&1 >/dev/tty)
2017-10-06 07:34:18 +02:00
rm -f /home/$USER/.browch #Needed if write protected from root script.
echo $browch > /home/$USER/.browch
2017-10-06 20:10:06 +02:00
chmod 777 /home/$USER/.browch
clear
#If this is the first run, install all core programs.
if [[ -e .firstrun ]]
then
dialog --title "Let's get this party started!" --msgbox "The rest of the installation will now be totally automated, so you can sit back and relax.\n\nIt will take some time, but when done, you'll can relax even more with your complete system.\n\nNow just press <OK> and the system will begin installation!" 13 60
2017-10-06 06:59:38 +02:00
blue Now installing main programs...
2017-10-06 07:36:28 +02:00
sudo pacman --noconfirm --needed -S base-devel xorg-xinit xorg-server rxvt-unicode feh ffmpeg pulseaudio pulseaudio-alsa arandr pavucontrol pamixer mpv wget rofi vim w3m ranger mediainfo poppler highlight tmux calcurse htop newsbeuter mpd mpc ncmpcpp network-manager-applet networkmanager imagemagick atool libcaca compton transset-df markdown mupdf evince rsync git youtube-dl youtube-viewer cups screenfetch scrot unzip unrar ntfs-3g offlineimap msmtp notmuch notmuch-mutt dosfstools fzf r pandoc || (echo "Error installing basic packages. Check your internet connection and pacman keyring." >> LARBS.log && error)
2017-10-06 17:30:21 +02:00
else
dialog --no-cancel --inputbox "Input the name of a non-root user to install AUR packages as." 10 60 2> .name
fi
for choice in $choices
do
case $choice in
1)
2017-10-06 06:59:38 +02:00
blue Now installing LaTeX packages...
2017-10-06 07:36:28 +02:00
sudo pacman --noconfirm --needed -S texlive-most texlive-lang biber
;;
2)
2017-10-06 06:59:38 +02:00
blue Now installing LibreOffice Suite...
2017-10-06 07:36:28 +02:00
sudo pacman --noconfirm --needed -S libreoffice-fresh
;;
3)
2017-10-06 06:59:38 +02:00
blue Now installing GIMP...
2017-10-06 07:36:28 +02:00
sudo pacman --noconfirm --needed -S gimp
;;
4)
2017-10-06 06:59:38 +02:00
blue Now installing Blender...
2017-10-06 07:36:28 +02:00
sudo pacman --noconfirm --needed -S blender
;;
5)
2017-10-06 06:59:38 +02:00
blue Now installing Emacs...
2017-10-06 07:36:28 +02:00
sudo pacman --noconfirm --needed -S emacs
;;
6)
2017-10-06 06:59:38 +02:00
blue Now installing extra fonts...
2017-10-06 07:36:28 +02:00
sudo pacman --noconfirm --needed -S noto-fonts-cjk noto-fonts-emoji
;;
7)
2017-10-06 06:59:38 +02:00
blue Now installing transmission...
2017-10-06 07:36:28 +02:00
sudo pacman --noconfirm --needed -S transmission-cli
esac
done
for choice in $browch
do
case $choice in
1)
2017-10-06 06:59:38 +02:00
blue Now installing qutebrowser...
2017-10-06 07:36:28 +02:00
sudo pacman --noconfirm --needed -S qutebrowser gst-libav gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly
;;
2)
2017-10-06 06:59:38 +02:00
blue Now installing Firefox...
2017-10-06 07:36:28 +02:00
sudo pacman --noconfirm --needed -S firefox
;;
esac
done
#Packages I may later add:
#pacman --noconfirm --needed -S projectm-pulseaudio
if [[ -e .firstrun ]]
then
2017-10-06 17:30:21 +02:00
USER=$(cat .firstrun)
blue Downloading next portion of the script \(user.sh\)...
2017-10-06 17:30:21 +02:00
curl https://raw.githubusercontent.com/LukeSmithxyz/larbs/master/user.sh > /home/$USER/user.sh && blue Running user.sh script as $USER...
sudo -u $USER bash /home/$USER/user.sh || red Error when running user.sh...
2017-10-06 17:53:00 +02:00
rm -f /home/$USER/user.sh
else
2017-10-06 20:06:37 +02:00
USER=$(cat .name) || red Could not retreive username...
blue Downloading next portion of the script \(aur_packages.sh\)...
2017-10-06 17:46:31 +02:00
curl https://raw.githubusercontent.com/LukeSmithxyz/larbs/master/aur_packages.sh > /home/$USER/aur_packages.sh && blue Running aur_packages as $USER...
sudo -u $USER bash /home/$USER/aur_packages.sh || red Error when running aur_packages...
2017-10-06 17:53:00 +02:00
rm -f /home/$USER/aur_packages.sh
fi
2017-10-06 20:06:37 +02:00
rm .firstrun