norisa.sh 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. # install vim-plug
  46. cd /home/"$username"/.build || exit
  47. curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
  48. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  49. # make user to owner of ~/.build
  50. chown -R "$username":wheel home/"$username"/.build
  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 dmenu geogebra shellcheck vim firefox syncthing ranger xournalpp ffmpeg obs-studio sxiv arandr man-db brightnessctl unzip unrar python mupdf 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
  53. # install aur packages
  54. sudo -u "$username" yay -S --noconfirm betterlockscreen simple-mtpfs tibasicc-git xflux dashbinsh devour
  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