Screen locking woes

For context, I’m using XMonad under xfce4, with compton.

light-locker doesn’t work anymore. The only workaround is to switch to a different VT, log in, and manually unlock the session with loginctl. So I decided to try different lockers, but kept finding fatal flaws.

  • physlock: The display never shuts off. Otherwise this would definitely be my choice. I’m having trouble finding a way to fix this.
  • i3lock: Breaks with compton. If a new window like a notification shows up, all your windows are brought to the foreground, in front of the lock. Works fine without compton though.
  • xsecurelock: Breaks with compton in the same way, plus the background wigs out with some white flashing. Otherwise works fine.
  • slock: slock: unable to disable OOM killer. Make sure to suid or sgid slock., but with sudo, I get slock: crypt: Invalid argument
  • xlockmore: Same issue with compton as i3lock.

The obvious conclusion is that I should… just not use compton. But when I don’t have compton enabled, I get horrible screen tearing in my windows, and I’m not really sure why.

Anybody have any guidance on this matter?

3 Likes

Sorry, don’t know anything about this issue but you could try xscreensaver? It also performs locking and I haven’t had any issues with it, although I don’t use compton…

For slock, do you have programs.slock.enable = true in your nixos configuration?

The error looks like slock is attempting to disable OOM killer, but failing due to permissions. Using the nixos setting will install slock with a setuid wrapper that should allow for this.

2 Likes

Ultimately my “solution” was to surround my actual locking command in my locker wrapper script with systemctl --user stop compton.service and systemctl --user start compton.service. Ultimately it looks like lockers kind of have to be implemented as compositors, and having more than one concurrent compositor is a nonsense idea. So this seems the most robust, if a little dissatisfying. I really would have liked to just use physlock :stuck_out_tongue:

Testing currently if this patch Logind signal emitting fix by keszybz · Pull Request #13811 · systemd/systemd · GitHub will fix the issues with light-locker. If it does, I’ll be sure it gets applied to systemd on master and 19.09.
(once merged of course)

Sweet! Though I bet it’ll still have issues with compton, unfortunately.

Cross referencing lightlocker: broken on second lock activation with systemd 243 · Issue #69399 · NixOS/nixpkgs · GitHub if anyone wants a nixos config to use the patch. I did confirm it fixed the issue.