Browse Source

Sudo fix

main
Yigit Colakoglu 4 years ago
parent
commit
635c622451
2 changed files with 5 additions and 17 deletions
  1. +1
    -5
      arch-setup/chroot.sh
  2. +4
    -12
      local/bin/dmenu-logout

+ 1
- 5
arch-setup/chroot.sh View File

@ -203,12 +203,8 @@ fi
mkdir -p /etc/sudoers.d mkdir -p /etc/sudoers.d
echo "Defaults env_reset,pwfeedback" >> /etc/sudoers.d/wheel echo "Defaults env_reset,pwfeedback" >> /etc/sudoers.d/wheel
echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/nopwd echo "%wheel ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/nopwd
echo "$username $hostname =NOPASSWD: /sbin/shutdown ,/sbin/halt,/sbin/reboot,/sbin/hibernate, /bin/pacman -Syyuw --noconfirm" > /etc/sudoers.d/wheel
if [ -f "/install/artix" ]; then
echo "$username $hostname =NOPASSWD: /usr/bin/systemctl poweroff,/usr/bin/systemctl halt,/usr/bin/systemctl reboot,/usr/bin/systemctl hibernate,/bin/pacman -Syyuw --noconfirm" > /etc/sudoers.d/wheel
else
echo "$username $hostname =NOPASSWD: /usr/bin/systemctl poweroff,/usr/bin/systemctl halt,/usr/bin/systemctl reboot,/usr/bin/systemctl hibernate,/bin/pacman -Syyuw --noconfirm" > /etc/sudoers.d/wheel
fi
sudo -u $username bash -c "git clone https://aur.archlinux.org/yay.git /tmp/yay" sudo -u $username bash -c "git clone https://aur.archlinux.org/yay.git /tmp/yay"
sudo -u $username bash -c "(cd /tmp/yay; makepkg --noconfirm -si)" sudo -u $username bash -c "(cd /tmp/yay; makepkg --noconfirm -si)"


+ 4
- 12
local/bin/dmenu-logout View File

@ -13,11 +13,6 @@ killprogs() {
pkill -x redshift pkill -x redshift
} }
# Restart function
# shellcheck source=/dev/null
restart() {
reboot
}
# Logout function # Logout function
logout() { logout() {
@ -39,23 +34,20 @@ poweroff"
selection=$(printf '%s' "$items" | $DMENU) selection=$(printf '%s' "$items" | $DMENU)
case $selection in case $selection in
restart)
restart
;;
logout) logout)
logout logout
;; ;;
hibernate) hibernate)
sudo systemctl hibernate
loginctl hibernate
;; ;;
suspend) suspend)
sudo systemctl suspend
sudo /sbin/sleep
;; ;;
reboot) reboot)
sudo systemctl reboot
sudo /sbin/reboot
;; ;;
halt|poweroff|shutdown) halt|poweroff|shutdown)
sudo systemctl poweroff
sudo /sbin/shutdown
;; ;;
esac esac


Loading…
Cancel
Save