Sweets

FreeBSD

Build sweetlock on FreeBSD

FreeBSD 15 or later. There is no package yet, so build from source.

Install the build dependencies and unix-selfauth-helper:

sudo pkg install meson ninja pkgconf wayland wayland-protocols libxkbcommon \
  cairo pango jpeg-turbo unix-selfauth-helper

Build and install with the default /usr/local prefix:

git clone https://github.com/sweetwm/sweetlock.git
cd sweetlock
meson setup build -Dbuildtype=release
meson compile -C build
sudo meson install -C build

Check the setup before your first real lock:

sweetlock --check

Then bind keys.

PAM

The install puts the PAM service at /usr/local/etc/pam.d/sweetlock:

auth include unix-selfauth

FreeBSD's pam_unix cannot check a password for a normal user, so the service goes through unix-selfauth-helper, as other lockers do on FreeBSD.

Without unix-selfauth-helper, PAM cannot load the service. The screen locks, the field says so on every attempt, and sweetlock --check reports it. Install the package from SSH or another VT and the next attempt picks it up, no restart needed.

Lock on idle

sweetidle rejects lock_command on FreeBSD, so lock from a listener and the sleep hook instead:

[general]
before_sleep_command = "sweetlock -f"
after_resume_command = "sweets msg output-power '*' on"

[[listener]]
timeout = 300
on_timeout = "sweetlock -f"

before_sleep_command needs sweetidle's rc hook.

What differs

Locking, backgrounds, the UI, screen off, the quiet screen and keyboard layouts work as they do on Linux. The differences:

  • No fail delay or lockout. FreeBSD's stack has no pam_faildelay and no pam_faillock, so a wrong password fails at once and nothing locks the account after repeated failures.
  • Fingerprint and security keys come from the fprintd and pam_u2f packages. Add them to /usr/local/etc/pam.d/sweetlock ahead of the include line.

On this page