diff options
| author | marcellus <msimon_fr@hotmail.com> | 2023-05-02 18:30:47 +0200 |
|---|---|---|
| committer | marcellus <msimon_fr@hotmail.com> | 2023-05-02 18:30:47 +0200 |
| commit | 7e1032434d90db737e319d3eb21721b7fed388be (patch) | |
| tree | 292b4bc560edd33f1fbcd9655c9b76b49b75b404 /scripts/dmenuoff | |
| parent | 7d1e4e8fbcb57d7e3b04f730f6e51c0e00b76456 (diff) | |
add: scripts from ratakor's repo
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 |
