wayland: Fix suspend input locking after timeout

This commit fixes input locking when suspend was invoked autoatically
after a certain amount of time.

Previously, it would invoke the lockscreen first, then dim the screen
and finally suspend the machine. While suspending it would invoke the
lockscreen *again* however, which seems to lead to generally locking
input (perhaps 2 instances of waylock disable each others' input
ability?).

This change checks for a running lockscreen first before invoking
another one, which should hopefully fix the issue.
This commit is contained in:
Marty Oehme 2022-12-24 16:41:45 +01:00
parent 7865626f5b
commit 660f6b0ca6
Signed by: Marty
GPG key ID: 73BA40D5AFAF49C9

View file

@ -250,12 +250,12 @@ exec kanshi &
# start screen idle locking/dimming/sleep tool # start screen idle locking/dimming/sleep tool
killall swayidle killall swayidle
exec swayidle \ exec swayidle \
timeout "${time_to_lockscreen}" 'lockscreen' \ timeout "${time_to_lockscreen}" 'pidof waylock || lockscreen' \
timeout "${time_to_screendim}" 'wlopm --off "*"' \ timeout "${time_to_screendim}" 'wlopm --off "*"' \
timeout "${time_to_suspend}" 'systemctl suspend-then-hibernate' \ timeout "${time_to_suspend}" 'systemctl suspend-then-hibernate' \
resume 'wlopm --on "*"' \ resume 'wlopm --on "*"' \
after-resume 'wlopm --on "*"' \ after-resume 'wlopm --on "*"' \
before-sleep 'lockscreen' & before-sleep 'pidof waylock || lockscreen' &
killall clipman killall clipman
exec wl-paste -t text --watch clipman store & exec wl-paste -t text --watch clipman store &