wms/wms_session.sh

51 lines
933 B
Bash
Raw Normal View History

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