norisa.sh 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. read -p "What is your desired username? " username
  6. useradd -m -g users -G wheel "$username"
  7. passwd "$username"
  8. cd /home/"$username" || exit
  9. # setting up build environment
  10. sudo -u "$username" mkdir -p /home/"$username"/.build && cd .. && chown -R "$username":wheel "$username"/.build/
  11. pwd
  12. ls "$username"
  13. # install aur helper (pacaur)
  14. cd /home/"$username"/.build || exit
  15. pacman -S --noconfirm expac jq
  16. rm -rf /tmp/pacaur*
  17. curl -sO https://aur.archlinux.org/cgit/aur.git/snapshot/yay.tar.gz &&
  18. tar xvf yay.tar.gz
  19. cd .. && chown -R "$username":wheel .build/ && cd .build
  20. cd yay || exit
  21. sudo -u "$username" makepkg --noconfirm -si
  22. pacman -S --noconfirm xorg-server xorg-xinit xorg-xwininfo xorg-xprop xorg-xbacklight xorg-xdpyinfo xorg-xsetroot
  23. sudo -u "$username" yay -S --noconfirm libxft-bgra-git
  24. # clone dotfiles repo
  25. cd /home/"$username"/.build || exit
  26. git clone https://github.com/noahvogt/dotfiles.git
  27. cp dotfiles/.* /home/"$username" /root
  28. # shellcheck source=/dev/null
  29. source ~/.bashrc
  30. # build dwm
  31. cd /home/"$username"/.build || exit
  32. git clone https://github.com/noahvogt/dwm.git
  33. cd dwm || exit
  34. make clean install
  35. # build st
  36. cd /home/"$username"/.build || exit
  37. git clone https://github.com/noahvogt/st.git
  38. cd st || exit
  39. make clean install
  40. # build dwmblocks
  41. cd /home/"$username"/.build || exit
  42. git clone https://github.com/noahvogt/dwmblocks.git
  43. cd dwmblocks || exit
  44. make clean install
  45. # build dmenu
  46. cd /home/"$username"/.build || exit
  47. git clone https://github.com/noahvogt/dmenu.git
  48. cd dmenu || exit
  49. make clean install
  50. # make user to owner of ~/.build
  51. chown -R "$username":wheel home/"$username"/.build
  52. # download packages from the official repo
  53. 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
  54. # install aur packages
  55. sudo -u "$username" yay -S --noconfirm betterlockscreen simple-mtpfs tibasicc-git xflux dashbinsh devour plymouth vim-plug
  56. # enable tap to click
  57. [ ! -f /etc/X11/xorg.conf.d/40-libinput.conf ] && printf 'Section "InputClass"
  58. Identifier "libinput touchpad catchall"
  59. MatchIsTouchpad "on"
  60. MatchDevicePath "/dev/input/event*"
  61. Driver "libinput"
  62. # Enable left mouse button by tapping
  63. Option "Tapping" "on"
  64. EndSection' > /etc/X11/xorg.conf.d/40-libinput.conf