From 2e3cd5a7a52f08f45e768a777ce2d488b2bed81b Mon Sep 17 00:00:00 2001 From: tsxv478 Date: Wed, 23 Nov 2022 07:25:02 +0300 Subject: sysact script --- sysact | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 sysact diff --git a/sysact b/sysact new file mode 100755 index 0000000..977b9a6 --- /dev/null +++ b/sysact @@ -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 -- cgit v1.2.3