mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Allow passwordless sudo to be toggled from the toggle menu
This commit is contained in:
+2
-1
@@ -168,7 +168,7 @@ show_share_menu() {
|
||||
}
|
||||
|
||||
show_toggle_menu() {
|
||||
local options=" Screensaver\n Nightlight\n Idle Lock\n Top Bar\n Workspace Layout\n Window Gaps\n 1-Window Ratio\n Monitor Scaling\n Direct Boot"
|
||||
local options=" Screensaver\n Nightlight\n Idle Lock\n Top Bar\n Workspace Layout\n Window Gaps\n 1-Window Ratio\n Monitor Scaling\n Direct Boot\n Passwordless Sudo"
|
||||
|
||||
case $(menu "Toggle" "$options") in
|
||||
*Screensaver*) omarchy-toggle-screensaver ;;
|
||||
@@ -180,6 +180,7 @@ show_toggle_menu() {
|
||||
*Gaps*) omarchy-hyprland-window-gaps-toggle ;;
|
||||
*Scaling*) omarchy-hyprland-monitor-scaling-cycle ;;
|
||||
*"Direct Boot"*) present_terminal omarchy-config-direct-boot ;;
|
||||
*"Passwordless Sudo"*) present_terminal omarchy-sudo-passwordless ;;
|
||||
*) back_to show_trigger_menu ;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ if [[ $1 && ! $1 =~ ^[0-9]+$ ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Toggle passwordless sudo..."
|
||||
|
||||
# Safety: if the file exists but the timer doesn't (e.g. after reboot), clean up
|
||||
if sudo test -f "$NOPASSWD_FILE" && ! systemctl is-active "${TIMER_NAME}.timer" &>/dev/null; then
|
||||
sudo rm "$NOPASSWD_FILE"
|
||||
@@ -33,7 +35,7 @@ if sudo test -f "$NOPASSWD_FILE"; then
|
||||
fi
|
||||
else
|
||||
echo ""
|
||||
echo "⚠️WARNING: This will allow ANY process running as your user to"
|
||||
echo "⚠️ WARNING: This will allow ANY process running as your user to"
|
||||
echo "execute ANY command as root WITHOUT a password for ${MINUTES} minutes."
|
||||
echo ""
|
||||
echo "This is useful for AI agents that need to run sudo commands,"
|
||||
|
||||
Reference in New Issue
Block a user