2017-10-08 00:09:18 +02:00
#!/bin/bash
2017-10-09 09:03:33 +02:00
blue( ) { printf " \n\033[0;34m $* \033[0m\n\n " && ( echo $* >> /tmp/LARBS.log) ; }
red( ) { printf " \n\033[0;31m $* \033[0m\n\n " && ( echo ERROR: $* >> /tmp/LARBS.log) ; }
2017-10-09 07:02:09 +02:00
echo " LARBS started $( date) " >> /tmp/LARBS.log
chmod 777 /tmp/LARBS.log
2017-10-09 20:43:41 +02:00
pacman -S --noconfirm --needed 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 )
2017-10-08 00:09:18 +02:00
dialog --title "Welcome!" --msgbox "Welcome to Luke's Auto-Rice Bootstrapping Script!\n\nThis script will automatically install a fully-featured i3wm Arch Linux desktop, which I use as my main machine.\n\n-Luke" 10 60
2017-10-09 03:36:59 +02:00
dialog --no-cancel --inputbox "First, please enter a name for the user account." 10 60 2> /tmp/.name
2017-10-08 00:09:18 +02:00
2017-10-09 03:36:59 +02:00
dialog --no-cancel --passwordbox "Enter a password for that user." 10 60 2> /tmp/.pass1
dialog --no-cancel --passwordbox "Reype password." 10 60 2> /tmp/.pass2
2017-10-08 00:09:18 +02:00
2017-10-09 03:36:59 +02:00
while [ $( cat /tmp/.pass1) != $( cat /tmp/.pass2) ]
2017-10-08 00:09:18 +02:00
do
2017-10-09 03:36:59 +02:00
dialog --no-cancel --passwordbox "Passwords do not match.\n\nEnter password again." 10 60 2> /tmp/.pass1
dialog --no-cancel --passwordbox "Reype password." 10 60 2> /tmp/.pass2
2017-10-08 00:09:18 +02:00
done
2017-10-09 03:36:59 +02:00
chmod 777 /tmp/.name
NAME = $( cat /tmp/.name)
shred -u /tmp/.name
2017-10-08 00:09:18 +02:00
useradd -m -g wheel -s /bin/bash $NAME
2017-10-09 03:36:59 +02:00
echo " $NAME : $( cat /tmp/.pass1) " | chpasswd
2017-10-08 00:09:18 +02:00
#I shred the password for safety's sake.
2017-10-09 03:36:59 +02:00
shred -u /tmp/.pass1
shred -u /tmp/.pass2
2017-10-08 00:09:18 +02:00
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
2017-10-09 04:55:02 +02:00
8 "Music visualizers and decoration" off
2017-10-08 00:09:18 +02:00
)
choices = $( " ${ cmd [@] } " " ${ options [@] } " 2>& 1 >/dev/tty)
2017-10-09 04:55:02 +02:00
echo $choices > /tmp/.choices
2017-10-08 00:09:18 +02:00
brow = ( dialog --separate-output --checklist "Select a browser (none or multiple possible):" 22 76 16)
2017-10-09 04:55:02 +02:00
options = ( 1 "qutebrowser" off
2017-10-08 00:09:18 +02:00
2 "Firefox" off
3 "Palemoon" off
4 "Waterfox" off
)
browch = $( " ${ brow [@] } " " ${ options [@] } " 2>& 1 >/dev/tty)
2017-10-09 04:55:02 +02:00
echo $browch > /tmp/.browch
2017-10-08 00:09:18 +02:00
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-09 19:31:21 +02:00
clear
cat << "EOF"
mmmmm # mmm
# "# mmm mmm mmm# m m " #
#mmmm" #" # " # #" "# "m m" m#"
# "m #"""" m"""# # # #m# "
# " "#mm" "mm"# "#m## "# #
m"
EOF
sleep 1
cat << "EOF"
mmmm m mmm
#" " mmm mm#mm " #
"#mmm #" # # m#"
"# #" "" " # "
"mmm#" "#mm" " mm #
EOF
sleep 1
cat << "EOF"
mmm mmmm m
m" " m" " m #
# mm # # #
# # # # "
"mmm" #mm# #
EOF
sleep .5
2017-10-09 09:21:18 +02:00
cat << "EOF"
- = .--._
- - ~_= = ~_- = - ` . ` -.
= = ~_ = = _ ~ - = .-' ` .
--= ~_ - ~ = = - = .' _..:._
---= ~ _~ = = - = ` . .--.' ` .
--= _-= - ~= _ - = - _.' ` . .--.:
-= _~ -- = = ~- .' : : :
-= -_ ~= = - _-` --. : .--: D
-= ~ _ = = -~_= ` ; .'.: ,`---' @
--= _ = = ~- -= .' .' ` ._ ` -.__.'
--= = ~_ - = = - .' .' _.` ---'
--= ~_= = - = ~ .'--' ' . ` -..__.--.
jgs--= = ~ _ = - ~-= = -~_- ` -..___( = = = ;
--= = ~_= = - = __ ~-= - - .' `---'
EOF
2017-10-09 19:31:21 +02:00
sleep .5
2017-10-09 09:03:33 +02:00
2017-10-08 00:09:18 +02:00
blue Now installing main programs...
2017-10-09 20:18:46 +02:00
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 scrot unzip unrar ntfs-3g offlineimap msmtp notmuch notmuch-mutt dosfstools fzf r pandoc || ( red Error installing basic packages. Check your internet connection and pacman keyring.)
2017-10-08 00:09:18 +02:00
2017-10-09 20:43:41 +02:00
cat << "EOF"
_____________________________
< Drink whole milk every day! >
-----------------------------
\ ____________
\ | __________|
/ /\
/ / \
/___________/___/|
| | |
| = = \ /= = | |
| O O | \ \ |
| < | \ \|
/| | \ \
/ | \_ ____/ | / /
/ /| | / /|
/|| \| | /|| \/
-------------|
| | | |
<__/ \_ _>
EOF
2017-10-09 19:03:56 +02:00
2017-10-08 00:09:18 +02:00
for choice in $choices
do
case $choice in
1)
blue Now installing LaTeX packages...
2017-10-09 09:03:33 +02:00
pacman --noconfirm --needed -S texlive-most texlive-lang biber
2017-10-08 00:09:18 +02:00
; ;
2)
blue Now installing LibreOffice Suite...
2017-10-09 09:03:33 +02:00
pacman --noconfirm --needed -S libreoffice-fresh
2017-10-08 00:09:18 +02:00
; ;
3)
blue Now installing GIMP...
2017-10-09 09:03:33 +02:00
pacman --noconfirm --needed -S gimp
2017-10-08 00:09:18 +02:00
; ;
4)
blue Now installing Blender...
2017-10-09 09:03:33 +02:00
pacman --noconfirm --needed -S blender
2017-10-08 00:09:18 +02:00
; ;
5)
blue Now installing Emacs...
2017-10-09 09:03:33 +02:00
pacman --noconfirm --needed -S emacs
2017-10-08 00:09:18 +02:00
; ;
6)
blue Now installing extra fonts...
2017-10-09 09:03:33 +02:00
pacman --noconfirm --needed -S noto-fonts-cjk noto-fonts-emoji
2017-10-08 00:09:18 +02:00
; ;
7)
blue Now installing transmission...
2017-10-09 09:03:33 +02:00
pacman --noconfirm --needed -S transmission-cli
2017-10-09 04:55:02 +02:00
; ;
8)
blue Now installing visualizers and decoration...
2017-10-09 20:18:46 +02:00
pacman --noconfirm --needed -S projectm-pulseaudio cmatrix asciiquarium screenfetch
2017-10-09 04:55:02 +02:00
; ;
2017-10-08 00:09:18 +02:00
esac
done
2017-10-09 20:43:41 +02:00
cat << "EOF"
___________________________
< Now installing browser( s) >
---------------------------
\ ^ /^
\ / \ // \
\ | \_ __/| / \/ / .\
\ /O O \_ _ / // | \ \ *----*
/ / \/ _/ // | \ \ \ |
@___@` \/ _ // | \ \ \/ \ \
0/0/| \/ _ // | \ \ \ \
0/0/0/0/| \/ // | \ \ | |
0/0/0/0/0/_| _ / ( // | \ _\ | /
0/0/0/0/0/0/` /,_ _ _/ ) ; -. | _ _\. -~ / /
,-} _ *-.| .-~-. .~ ~
\ \_ _/ ` /\ / ~-. _ .-~ /
\_ ___( oo) *. } { /
( ( --) .----~-.\ \- ` .~
//__\\ \_ _ Ack! ///.----..< \ _ -~
// \\ ///-._ _ _ _ _ _ _{ ^ - - - - ~
EOF
2017-10-09 19:31:21 +02:00
2017-10-08 00:09:18 +02:00
for choice in $browch
do
case $choice in
1)
blue Now installing qutebrowser...
2017-10-09 09:03:33 +02:00
pacman --noconfirm --needed -S qutebrowser gst-libav gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly
2017-10-08 00:09:18 +02:00
; ;
2)
blue Now installing Firefox...
2017-10-09 09:03:33 +02:00
pacman --noconfirm --needed -S firefox
2017-10-08 00:09:18 +02:00
; ;
esac
done
2017-10-09 20:43:41 +02:00
cat << "EOF"
________________________
< >tfw too hot to handle >
------------------------
\ . . .
\ . . . ` ,
\ .; . : .' : : : .
\ i..` : i` i.i.,i i .
\ ` ,--.| i | i| ii| ii| i:
UooU\. '@@@@@@`.||'
\_ _/( @@@@@@@@@@) '
( @@@@@@@@)
` YY~~~~YY'
|| ||
EOF
2017-10-09 19:31:21 +02:00
2017-10-09 02:22:34 +02:00
curl https://raw.githubusercontent.com/LukeSmithxyz/larbs/master/sudoers_tmp > /etc/sudoers
2017-10-09 01:53:40 +02:00
cd /tmp
2017-10-09 07:02:09 +02:00
blue Changing working directory to /tmp/...
2017-10-08 22:40:48 +02:00
blue Downloading next portion of the script \( larbs_user.sh\) ...
2017-10-09 01:53:40 +02:00
curl https://raw.githubusercontent.com/LukeSmithxyz/larbs/master/larbs_user.sh > /tmp/larbs_user.sh && blue Running larbs_user.sh script as $NAME ...
sudo -u $NAME bash /tmp/larbs_user.sh || red Error when running larbs_user.sh...
rm -f /tmp/larbs_user.sh
2017-10-08 00:09:18 +02:00
2017-10-09 02:13:16 +02:00
blue Enabling Network Manager...
2017-10-08 00:09:18 +02:00
systemctl enable NetworkManager
systemctl start NetworkManager
2017-10-09 23:08:59 +02:00
blue Getting rid of that retarded error beep sound...
rmmod pcspkr
echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf
2017-10-08 00:09:18 +02:00
2017-10-09 23:08:59 +02:00
blue Implementing temporary sudoers file...
2017-10-08 00:09:18 +02:00
curl https://raw.githubusercontent.com/LukeSmithxyz/larbs/master/sudoers > /etc/sudoers
2017-10-09 07:07:10 +02:00
dialog --title "All done!" --msgbox "Congrats! Provided there were no hidden errors, the script completed successfully and all the programs and configuration files should be in place.\n\nTo run the new graphical environment, log out and log back in as your new user, then run the command \"startx\" to start the graphical environment.\n\n-Luke" 12 80
clear
2017-10-09 19:31:21 +02:00