8 lines
207 B
Bash
Executable File
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 &
|