Procházet zdrojové kódy

making dmenu mount/unmount scrips work

Noah Vogt před 4 roky
rodič
revize
b9c32280dc
1 změnil soubory, kde provedl 8 přidání a 4 odebrání
  1. 8 4
      norisa.sh

+ 8 - 4
norisa.sh

@@ -6,7 +6,8 @@ pacman -Sy --noconfirm git vim ||  { printf "Error at script start:\n\nAre you s
 
 # make new user
 sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g' /etc/sudoers
-read -p "What is your desired username? " username
+sed -i 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers
+read -rp "What is your desired username? " username
 useradd -m -g users -G wheel "$username"
 passwd "$username"
 cd /home/"$username" || exit
@@ -22,7 +23,7 @@ pacman -S --noconfirm expac jq
 rm -rf /tmp/pacaur*
 curl -sO https://aur.archlinux.org/cgit/aur.git/snapshot/yay.tar.gz &&
 tar xvf yay.tar.gz
-cd .. && chown -R "$username":wheel .build/ && cd .build
+cd .. && chown -R "$username":wheel .build/ && cd .build || exit
 cd yay || exit
 sudo -u "$username" makepkg --noconfirm -si
 
@@ -32,7 +33,7 @@ sudo -u "$username" yay -S --noconfirm libxft-bgra-git
 # clone dotfiles repo
 cd /home/"$username"/.build || exit
 git clone https://github.com/noahvogt/dotfiles.git
-cp dotfiles/.* /home/"$username" /root
+cp -f dotfiles/.* /home/"$username" /root
 
 # shellcheck source=/dev/null
 source ~/.bashrc
@@ -65,7 +66,7 @@ make clean install
 chown -R "$username":wheel home/"$username"/.build
 
 # download packages from the official repo
-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
+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
 
 # install aur packages
 sudo -u "$username" yay -S --noconfirm betterlockscreen simple-mtpfs tibasicc-git xflux dashbinsh devour plymouth vim-plug
@@ -79,3 +80,6 @@ sudo -u "$username" yay -S --noconfirm betterlockscreen simple-mtpfs tibasicc-gi
     # Enable left mouse button by tapping
     Option "Tapping" "on"
 EndSection' > /etc/X11/xorg.conf.d/40-libinput.conf
+
+# set the real world /etc/sudoers
+sed -i "s/%wheel ALL=(ALL) NOPASSWD: ALL/${username} ALL = NOPASSWD: \/usr\/bin\/mount, \/usr\/bin\/umount/g" /etc/sudoers