norisa.sh 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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"/.local/src && cd .. && chown -R "$username":wheel "$username"/.local/src/
  12. pwd
  13. ls "$username"
  14. # install aur helper (paru)
  15. cd /home/"$username"/.local/src || exit
  16. pacman -S --noconfirm asp bat devtools
  17. curl -sO https://aur.archlinux.org/cgit/aur.git/snapshot/paru.tar.gz &&
  18. tar xvf paru.tar.gz
  19. cd .. && chown -R "$username":wheel /home/"$username"/.local/src/ && cd .local/src || exit
  20. cd paru || 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" paru -S --noconfirm libxft-bgra-git
  24. # clone dotfiles repo
  25. cd /home/"$username"/.local/src || exit
  26. git clone git@github.com:noahvogt/dotfiles.git
  27. cp -f dotfiles/.* /home/"$username" /root
  28. # build dwm
  29. cd /home/"$username"/.local/src || exit
  30. git clone git@github.com:noahvogt/dwm.git
  31. cd dwm || exit
  32. make clean install
  33. # build st
  34. cd /home/"$username"/.local/src || exit
  35. git clone git@github.com:noahvogt/st.git
  36. cd st || exit
  37. make clean install
  38. # build dwmblocks
  39. cd /home/"$username"/.local/src || exit
  40. git clone git@github.com:noahvogt/dwmblocks.git
  41. cd dwmblocks || exit
  42. make clean install
  43. # build dmenu
  44. cd /home/"$username"/.local/src || exit
  45. git clone git@github.com:noahvogt/dmenu.git
  46. cd dmenu || exit
  47. make clean install
  48. # make user to owner of ~/ and /mnt/
  49. chown -R "$username":wheel /home/"$username"/
  50. chown -R "$username":wheel /mnt/
  51. # download packages from the official repo
  52. pacman -S --noconfirm xorg-server xorg-xinit xorg-xwininfo xorg-xprop xorg-xbacklight xorg-xdpyinfo xorg-xsetroot picom xbindkeys jdk-openjdk geogebra shellcheck neovim 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 tlp mpv xorg-xinput cpupower zsh zsh-syntax-highlighting newsboat nomacs pcmanfm openbsd-netcat powertop mupdf-tools
  53. # install aur packages
  54. sudo -u "$username" paru -S --noconfirm betterlockscreen simple-mtpfs tibasicc-git redshift dashbinsh devour plymouth vim-plug librewolf-bin lf-bin brave-bin
  55. # enable tap to click
  56. [ ! -f /etc/X11/xorg.conf.d/40-libinput.conf ] && printf 'Section "InputClass"
  57. Identifier "libinput touchpad catchall"
  58. MatchIsTouchpad "on"
  59. MatchDevicePath "/dev/input/event*"
  60. Driver "libinput"
  61. # Enable left mouse button by tapping
  62. Option "Tapping" "on"
  63. EndSection' > /etc/X11/xorg.conf.d/40-libinput.conf
  64. # set global zshenv
  65. [ ! -d /etc/zsh ] && mkdir -p /etc/zsh
  66. echo "export ZDOTDIR=\$HOME/.config/zsh" > /etc/zsh/zshenv
  67. # set the real world /etc/sudoers
  68. sed -i "s/%wheel ALL=(ALL) NOPASSWD: ALL/${username} ALL = NOPASSWD: \/usr\/bin\/mount, \/usr\/bin\/umount/g" /etc/sudoers