From 7e1032434d90db737e319d3eb21721b7fed388be Mon Sep 17 00:00:00 2001 From: marcellus Date: Tue, 2 May 2023 18:30:47 +0200 Subject: add: scripts from ratakor's repo --- scripts/dmenuoff | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 scripts/dmenuoff (limited to 'scripts/dmenuoff') 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 -- cgit v1.2.3