wms/wms_session.sh

47 lines
860 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-03-20 02:46:41 +01:00
. $HOME/.config/wms/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
HB="doas pm-hibernate" # hibernate
RB="doas shutdown -r now" # reboot
POFF="doas shutdown -h now" # poweroff
2023-03-06 19:08:25 +01:00
EXIT="pkill wew && pkill sxhkd" # exit session
2023-03-13 06:07:04 +01:00
PROMPT="reload-key\nlock\nmonitor-off\nhalt\nreboot\nsuspend\nlogout"
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
;;
suspend)
$HB
;;
halt)
$POFF
;;
reboot)
$RB
;;
logout)
$EXIT
;;
*)
;;
esac
else
exit 0
fi