Adding a wrapper around sxmo_screenlock, with lock/unlock hooks. Allow setting a target state for sxmo_screenlock, and cleanup on sigterm. Added lock/suspend options to the power menu.

Should be applied after my prior patches from today.
This commit is contained in:
Maarten van Gompel 2020-07-25 20:29:08 +02:00 committed by Miles Alan
parent b513949b95
commit 113f756eb1
3 changed files with 56 additions and 3 deletions

View file

@ -79,9 +79,12 @@ programchoicesinit() {
elif echo "$WMCLASS" | grep -i "power"; then
# Power menu
CHOICES="
Logout ^ 0 ^ pkill -9 dwm
Reboot ^ 0 ^ st -e sudo reboot
Poweroff ^ 0 ^ st -e sudo halt
Lock ^ 0 ^ sxmo_lock.sh
Lock (Screen off) ^ 0 ^ sxmo_lock.sh --screen-off
Suspend ^ 0 ^ sxmo_lock.sh --suspend
Logout ^ 0 ^ pkill -9 dwm
Reboot ^ 0 ^ st -e sudo reboot
Poweroff ^ 0 ^ st -e sudo halt
"
WINNAME="Power"
elif echo "$WMCLASS" | grep -i "mpv"; then

10
scripts/core/sxmo_lock.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env sh
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/lock" ]; then
"$XDG_CONFIG_HOME/sxmo/hooks/lock"
fi
pkill -9 lisgd
sxmo_screenlock "$@"
lisgd &
if [ -x "$XDG_CONFIG_HOME/sxmo/hooks/unlock" ]; then
"$XDG_CONFIG_HOME/sxmo/hooks/unlock"
fi