dotfiles/fsroot/etc/apm/suspend
2023-05-01 18:13:35 -04:00

8 lines
207 B
Bash
Executable File

#!/bin/sh
# 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 &