norisa.sh 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/bash
  2. pacman -Sy --noconfirm git vim || { printf "Error at script start:\n\nAre you sure you're running this as the root user?\n\t(Tip: run 'whoami' to check)\n\nAre you sure you have an internet connection?\n\t(Tip: run 'ip a' to check)\n"; exit; }
  3. # make new user
  4. sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g' /etc/sudoers
  5. sed -i 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers
  6. read -rp "What is your desired username? " username
  7. useradd -m -g users -G wheel "$username"
  8. passwd "$username"
  9. cd /home/"$username" || exit
  10. # setting up build environment
  11. sudo -u "$username" mkdir -p /home/"$username"/.build && cd .. && chown -R "$username":wheel "$username"/.build/
  12. pwd
  13. ls "$username"
  14. # install aur helper (pacaur)
  15. cd /home/"$username"/.build || exit
  16. pacman -S --noconfirm expac jq
  17. rm -rf /tmp/pacaur*
  18. curl -sO https://aur.archlinux.org/cgit/aur.git/snapshot/yay.tar.gz &&
  19. tar xvf yay.tar.gz
  20. cd .. && chown -R "$username":wheel .build/ && cd .build || exit
  21. cd yay || exit
  22. sudo -u "$username" makepkg --noconfirm -si
  23. pacman -S --noconfirm xorg-server xorg-xinit xorg-xwininfo xorg-xprop xorg-xbacklight xorg-xdpyinfo xorg-xsetroot
  24. sudo -u "$username" yay -S --noconfirm libxft-bgra-git
  25. # clone dotfiles repo
  26. cd /home/"$username"/.build || exit
  27. git clone https://github.com/noahvogt/dotfiles.git
  28. cp -f dotfiles/.* /home/"$username" /root
  29. # shellcheck source=/dev/null
  30. source ~/.bashrc
  31. # build dwm
  32. cd /home/"$username"/.build || exit
  33. git clone https://github.com/noahvogt/dwm.git
  34. cd dwm || exit
  35. make clean install
  36. # build st
  37. cd /home/"$username"/.build || exit
  38. git clone https://github.com/noahvogt/st.git
  39. cd st || exit
  40. make clean install
  41. # build dwmblocks
  42. cd /home/"$username"/.build || exit
  43. git clone https://github.com/noahvogt/dwmblocks.git
  44. cd dwmblocks || exit
  45. make clean install
  46. # build dmenu
  47. cd /home/"$username"/.build || exit
  48. git clone https://github.com/noahvogt/dmenu.git
  49. cd dmenu || exit
  50. make clean install
  51. # make user to owner of ~/.build
  52. chown -R "$username":wheel home/"$username"/.build
  53. # download packages from the official repo
  54. pacman -S --noconfirm xorg-server xorg-xinit xorg-xwininfo xorg-xprop xorg-xbacklight xorg-xdpyinfo xorg-xsetroot picom xbindkeys jdk-openjdk geogebra shellcheck vim firefox syncthing ranger xournalpp ffmpeg obs-studio sxiv arandr man-db brightnessctl unzip unrar python mupdf-gl mediainfo highlight pulseaudio-alsa pulsemixer pamixer ttf-linux-libertine calcurse xclip noto-fonts-emoji imagemagick thunderbird gimp xorg-setxkbmap wavemon cmus texlive-most dash neofetch htop wireless_tools alsa-utils acpi zip unrar libreoffice nm-connection-editor dunst libnotify dosfstools
  55. # install aur packages
  56. sudo -u "$username" yay -S --noconfirm betterlockscreen simple-mtpfs tibasicc-git xflux dashbinsh devour plymouth vim-plug
  57. # enable tap to click
  58. [ ! -f /etc/X11/xorg.conf.d/40-libinput.conf ] && printf 'Section "InputClass"
  59. Identifier "libinput touchpad catchall"
  60. MatchIsTouchpad "on"
  61. MatchDevicePath "/dev/input/event*"
  62. Driver "libinput"
  63. # Enable left mouse button by tapping
  64. Option "Tapping" "on"
  65. EndSection' > /etc/X11/xorg.conf.d/40-libinput.conf
  66. # set the real world /etc/sudoers
  67. sed -i "s/%wheel ALL=(ALL) NOPASSWD: ALL/${username} ALL = NOPASSWD: \/usr\/bin\/mount, \/usr\/bin\/umount/g" /etc/sudoers