diff options
Diffstat (limited to 'scripts/dmenuoff')
| -rwxr-xr-x | scripts/dmenuoff | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/dmenuoff b/scripts/dmenuoff new file mode 100755 index 0000000..e278c8a --- /dev/null +++ b/scripts/dmenuoff @@ -0,0 +1,15 @@ +#!/bin/sh +# menu for shutdown or lock +# require nopass for poweroff and reboot and my build of dmenu for -hf + +QUERY=$(printf 'no\nlock\npoweroff\nreboot' | dmenu -i -sb '#cc241d' -hf '#689d6a' -p 'Shutdown?') +ROOTCMD="${ROOTCMD:-$(command -v doas || command -v sudo)}" + +case "$QUERY" in +"lock") + slock ;; +"poweroff") + "$ROOTCMD" poweroff ;; +"reboot") + "$ROOTCMD" reboot ;; +esac
\ No newline at end of file |
