diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2023-05-17 00:09:51 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2023-05-17 00:09:51 +0200 |
| commit | 5d3c0b24405381a41bd13a3135fa2969c2b47a48 (patch) | |
| tree | c59a2521159b90daac9e139e5ebaeaf24dd3fa0f /scripts/dmenuoff | |
| parent | 436159f3542d4e11c81ff927ab6b22f5ad2619e0 (diff) | |
| parent | ca1fba1ef518b2f55bc168e9782b500dfec67c16 (diff) | |
Merge branch 'main' of https://github.com/Laitram31/config
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 |
