arch_postinstall.sh 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  1. #!/bin/bash
  2. # ------------------------------------------------------
  3. # --- SETTINGS
  4. # ------------------------------------------------------
  5. home_directory="$HOME"
  6. config_directory="$HOME/.config"
  7. fonts_directory="/usr/share/fonts"
  8. scripts_directory="/usr/local/bin"
  9. green='\033[0;32m'
  10. magenta='\x1b[38;5;206m'
  11. normal='\033[0m'
  12. bold='\033[1m'
  13. no_color='\033[0m'
  14. date=$(date +%s)
  15. # ------------------------------------------------------
  16. # --- INSTALL DIALOG
  17. # ------------------------------------------------------
  18. sudo pacman --noconfirm --needed -Sy dialog
  19. # ------------------------------------------------------
  20. # --- 1 SYSTEM UPDATE
  21. # ------------------------------------------------------
  22. system_update() {
  23. echo -e "${green}${bold}[*] DOING A SYSTEM UPDATE, CAUSE STUFF MAY BREAK IF IT'S NOT THE LATEST VERSION...${normal}${no_color}"
  24. echo
  25. sleep 3
  26. sudo pacman -Sy --noconfirm archlinux-keyring
  27. sudo pacman --noconfirm -Syu
  28. sudo pacman -S --noconfirm --needed base-devel wget git curl
  29. echo
  30. echo -e "${magenta}${bold}[+] DONE ---------${normal}${no_color}"
  31. echo
  32. }
  33. # ------------------------------------------------------
  34. # --- 2 INSTALL AUR HELPER
  35. # ------------------------------------------------------
  36. install_aur_helper(){
  37. echo -e "${green}${bold}[*] INSTALLING AUR HELPER...${normal}${no_color}"
  38. echo
  39. sleep 3
  40. cd $HOME
  41. git clone https://aur.archlinux.org/yay.git .yay
  42. cd $HOME/.yay
  43. makepkg -si
  44. cd $HOME
  45. echo
  46. echo -e "${magenta}${bold}[+] DONE ---------${normal}${no_color}"
  47. echo
  48. }
  49. # ------------------------------------------------------
  50. # --- 3 INSTALL XORG
  51. # ------------------------------------------------------
  52. install_xorg(){
  53. echo -e "${green}${bold}[*] INSTALLING XORG...${normal}${no_color}"
  54. echo
  55. sleep 3
  56. PKGS=(
  57. 'xorg'
  58. 'xorg-server'
  59. 'xorg-apps'
  60. 'xorg-xinit'
  61. 'xf86-video-intel'
  62. 'mesa'
  63. )
  64. for PKG in "${PKGS[@]}"; do
  65. sudo pacman -S "$PKG" --noconfirm --needed
  66. done
  67. echo
  68. echo -e "${magenta}${bold}[+] DONE ---------${normal}${no_color}"
  69. echo
  70. }
  71. # ------------------------------------------------------
  72. # --- INSTALL PACMAN PACKAGES
  73. # ------------------------------------------------------
  74. install_pkgs(){
  75. echo -e "${green}${bold}[*] INSTALLING PACMAN PACKAGES...${normal}${no_color}"
  76. echo
  77. sleep 3
  78. PKGS=(
  79. 'acpi' # ACPI (Advanced Configuration and Power Interface)
  80. 'pacman-contrib' # Contributed scripts and tools for pacman systems
  81. # 'base-devel'
  82. # 'curl'
  83. # 'git'
  84. # 'wget'
  85. # TERMINAL EMULATOR ---------------------
  86. 'alacritty'
  87. 'kitty'
  88. # TERMINAL UTILITES ---------------------
  89. 'htop'
  90. 'neovim'
  91. 'neofetch'
  92. 'feh'
  93. 'dunst'
  94. 'scrot'
  95. 'xclip'
  96. 'fish'
  97. 'file-roller'
  98. 'sbxkb'
  99. 'gufw'
  100. 'hardinfo'
  101. 'inxi'
  102. 'jq'
  103. 'jshon'
  104. 'ntp'
  105. 'numlockx'
  106. 'openssh'
  107. 'rsync'
  108. 'tlp'
  109. 'pass'
  110. 'ripgrep'
  111. 'picom'
  112. 'yt-dlp'
  113. 'tmux'
  114. 'fzf'
  115. 'man-db'
  116. 'cmatrix'
  117. 'ncdu'
  118. 'calcurse'
  119. 'unclutter'
  120. 'bat'
  121. 'dosfstools'
  122. 'brightnessctl'
  123. 'lazygit'
  124. 'exa'
  125. # 'picom'
  126. # MEDIA ---------------------
  127. 'mpd'
  128. 'ncmpcpp'
  129. 'mpv'
  130. 'cmus'
  131. 'ffmpeg'
  132. # PRODUCTIVITY ---------------------
  133. 'galculator'
  134. 'zathura'
  135. 'zathura-pdf-mupdf'
  136. 'obsidian'
  137. # FILEMANAGER ---------------------
  138. 'nemo'
  139. 'ranger'
  140. 'mc'
  141. 'thunar'
  142. 'thunar-archive-plugin'
  143. 'thunar-volman'
  144. # WEB TOOLS ---------------------
  145. 'firefox'
  146. # ARCHIVE ---------------------
  147. 'unrar'
  148. 'unzip'
  149. 'zip'
  150. 'p7zip'
  151. # DISK UTILITIES ---------------------
  152. 'autofs'
  153. 'exfat-utils'
  154. 'gparted'
  155. 'gnome-disks'
  156. 'ntfs-3g'
  157. 'parted'
  158. 'gvfs'
  159. 'gvfs-mtp'
  160. 'gvfs-afc'
  161. 'gvfs-gphoto2'
  162. 'gvfs-nfs'
  163. 'gvfs-smb'
  164. 'xdg-utils'
  165. 'xdg-user-dirs-gtk'
  166. # GENERAL UTILITIES ---------------------
  167. 'veracrypt' # Disc encryption utility
  168. 'keepassxc' # Pass manager
  169. 'catfish' # Filesystem search
  170. )
  171. for PKG in "${PKGS[@]}"; do
  172. sudo pacman -S "$PKG" --noconfirm --needed
  173. done
  174. echo
  175. echo -e "${magenta}${bold}[+] DONE ---------${normal}${no_color}"
  176. echo
  177. }
  178. # ------------------------------------------------------
  179. # --- INSTALL DEVELOPMENT
  180. # ------------------------------------------------------
  181. install_development(){
  182. echo -e "${green}${bold}[*] INSTALLING DEVELOPMENT...${normal}${no_color}"
  183. echo
  184. sleep 3
  185. PKGS=(
  186. 'nodejs'
  187. 'yarn'
  188. 'pyenv'
  189. 'code'
  190. 'filezilla'
  191. )
  192. for PKG in "${PKGS[@]}"; do
  193. sudo pacman -S "$PKG" --noconfirm --needed
  194. done
  195. echo
  196. echo -e "${magenta}${bold}[+] DONE ---------${normal}${no_color}"
  197. echo
  198. }
  199. # ------------------------------------------------------
  200. # --- INSTALL GRAPHICS AND DESIGN
  201. # ------------------------------------------------------
  202. install_graphics(){
  203. echo -e "${green}${bold}[*] INSTALLING GRAPHICS AND DESIGN...${normal}${no_color}"
  204. echo
  205. sleep 3
  206. PKGS=(
  207. # 'gcolor2'
  208. 'gcolor3'
  209. 'gimp'
  210. 'inkscape'
  211. 'imagemagick'
  212. # 'nomacs'
  213. 'pngcrush'
  214. # 'ristretto'
  215. 'sxiv'
  216. )
  217. for PKG in "${PKGS[@]}"; do
  218. sudo pacman -S "$PKG" --noconfirm --needed
  219. done
  220. echo
  221. echo -e "${magenta}${bold}[+] DONE ---------${normal}${no_color}"
  222. echo
  223. }
  224. # ------------------------------------------------------
  225. # --- INSTALL FONTS
  226. # ------------------------------------------------------
  227. install_fonts(){
  228. echo -e "${green}${bold}[*] INSTALLING FONTS...${normal}${no_color}"
  229. echo
  230. sleep 3
  231. PKGS=(
  232. 'terminus-font'
  233. 'adobe-source-code-pro-fonts'
  234. 'nerd-fonts'
  235. 'noto-fonts'
  236. 'noto-fonts-emoji'
  237. 'noto-fonts-cjk'
  238. 'ttf-jetbrains-mono'
  239. 'ttf-joypixels'
  240. 'ttf-font-awesome'
  241. 'ttf-hack'
  242. )
  243. for PKG in "${PKGS[@]}"; do
  244. sudo pacman -S "$PKG" --noconfirm --needed
  245. done
  246. echo
  247. echo -e "${magenta}${bold}[+] DONE ---------${normal}${no_color}"
  248. echo
  249. }
  250. # ------------------------------------------------------
  251. # --- INSTALL AUDIO
  252. # ------------------------------------------------------
  253. install_audio(){
  254. echo -e "${green}${bold}[*] INSTALLING AUDIO...${normal}${no_color}"
  255. echo
  256. sleep 3
  257. PKGS=(
  258. 'alsa-utils'
  259. 'alsa-plugins'
  260. 'pulseaudio'
  261. 'pulseaudio-alsa'
  262. 'pavucontrol' # pulseaudio volume control
  263. 'volumeicon' # tray volume icon
  264. )
  265. for PKG in "${PKGS[@]}"; do
  266. sudo pacman -S "$PKG" --noconfirm --needed
  267. done
  268. echo
  269. echo -e "${magenta}${bold}[+] DONE ---------${normal}${no_color}"
  270. echo
  271. }
  272. # ------------------------------------------------------
  273. # --- INSTALL PRINTERS & SACANNERS
  274. # ------------------------------------------------------
  275. install_printers_scanners(){
  276. echo -e "${green}${bold}[*] INSTALLING PRINTERS & SACANNERS...${normal}${no_color}"
  277. echo
  278. sleep 3
  279. PKGS=(
  280. 'cups'
  281. 'cups-pdf'
  282. 'ghostscript'
  283. 'gsfonts'
  284. 'system-config-printer'
  285. 'skanlite'
  286. 'simple-scan'
  287. 'sane'
  288. 'sane-airscan'
  289. )
  290. for PKG in "${PKGS[@]}"; do
  291. sudo pacman -S "$PKG" --noconfirm --needed
  292. done
  293. sudo systemctl enable org.cups.cupsd.service
  294. sudo systemctl start org.cups.cupsd.service
  295. sudo systemctl enable --now cups
  296. echo
  297. echo -e "${magenta}${bold}[+] DONE ---------${normal}${no_color}"
  298. echo
  299. }
  300. # ------------------------------------------------------
  301. # --- INSTALL BLUETOOTH
  302. # ------------------------------------------------------
  303. install_bluetooth(){
  304. echo -e "${green}${bold}[*] INSTALLING BLUETOOTH...${normal}${no_color}"
  305. echo
  306. sleep 3
  307. PKGS=(
  308. 'bluez'
  309. 'bluez-utils'
  310. 'bluez-firmware'
  311. # 'blueberry'
  312. 'pulseaudio-bluetooth'
  313. 'blueman'
  314. )
  315. for PKG in "${PKGS[@]}"; do
  316. sudo pacman -S "$PKG" --noconfirm --needed
  317. done
  318. sudo systemctl enable bluetooth
  319. sudo systemctl start bluetooth
  320. echo
  321. echo -e "${magenta}${bold}[+] DONE ---------${normal}${no_color}"
  322. echo
  323. }
  324. # ------------------------------------------------------
  325. # --- INSTALL NETWORK
  326. # ------------------------------------------------------
  327. install_network(){
  328. echo -e "${green}${bold}[*] INSTALLING NETWORK...${normal}${no_color}"
  329. echo
  330. sleep 3
  331. PKGS=(
  332. 'wpa_supplicant'
  333. 'dialog'
  334. 'networkmanager'
  335. 'openvpn'
  336. 'networkmanager-openvpn'
  337. 'networkmanager-vpnc'
  338. 'network-manager-applet'
  339. 'dhclient'
  340. 'libsecret'
  341. 'dnsutils'
  342. )
  343. for PKG in "${PKGS[@]}"; do
  344. sudo pacman -S "$PKG" --noconfirm --needed
  345. done
  346. sudo systemctl enable NetworkManager.service
  347. sudo systemctl start NetworkManager.service
  348. echo
  349. echo -e "${magenta}${bold}[+] DONE ---------${normal}${no_color}"
  350. echo
  351. }
  352. cmd=(dialog --clear --separate-output --checklist "Select (with space) what script should do.\\nChecked options are required for proper installation, do not uncheck them if you do not know what you are doing." 26 86 16)
  353. options=(1 "System update" off
  354. 0 "Install Xorg" off
  355. 0 "Install Printers & Scanners" off
  356. 0 "Install Bluetooth" off
  357. 0 "Install Network" off
  358. 0 "Install Audio" off
  359. 0 "Install Packages" off
  360. 0 "Install Graphics & Design" off
  361. 9 "Install Fonts" off
  362. )
  363. choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
  364. clear
  365. for choice in $choices
  366. do
  367. case $choice in
  368. 1) system_update;;
  369. 2) install_aur_helper;;
  370. 0) install_xorg;;
  371. 0) install_printers_scanners;;
  372. 0) install_bluetooth;;
  373. 0) install_network;;
  374. 0) install_audio;;
  375. 0) install_pkgs;;
  376. 0) install_graphics;;
  377. 0) install_fonts;;
  378. esac
  379. done