post-install.sh 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. #! /bin/bash
  2. # COLORS {{{
  3. Bold=$(tput bold)
  4. Underline=$(tput sgr 0 1)
  5. Reset=$(tput sgr0)
  6. # Regular Colors
  7. Red=$(tput setaf 1)
  8. Green=$(tput setaf 2)
  9. Yellow=$(tput setaf 3)
  10. Blue=$(tput setaf 4)
  11. Purple=$(tput setaf 5)
  12. Cyan=$(tput setaf 6)
  13. White=$(tput setaf 7)
  14. # Bold
  15. BRed=${Bold}$(tput setaf 1)
  16. BGreen=${Bold}$(tput setaf 2)
  17. BYellow=${Bold}$(tput setaf 3)
  18. BBlue=${Bold}$(tput setaf 4)
  19. BPurple=${Bold}$(tput setaf 5)
  20. BCyan=${Bold}$(tput setaf 6)
  21. BWhite=${Bold}$(tput setaf 7)
  22. print_line() {
  23. printf "%$(tput cols)s\n"|tr ' ' '-'
  24. }
  25. print_title() {
  26. #clear
  27. print_line
  28. echo -e "# ${BPurple}$1${Reset}"
  29. print_line
  30. echo ""
  31. }
  32. print_question(){
  33. T_COLS=`tput cols`
  34. echo -n "${BBlue}$1${Reset}"
  35. }
  36. print_msg(){
  37. T_COLS=`tput cols`
  38. echo -e "${BGreen}$1${Reset}"
  39. sleep 2
  40. }
  41. print_info() {
  42. #Console width number
  43. T_COLS=`tput cols`
  44. echo -e "${Bold}$1${Reset}\n" | fold -sw $(( $T_COLS - 18 )) | sed 's/^/\t /'
  45. }
  46. print_warning() {
  47. T_COLS=`tput cols`
  48. echo -e "${BYellow}$1${Reset}\n" | fold -sw $(( $T_COLS - 1 ))
  49. sleep 4
  50. }
  51. print_title 'Arch Linux Postinstall'
  52. alpi_user(){
  53. print_title "User"
  54. print_question "Create new user? [Y|n]"
  55. read yn
  56. yn=${yn:-y}
  57. if [ "$yn" == "y" ]; then
  58. print_question "Enter user name:"
  59. read username
  60. useradd -m -g users -G wheel,sys -s /bin/bash ${username}
  61. chfn ${username}
  62. passwd ${username}
  63. print_msg "user $username created"
  64. pacman -S --needed --no-confirm sudo
  65. echo "$username ALL=(ALL) ALL" >> /etc/sudoers
  66. print_msg "$username added to sudoers"
  67. print_question "switch now to $username? you'll have to restart the script [Y|n]"
  68. read yn
  69. yn=${yn:-y}
  70. if [ "$yn" == "y" ]; then
  71. su ${username}
  72. fi
  73. fi
  74. }
  75. alpi_avahi(){
  76. print_msg "install avahi"
  77. sudo pacman -S --needed --noconfirm -q avahi nss-mdns
  78. print_msg "configure avahi"
  79. sudo systemctl enable avahi-daemon
  80. sudo systemctl start avahi-deamon
  81. sudo sed -i.back 's/hosts: files dns myhostname/hosts: files mdns_minimal [NOTFOUND=return] dns myhostname/' /etc/nsswitch.conf
  82. }
  83. alpi_basics(){
  84. print_title "basic packages install"
  85. print_question "install basic pkgs? [Y|n]"
  86. read yn
  87. yn=${yn:-y}
  88. if [ "$yn" == "y" ]; then
  89. sudo pacman -S --needed --noconfirm -q vim rsync acpi parted imagemagick lynx wget alsa-utils tmux git openssh knockd bluez-utils htop
  90. print_msg 'securing ssh'
  91. sudo sed -i.back 's/^#PermitEmptyPasswords.*/PermitEmptyPasswords no/' /etc/ssh/sshd_config
  92. sudo sed -i.back 's/^#PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
  93. sudo systemctl enable sshd
  94. sudo systemctl start sshd
  95. alpi_avahi
  96. print_msg "basic packages installed"
  97. fi
  98. }
  99. alpi_multilib(){
  100. # https://wiki.archlinux.org/index.php/Multilib
  101. print_msg "Enable Multilib repository package"
  102. sudo sed -i.back 's/^#[multilib]$/[multilib]/' /etc/pacman.conf
  103. sudo sed -i.back 's/^#Include = \/etc/pacman\.d\/mirrorlist$/Include = /etc/pacman.d/mirrorlis/' /etc/pacman.conf
  104. sudo pacman -Syy
  105. }
  106. alpi_cosmetics(){
  107. print_title "apply pacman, bash, vim and git config (needs basic pkgs install)"
  108. alpi_basics
  109. _cwd="$(pwd)"
  110. # vim
  111. print_msg 'vim configuration'
  112. sudo pacman -S --needed --noconfirm -q vim-{spell-fr,spell-en,nerdtree,supertab,systemd}
  113. cp -r $_cwd/assets/vim /home/$USER/.vim
  114. cp $_cwd/assets/vimrc /home/$USER/.vimrc
  115. sudo cp -r $_cwd/assets/vim /root/.vim
  116. sudo cp $_cwd/assets/vimrc /root/.vimrc
  117. print_msg 'Git Completion'
  118. sudo pacman -S --needed --noconfirm -q bash-completion
  119. sudo mkdir /etc/bash_completion.d
  120. sudo wget -O /etc/bash_completion.d/git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
  121. # bash & prompt
  122. print_msg 'Bash and Prompt (liquidprompt)'
  123. git clone https://github.com/nojhan/liquidprompt.git -o github /home/$USER/.liquidprompt
  124. cp $_cwd/assets/bash_profile /home/$USER/.bash_profile
  125. cp $_cwd/assets/bashrc /home/$USER/.bashrc
  126. mkdir /home/$USER/.config
  127. cp $_cwd/assets/config/liquidpromptrc /home/$USER/.config/
  128. # sudo pacman -S --needed --noconfirm -q bash-completion
  129. source /home/$USER/.bashrc
  130. touch /home/$USER/.inputrc
  131. echo 'set show-all-if-ambiguous on' >> /home/$USER/.inputrc
  132. echo 'set completion-ignore-case on' >> /home/$USER/.inputrc
  133. print_msg "I love candy! (pacman)"
  134. sudo sed -i.back 's/^#Color$/Color/' /etc/pacman.conf
  135. sudo sed -i.back 's/^#TotalDownload$/TotalDownload\nILoveCandy/' /etc/pacman.conf
  136. # sudo sed -i.back 's/.*\[options\].*/&\nILoveCandy/' /etc/pacman.conf
  137. print_msg "Bins"
  138. cp -r $_cwd/assets/bin /home/$USER/.bin
  139. #DefaultTimeoutStopSec=30s /etc/systemd/system.conf
  140. print_msg 'Config and Cosmetics done'
  141. }
  142. # GPG
  143. alpi_gnupg(){
  144. print_title 'Setup a gpg encripting'
  145. print_msg 'see https://wiki.archlinux.org/index.php/GnuPG'
  146. print_question "create your gpg encrypting key? [Y|n] "
  147. read yn
  148. yn=${yn:-y}
  149. if [ "$yn" == "y" ]; then
  150. gpg --full-gen-key
  151. fi
  152. print_msg 'Gnupg done!'
  153. }
  154. alpi_secure(){
  155. print_title 'Basic securing system'
  156. print_msg 'remove root autologin'
  157. sudo sed -i.back 's/--autologin root //' /etc/systemd/system/getty@tty1.service.d/autologin.conf
  158. print_msg 'remove root login'
  159. sudo sed -i.back 's/#auth\srequired\spam_wheel.so\suse_uid/auth required spam_wheel.so use_uid/' /etc/pam.d/su
  160. sudo sed -i.back 's/#auth\srequired\spam_wheel.so\suse_uid/auth required spam_wheel.so use_uid/' /etc/pam.d/su-l
  161. print_msg 'restrict log access to root'
  162. sudo touch /etc/sysctl.d/50-dmesg-restrict.conf
  163. sudo sh -c "echo 'kernel.dmesg_restrict = 1' >> /etc/sysctl.d/50-dmesg-restrict.conf"
  164. sudo touch /etc/sysctl.d/50-kptr-restrict.con
  165. sudo sh -c "echo 'kernel.kptr_restrict = 1' >> /etc/sysctl.d/50-kptr-restrict.conf"
  166. print_msg 'basics secure done'
  167. }
  168. # Display Manager
  169. alpi_xserver(){
  170. print_title "install Graphical Display Part 1 : Xorg server"
  171. print_msg "you will have to reboot at the end of part 1"
  172. print_question "install xorg server? [Y|n] "
  173. read yn
  174. yn=${yn:-y}
  175. if [ "$yn" == "y" ]; then
  176. # touch pad
  177. sudo pacman -S --needed --noconfirm -q xf86-input-libinput
  178. # integred gpu
  179. sudo pacman -S --needed --noconfirm -q xf86-video-intel
  180. # discret gpu
  181. # sudo pacman -S --needed --noconfirm -q bbswitch bumblebee primus
  182. # sudo pacman -S --needed --noconfirm -q nvidia nvidia-utils
  183. # xorg server
  184. sudo pacman -S --needed --noconfirm -q xorg-{server,xinit,server-utils,server-devel,xrandr,xclock} xterm
  185. sudo pacman -S --needed --noconfirm -q mesa mesa-{libgl,demos}
  186. sudo pacman -S --needed --noconfirm -q
  187. # xinitrc
  188. touch /home/$USER/.xinitrc
  189. cat /etc/X11/xinit/xinitrc > /home/$USER/
  190. print_warning "xorg install complete, reboot and run startx to test xorg"
  191. print_warning "run part 2 after reboot if you need kde : Desktop manager Plasma5"
  192. print_warning "press enter to reboot"
  193. read x
  194. sudo reboot
  195. fi
  196. }
  197. alpi_plasma5(){
  198. print_title "install Graphical Display Part 2 : Desktop Manager Plasma 5"
  199. print_question "install Kde Plasma 5? [Y|n] "
  200. read yn
  201. yn=${yn:-y}
  202. if [ "$yn" == "y" ]; then
  203. print_msg "plasma"
  204. sudo pacman -S --needed --noconfirm -q --force plasma-meta
  205. print_msg "fonts"
  206. sudo pacman -S --needed --noconfirm -q ttf-{dejavu,liberation,droid,ubuntu-font-family}
  207. print_msg "network & Bluetooth"
  208. sudo pacman -S --needed --noconfirm -q networkmanager-openvpn pulseaudio-alsa rfkill systemd-kcm bluedevil
  209. print_msg "plasma addons"
  210. sudo pacman -S --needed --noconfirm -q kdeplasma-addons
  211. print_msg "file explorer : Dolphin"
  212. sudo pacman -S --needed --noconfirm -q dolphin dolphin-plugins ark unzip zip
  213. print_msg 'kleopatra and spectacle'
  214. sudo pacman -S --needed --noconfirm -q kleopatra spectacle
  215. print_msg "web browser, terminal emulator, disk tool, password tool"
  216. sudo pacman -S --needed --noconfirm -q chromium terminator gparted keepassx2
  217. sudo systemctl enable NetworkManager
  218. sudo systemctl start NetworkManager
  219. sudo systemctl enable bluetooth
  220. sudo systemctl start bluetooth
  221. # TODO start kde with xinitrc
  222. # echo 'exec startkde' > /home/$USER/.xinitrc
  223. print_msg "Plasma 5 install complete!"
  224. print_msg 'add startkde on ~/.xinitrc then run "startx" to start x server with kde plasma 5'
  225. fi
  226. }
  227. # Yaourt
  228. alpi_yaourt(){
  229. print_title "AUR helper : Yaourt"
  230. print_question "install Yaourt [Y|n] "
  231. read yaourt
  232. yaourt=${yaourt:-y}
  233. if [ "$yaourt" == "y" ]; then
  234. sudo pacman -S --needed base-devel
  235. mkdir -p /home/$USER/Developer/Linux/build-repos
  236. wget -O /home/$USER/Developer/Linux/build-repos/package-query.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz
  237. wget -O /home/$USER/Developer/Linux/build-repos/yaourt.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz
  238. cd /home/$USER/Developer/Linux/build-repos
  239. tar -xvf package-query.tar.gz
  240. tar -xvf yaourt.tar.gz
  241. cd package-query
  242. makepkg -sri
  243. cd ../yaourt
  244. makepkg -sri
  245. echo 'ask for editing config file before build'
  246. echo "EDITFILES=1" >> ~/.yaourtrc
  247. print_msg "Yaourt install complete!"
  248. fi
  249. }
  250. alpi_cups(){
  251. print_title 'CUPS (for printing)'
  252. print_question "install cups [Y|n] "
  253. read yn
  254. yn=${yn:-y}
  255. if [ "$yn" == "y" ]; then
  256. sudo pacman -S --needed --noconfirm -q cups cups-filters libcups ghostscript gsfonts
  257. sudo pacman -S --needed --noconfirm -q gutenprint splix cups-pdf
  258. sudo pacman -S --needed --noconfirm -q print-manager
  259. alpi_avahi
  260. sudo systemctl enable org.cups.cupsd
  261. sudo systemctl start org.cups.cupsd
  262. sudo systemctl enable cups-browsed
  263. sudo systemctl start cups-browsed
  264. sudo gpasswd -a $USER sys
  265. print_msg "CUPS install complete!"
  266. fi
  267. }
  268. # kernel LTS
  269. alpi_kernellts(){
  270. print_title "Long Term Support Kernel"
  271. print_question "install kernel-lts)? [Y|n]"
  272. read yn
  273. yn=${yn:-y}
  274. if [ "$yn" == "y" ]; then
  275. sudo pacman -S linux-lts linux-lts-headers nvidia-lts bbswitch-lts
  276. # TODO : add entrie for lts kernel on /boot/loader/entries
  277. print_msg "kernel LTS install complete!"
  278. fi
  279. }
  280. alpi_mysql(){
  281. print_msg "installe mysql"
  282. sudo pacman -S --needed --noconfirm -q mariadb
  283. print_msg "configure mysql"
  284. sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
  285. sudo systemctl start mysqld
  286. mysql_secure_installation
  287. sudo sed -i.back 's/^log-bin=mysql-bin$/#&/' /etc/mysql/my.cnf
  288. sudo sed -i.back 's/^max_allowed_packet.*$/max_allowed_packet = 16M/' /etc/mysql/my.cnf
  289. }
  290. # Packages
  291. alpi_defaultpkgs(){
  292. print_title "Day to day software"
  293. print_question "install day to day packages? [Y|n]"
  294. read yn
  295. yn=${yn:-y}
  296. if [ "$yn" == "y" ]; then
  297. _cwd="$(pwd)"
  298. print_msg 'Pim softwares : mail, calendar, contact, etc'
  299. sudo pacman -S --needed --noconfirm -q kmail korganizer kaddressbook kdeconnect pidgin pidgin-kwallet
  300. sudo pacman -S --needed --noconfirm -q spamassassin razor
  301. sudo sa-update
  302. print_question "Install regular mysql support for akonadi? [Y|n] "
  303. read ako
  304. ako=${ako:-y}
  305. if [ "$ako" == "y" ]; then
  306. print_question "Should we install and configure mysql (if not already done)? [y|N] "
  307. read sql
  308. sql=${sql:-n}
  309. if [ "$sql" == "y" ]; then
  310. alpi_mysql
  311. fi
  312. # https://forum.kde.org/viewtopic.php?t=84478#p140762
  313. print_question "please type your root mysql password :"
  314. read -s -p Password: pswd
  315. mysql -u root -p$pswd -e "create database akonadi;"
  316. mysql -u root -p$pswd -e "create user 'akonadi'@'localhost' identified by 'akonadi';"
  317. mysql -u root -p$pswd -e "grant all privileges on akonadi.* to 'akonadi'@'localhost';"
  318. mysql -u root -p$pswd -e "flush privileges;"
  319. mkdir -p /home/$USER/.config/akonadi
  320. mv /home/$USER/.config/akonadi/akonadiserverrc /home/$USER/.config/akonadi/akonadiserverrc.back
  321. cp $_cwd/assets/akonadiserverrc /home/$USER/.config/akonadi/
  322. print_msg "Akonadi configured to use system wide sql server!"
  323. fi
  324. print_msg 'install office softwares'
  325. sudo pacman -S --needed --noconfirm -q gwenview kimageformats kdegraphics-okular kipi-plugins libreoffice-fresh hunspell-{fr,en}
  326. print_msg 'install media softwares'
  327. sudo pacman -S --needed --noconfirm -q digikam darktable vlc lua-socket ktorrent banshee
  328. print_msg 'install graphic softwares'
  329. sudo pacman -S --needed --noconfirm -q inkscape gimp scribus fontforge blender
  330. print_msg 'web dev softwares'
  331. sudo pacman -S --needed --noconfirm -q firefox filezilla gulp
  332. print_msg 'install cloud softwares'
  333. sudo pacman -S --needed --noconfirm -q owncloud-client syncthing syncthing-gtk syncthing-inotify
  334. print_msg 'increase inotify watch limit'
  335. sleep 3
  336. sudo cp $_cwd/assets/90-inotify.conf /etc/sysctl.d/
  337. if [ -f /usr/bin/yaourt ];
  338. then
  339. yaourt -S downgrade
  340. yaourt -S atom-editor
  341. yaourt -S pulseaudio-dlna
  342. else
  343. print_warning "some packages can't be installed because you don't have yaourt installed"
  344. fi
  345. fi
  346. }
  347. # LAMP
  348. alpi_lamp(){
  349. # https://wiki.archlinux.org/index.php/Apache_HTTP_Server
  350. _cwd="$(pwd)"
  351. print_title "Web Server (apache, php, mysql)"
  352. print_question "Install apache php mysql? [Y|n] "
  353. read yn
  354. yn=${yn:-y}
  355. if [ "$yn" == "y" ]; then
  356. sudo pacman -S --needed --noconfirm -q apache php php-apache phpmyadmin php-mcrypt php-gd
  357. print_question "Should we install and configure mysql (if not already done)? [y|N] "
  358. read sql
  359. sql=${sql:-n}
  360. if [ "$sql" == "y" ]; then
  361. alpi_mysql
  362. fi
  363. print_msg "configure apache"
  364. sudo sed -i.back 's/^LoadModule mpm_event_module modules\/mod_mpm_event\.so$/#&/' /etc/httpd/conf/httpd.conf
  365. sudo sed -i.back 's/^#LoadModule mpm_prefork_module modules\/mod_mpm_prefork\.so$/LoadModule mpm_prefork_module modules\/mod_mpm_prefork.so/' /etc/httpd/conf/httpd.conf
  366. sudo sed -i.back 's/^#LoadModule rewrite_module modules\/mod_rewrite\.so$/LoadModule rewrite_module modules\/mod_rewrite.so/' /etc/httpd/conf/httpd.conf
  367. print-msg "configure vhosts folder"
  368. sudo mkdir /etc/httpd/conf/vhosts
  369. sudo sed -i.back 's/^#Include conf\/extra\/httpd-vhosts\.conf$/&\nInclude conf\/vhosts\/*.conf/' /etc/httpd/conf/httpd.conf
  370. print_msg "Install Sites folder"
  371. mkdir /home/$USER/Sites
  372. sudo cp $_cwd/assets/vhosts/dev.conf /etc/httpd/conf/vhosts/
  373. cp $_cwd/assets/index.html /home/$USER/Sites/
  374. sudo cp $_cwd/assets/index.html /srv/http/
  375. sudo sed -i "s/USER/$USER/g" /etc/httpd/conf/vhosts/dev.conf
  376. sudo dev -i 's/# End of file/127.0.0.1 dev\n\n&/' /etc/hosts
  377. print_msg "configure apache for php"
  378. sudo sed -i.back 's/^LoadModule dir_module modules\/mod_dir\.so$/&\nLoadModule php7_module modules\/libphp7.so/' /etc/httpd/conf/httpd.conf
  379. sudo sh -c "echo 'Include conf/extra/php7_module.conf' >> /etc/httpd/conf/httpd.conf"
  380. print_msg "configure php"
  381. sudo sed -i.back 's/^memory_limit.*$/memory_limit = 512M/' /etc/php/php.ini
  382. sudo sed -i.back 's/^error_reporting.*$/error_reporting = E_ALL \& ~E_NOTICE/' /etc/php/php.ini
  383. sudo sed -i.back 's/;extension=gd\.so/extension=gd.so/' /etc/php/php.ini
  384. print_question "Should we configure custom basedir folder for php? [Y|n] "
  385. read bd
  386. sql=${bd:-y}
  387. if [ "$bd" == "y" ]; then
  388. print_question "Please enter the basedir path"
  389. read basedir
  390. sudo sed -i.back "s/^open_basedir = .*$/&:${basedir}/" /etc/php/php.ini
  391. fi
  392. print_msg "configure php for mysql"
  393. sudo sed -i.back 's/;extension=pdo_mysql\.so/extension=pdo_mysql.so/' /etc/php/php.ini
  394. print_msg "configure phpmyadmin"
  395. sudo sed -i.back 's/;extension=mysqli\.so/extension=mysqli.so/' /etc/php/php.ini
  396. sudo sed -i.back 's/;extension=mcrypt\.so/extension=mcrypt.so/' /etc/php/php.ini
  397. sudo sed -i.back 's/;extension=bz2\.so/extension=bz2.so/' /etc/php/php.ini
  398. sudo sed -i.back 's/;extension=zip\.so/extension=zip.so/' /etc/php/php.ini
  399. sudo sed -i.back 's/^open_basedir = .*$/&:\/etc\/webapps\//' /etc/php/php.ini
  400. # TODO : instal drush
  401. fi
  402. }
  403. alpi_bumblebee(){
  404. # https://wiki.archlinux.org/index.php/Bumblebee
  405. print_title "Bumblebee"
  406. print_question "Install Bumblebee? [Y|n] "
  407. read yn
  408. yn=${yn:-y}
  409. if [ "$yn" == "y" ]; then
  410. sudo pacman -S --needed --no-confirm bumblebee nvidia
  411. sudo gpasswd -a $USER bumblebee
  412. sudo systemctl enable bumblebeed
  413. sudo systemctl start bumblebeed
  414. sudo pacman -S --needed --no-confirm mesa-demos
  415. print_msg "run optirun glxgears -info to test your install"
  416. print_msg "Install primus bridge for better performances"
  417. sudo pacman -S --needed --no-confirm primus lib32-primus
  418. sudo sed -i.back 's/^Bridge=auto$/Bridge=primus/' /etc/bumblebee/bumblebee.conf
  419. print_msg "Install bbswitch to turn on and off discret card automatically (only for laptops)"
  420. sudo pacman -S --needed --no-confirm bbswitch
  421. fi
  422. }
  423. alpi_steam(){
  424. # https://wiki.archlinux.org/index.php/Steam
  425. print_title "Steam"
  426. print_question "Install steam? [Y|n] "
  427. read yn
  428. yn=${yn:-y}
  429. if [ "$yn" == "y" ]; then
  430. alpi_bumblebee
  431. alpi_multilib
  432. sudo pacman -S --needed --no-confirm lib32-virtualgl lib32-mesa-libgl lib32-nvidia-utils lib32-alsa-plugins ttf-liberation lib32-curl
  433. sudo pacman -S --needed --no-confirm steam
  434. fi
  435. }
  436. # END
  437. alpi_end(){
  438. print_question "Reboot now? [Y|n] "
  439. read yn
  440. yn=${yn:-y}
  441. if [ "$yn" != "y" ]; then
  442. print_warning "depending on what you've done you may need to reboot"
  443. exit
  444. fi
  445. print_msg "Rebooting in 5sec"
  446. sleep 3
  447. reboot
  448. }
  449. alpi_menu(){
  450. while true
  451. do
  452. print_question "choose an action (preferably in proposed order)"
  453. echo
  454. action_list=("create user" "install basics" "cosmetics" "create gnupgp key" "secure the system" "install Xorg Server" "install Plasma 5 (kde)" "yaourt" "multilib" "cups (printers)" "switch to LTS kernel" "install default packages" "install lamp" "install bumblebee" "install steam" "end");
  455. select action in "${action_list[@]}"; do
  456. case "$REPLY" in
  457. 1)
  458. alpi_user
  459. ;;
  460. 2)
  461. alpi_basics
  462. ;;
  463. 3)
  464. alpi_cosmetics
  465. ;;
  466. 4)
  467. alpi_gnupg
  468. ;;
  469. 5)
  470. alpi_secure
  471. ;;
  472. 6)
  473. alpi_xserver
  474. ;;
  475. 7)
  476. alpi_plasma5
  477. ;;
  478. 8)
  479. alpi_yaourt
  480. ;;
  481. 9)
  482. alpi_multilib
  483. ;;
  484. 10)
  485. alpi_cups
  486. ;;
  487. 11)
  488. alpi_kernellts
  489. ;;
  490. 12)
  491. alpi_defaultpkgs
  492. ;;
  493. 13)
  494. alpi_lamp
  495. ;;
  496. 14)
  497. alpi_bumblebee
  498. ;;
  499. 15)
  500. alpi_steam
  501. ;;
  502. 16)
  503. alpi_end
  504. ;;
  505. *)
  506. print_warning "dommage, essaye encore"
  507. ;;
  508. esac
  509. [[ -n $OPT ]] && break
  510. done
  511. done
  512. }
  513. alpi_menu