Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nilock

Nilock demo

Rust Wayland License: MIT

A secure, modern and customizable Wayland session locker for compositors implementing ext-session-lock-v1.

nilock targets compositors that expose ext-session-lock-v1 and keeps the runtime conservative: lock, render, authenticate through PAM, unlock.

For the complete install and security notes, see docs/install.md and docs/security.md.

Nilock was born after attempting to modernize swaylock-effects for compositors using ext-session-lock-v1. Instead of continuing to patch an aging codebase, the project was rewritten from scratch in Rust with a focus on security, modern Wayland protocols, and maintainability.

Features

  • Secure ext-session-lock-v1
  • PAM authentication
  • Multi-monitor rendering
  • Per-output rendering
  • Screenshot background capture
  • Wallpaper mode
  • Blur + vignette effects
  • Fade transitions
  • Clock and date
  • Embedded Inter font
  • TOML configuration
  • Built-in presets

Goals

  • Secure by default
  • Native Wayland
  • Small dependency surface
  • Modern renderer
  • Easy packaging

Install

System package

Preferred when available:

# install the nilock package from your distro or repository

Manual install

make build
sudo make install

For packaging and PAM installation details, see docs/install.md.

Usage

nilock --clock --screenshots

Useful commands:

nilock --help
nilock --dump-default-config
nilock --self-check

Full CLI reference: docs/cli.md

Configuration

Configuration is loaded automatically from:

~/.config/nilock/config.toml

Config precedence:

defaults < config.toml < --preset < CLI flags

Example:

color = "11111b"

clock = true
time_format = "%H:%M"
date_format = "%A, %d/%m/%Y"
messages = true
idle_text = "Enter password"
verifying_text = "Verifying..."
wrong_text = "Wrong password"
success_text = "Unlocking..."

indicator = true
inside_color = "1e1e2e"
ring_color = "89b4fa"
text_color = "cdd6f4"
wrong_color = "f38ba8"
verifying_color = "f9e2af"

screenshots = true
wallpaper = "/home/caue/Pictures/wallpaper.png"
effect_blur = "7x5"
effect_vignette = "0.5:0.5"
effect_fade = 250
effect_unlock_fade = 180
indicator_animation_speed = 1.0
indicator_animation_intensity = 1.0

indicator_style = "classic"
clock_layout = "classic"
indicator_ring = true

ignore_empty = true

Architecture

Wayland
      │
      ▼
Session Lock
      │
      ▼
Output Manager
      │
      ▼
Renderer
      │
      ▼
PAM Authentication
      │
      ▼
Unlock

Background Pipeline

Lock
      │
      ▼
Solid Background
      │
      ▼
Screenshot / Wallpaper
      │
      ▼
Blur
      │
      ▼
Vignette
      │
      ▼
Cache
      │
      ▼
Fade
      │
      ▼
UI

Clock and date use embedded Inter:

  • Inter SemiBold for the time
  • Inter Regular for the date, messages, and indicator text

Status

Current release: v0.1.0-alpha

Roadmap

  • Session locking
  • PAM
  • Multi-monitor
  • Blur
  • Wallpapers
  • Config
  • Presets
  • Packaging
  • GPU renderer

Build From Source

cargo build --release

This produces:

target/release/nilock

If you want to install it system-wide after building:

sudo make install

License

The nilock source code is licensed under the MIT License. Copyright (c) 2026 Cauê Araujo.

Nilock embeds the Inter typeface under the SIL Open Font License 1.1. See LICENSE and LICENSES/OFL.txt.

About

A secure, modern and customizable Wayland session locker written in Rust.

Topics

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages