diff options
-rwxr-xr-x | sysact | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -0,0 +1,16 @@ +#!/bin/sh + +case "$(readlink -f /sbin/init)" in + *systemd*) ctl='systemctl' ;; + *) ctl='loginctl' ;; +esac + +action="$(printf "Lock\nSleep\nReboot\nShutdown" | dmenu -i -c -l 4 -p 'Action:')" + +case "$action" in + "Lock") xset dpms force off && slock ;; + "Sleep") slock $ctl suspend -i ;; + "Reboot") $ctl reboot -i ;; + "Shutdown") $ctl poweroff -i ;; + *) exit ;; +esac |