Closed mvasi90 closed 9 months ago
Same result after changing the last line to:
exec-once = swayidle -w timeout 10 'hyprctl dispatch dpms off' timeout 20 'if ! pgrep -x swaylock; then swaylock -f; fi; date >> /home/developer/test' resume 'hyprctl dispatch dpms on' before-sleep 'if ! pgrep -x swaylock; then swaylock -f; fi'
Note: /home/developer/test contains a single line. It runs once. Note2: The first user (user1, tty1) does not have any swayidle and swaylock setting.
Why are there two instances of swaylock? is it swaylock itself that forks?
If you use latest swaylock release and hyprland supports ext-session-lock, or use swaylock master which requires the protocol, then there is no need for any pgrep or kill tricks. Only the first swaylock isntance will be allowed to start, so you can call it freely.
is it swaylock itself that forks?
swaylock forks a child for password validation. It also forks for daemonization when you pass the -f
argument.
swaylock forks and uses a separate process to check the password. It's expected that two swaylock processes are running per swaylock instance.
Hello everyone.
I'm using
Hyperland
. I have two sessions opened. user1 on tty1 and user2 on tty2 (without display manager). I need to work concurrently with two accounts (developer and normal user).When I'm in the tty2 (user2), I can suspend the system and resume it. Also I can wait 30 seconds for auto-suspend. Everything works well.
The problem is when I switch to user1 (tty1). After 30 seconds, I see two swaylock instances:
I added the condition
if ! -x pgrep swaylcok; ...
but the same thing happens.This is my testing configuration: