diff options
author | tsxv478 <vt0451@yandex.ru> | 2022-11-23 07:25:02 +0300 |
---|---|---|
committer | tsxv478 <vt0451@yandex.ru> | 2022-11-23 07:25:02 +0300 |
commit | 2e3cd5a7a52f08f45e768a777ce2d488b2bed81b (patch) | |
tree | 7b6256a69e5843e4178e5e70854fe9a4121e696c /sysact | |
parent | b4bb66c47323ee531473d3176a807bd1a2aa7ac5 (diff) |
sysact script
Diffstat (limited to 'sysact')
-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 |