diff options
author | tsxv478 <atvx717@infraredcombat.xyz> | 2022-11-23 07:25:02 +0300 |
---|---|---|
committer | tsxv478 <atvx717@infraredcombat.xyz> | 2022-11-23 07:25:02 +0300 |
commit | 32ddf11aa803e89b69c89adc41cc3f326a46aa95 (patch) | |
tree | 7b6256a69e5843e4178e5e70854fe9a4121e696c | |
parent | 4a42c6030946971124fc4b7d7d5337ad70979a95 (diff) |
sysact script
-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 |