46 lines
860 B
Bash
Executable file
46 lines
860 B
Bash
Executable file
#!/bin/sh
|
|
|
|
## manage session and some more things ##
|
|
|
|
. $HOME/.config/wms/wms_var
|
|
|
|
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
|
|
EXIT="pkill wew && pkill sxhkd" # exit session
|
|
PROMPT="reload-key\nlock\nmonitor-off\nhalt\nreboot\nsuspend\nlogout"
|
|
|
|
option=`echo $PROMPT | $XMENU`
|
|
if [ ${#option} -gt 0 ]; then
|
|
case $option in
|
|
reload-key)
|
|
$KBRELOAD
|
|
;;
|
|
lock)
|
|
$LOCK
|
|
;;
|
|
monitor-off)
|
|
$MOFF
|
|
;;
|
|
suspend)
|
|
$HB
|
|
;;
|
|
halt)
|
|
$POFF
|
|
;;
|
|
reboot)
|
|
$RB
|
|
;;
|
|
logout)
|
|
$EXIT
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|
|
|
|
else
|
|
exit 0
|
|
fi
|