wms/wms_session.sh
2023-08-24 11:29:51 -03:00

50 lines
933 B
Bash
Executable file

#!/bin/sh
## manage session and some more things ##
. /tmp/wms_var
KBRELOAD="pkill -usr1 -x sxhkd" # keybindings reload
LOCK="slock" # lock screen monitor
MOFF="xset dpms force off" # poweroff monitor
SP="doas zzz -z" # suspend to RAM
HB="doas zzz -Z" # hibernate
RB="doas shutdown -r now" # reboot
POFF="doas shutdown -h now" # poweroff
EXIT="pkill sxhkd; pkill wew" # exit session
PROMPT="reload-key\nlock\nmonitor-off\nhalt\nreboot\nsuspend\nhibernate\nexit"
option=`echo $PROMPT | $XMENU`
if [ ${#option} -gt 0 ]; then
case $option in
reload-key)
$KBRELOAD
;;
lock)
$LOCK
;;
monitor-off)
$MOFF
;;
suspend)
$SP
;;
hibernate)
$HB
;;
halt)
$POFF
;;
reboot)
$RB
;;
exit)
$EXIT
;;
*)
;;
esac
else
exit 0
fi