dotfiles/fsroot/etc/apm/suspend

8 lines
207 B
Plaintext
Raw Normal View History

2022-10-02 00:16:21 +02:00
#!/bin/sh
2023-05-02 00:13:35 +02:00
# Get the current Xsession user
_user=$(ps -o user= -p $(pgrep -f Xsession))
pkill slock
# Run xlock as the Xsession user
doas -u $_user env DISPLAY=:0 XAUTHORITY=/home/$_user/.Xauthority slock &