norisa.sh 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 /home/"$username" && 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. mkdir -p /home/"$username"/dox /home/"$username"/pix /home/"$username"/dl
  25. mkdir -p /home/"$username"/vids /home/"$username"/.local/share
  26. mkdir -p /home/"$username"/.local/bin /home/"$username"/.config
  27. # clone dotfiles repo
  28. cd /home/"$username"/.local/src || exit
  29. git clone https://github.com/noahvogt/dotfiles.git
  30. cd dotfiles || exit
  31. git checkout stow
  32. /home/"$username"/.local/src/dotfiles/apply-dotfiles
  33. # build dwm
  34. cd /home/"$username"/.local/src || exit
  35. git clone https://github.com/noahvogt/dwm.git
  36. cd dwm || exit
  37. make clean install
  38. # build st
  39. cd /home/"$username"/.local/src || exit
  40. git clone https://github.com/noahvogt/st.git
  41. cd st || exit
  42. make clean install
  43. # build dwmblocks
  44. cd /home/"$username"/.local/src || exit
  45. git clone https://github.com/noahvogt/dwmblocks.git
  46. cd dwmblocks || exit
  47. make clean install
  48. # build dmenu
  49. cd /home/"$username"/.local/src || exit
  50. git clone https://github.com/noahvogt/dmenu.git
  51. cd dmenu || exit
  52. make clean install
  53. # make user to owner of ~/ and /mnt/
  54. chown -R "$username":wheel /home/"$username"/
  55. chown -R "$username":wheel /mnt/
  56. # download packages from the official repo
  57. 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 gimp xorg-setxkbmap wavemon 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 wget nomacs
  58. # install aur packages
  59. sudo -u "$username" paru -S --noconfirm betterlockscreen simple-mtpfs tibasicc-git redshift dashbinsh devour vim-plug lf-bin brave-bin
  60. # enable tap to click
  61. [ ! -f /etc/X11/xorg.conf.d/40-libinput.conf ] && printf 'Section "InputClass"
  62. Identifier "libinput touchpad catchall"
  63. MatchIsTouchpad "on"
  64. MatchDevicePath "/dev/input/event*"
  65. Driver "libinput"
  66. # Enable left mouse button by tapping
  67. Option "Tapping" "on"
  68. EndSection' > /etc/X11/xorg.conf.d/40-libinput.conf
  69. # set global zshenv
  70. [ ! -d /etc/zsh ] && mkdir -p /etc/zsh
  71. echo "export ZDOTDIR=\$HOME/.config/zsh" > /etc/zsh/zshenv
  72. # set the real world /etc/sudoers
  73. sed -i "s/%wheel ALL=(ALL) NOPASSWD: ALL/${username} ALL = NOPASSWD: \/usr\/bin\/mount, \/usr\/bin\/umount/g" /etc/sudoers