# nlock [![CI](https://github.com/OldUser101/nlock/actions/workflows/build_nix.yml/badge.svg)](https://github.com/OldUser101/nlock/actions/workflows/build_nix.yml) nlock is a customisable, minimalist screen locker for Wayland compositors. nlock uses the `ext-session-lock-v1` protocol, and should be compatible with any compositor that correctly implements it. ## Mirrors nlock source code can be found in a couple of places: - [ngill.net](https://git.ngill.net/nlock.git), canonical source - [GitHub](https://github.com/OldUser101/nlock), mirrored, CI - [Tangled](https://tangled.org/ngill.net/nlock), mirrored ## Usage See [the documentation](doc/toc.md). ## Building nlock is written in Rust, and uses Cargo as it's build system. It should compile with the latest stable Rust, I haven't tested older versions. In addition, you'll need development libraries for the following, which can probably be installed via your system package manager: - glib - gdk-pixbuf (optional, provides support for non-PNG image formats) - pam (except openbsd) - cairo - pango (optional, provides support for system font loading) - xkbcommon gdk-pixbuf and pango are both optional, and are enabled with the features `gdk-pixbuf` and `pango` respectively. These features are enabled by default, you will need to disable them if you do not plan on using these libraries. On OpenBSD targets, BSD Authentication is natively supported and will be selected as the authentication backend automatically, PAM is not required in this case. With all of that, you should just be able to clone this repository, and run: ```sh $ cargo build --release ``` The generated binary should be located at `target/release/nlock`. **IMPORTANT:** You may need to copy the PAM configuration for nlock into `/etc/pam.d` on your system. The configuration can be found in the `pam` directory of this repository. ## Demo ![](https://ngill.net/demo/nlock.jpg) ## Credits Several other projects have been very helpful during development of nlock: - [swaylock](https://github.com/swaywm/swaylock) - rendering with Cairo, and general architecture. - [where-is-my-sddm-theme](https://github.com/stepanzubkov/where-is-my-sddm-theme) - the SDDM theme that nlock is based on. ## License nlock is licensed under the GNU General Public License Version 3, or later. See [LICENSE](LICENSE) for details. Copyright (C) 2026, Nathan Gill