Usage

By default, a daemon will run listening to the lock signal from systemd-logind. In other words, the you can start snenslock by running loginctl lock-session.

Work around sway problems

Display settings

Note: I haven't observed this in a while. This section may be outdated.

It is a known problem that sway(1) doesn't like TTY switches which may result in the following behavior when using external (HiDPI) screens:

  • The lockscreen doesn't disappear on an external monitor.
  • The scaling is broken when using larger fonts on the TTY.

It can be worked around by declaring programs.snenslock.fixExternalMonitorsInSway = true;. This script basically sets the resolution of external screens to a low resolution (1280x720) and then resets it to the previous resolution after snenslock has unlocked the screen. See also flake.nix for further details.

swayidle

When using swayidle to lock with snenslock, swayidle doesn't get back to "active state" on unlock until some activity such as hitting a random key is made by the user. This means that swayidle assumes it's still locked after unlock and thus doesn't lock again after the timeout is reached the next time.

The only workaround known so far is to restart swayidle.service after unlock in via programs.snenslock.hooks.afterLockCommands.