summaryrefslogtreecommitdiff
path: root/sysact
diff options
context:
space:
mode:
Diffstat (limited to 'sysact')
-rwxr-xr-xsysact16
1 files changed, 16 insertions, 0 deletions
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