01. Overview & Architecture

Profile: v1.8.6
Schema validatedSource pinned
Purpose
Screen locker for Wayland compositors.
Compatibility
Any distro (Server: WAYLAND)
Desktop Part
Lock screens
Window Manager & Theme
Any WM / DE / Other

02. Installation & Deployment

Before you installThis changes your desktop configuration and installs packages. Run it as your normal user, never with sudo: it asks for sudo only where a step needs it (listed below).The guided installer shows its plan first. Files it would replace are kept unless you approve. Everything it copies, clones or appends to in your home folder is backed up and verified first, and --rollback restores it. Packages, sudo changes and the other commands listed under Impact are not undone.
IntegrityEach release from main builds the installers in GitHub Actions and signs them with a GitHub build attestation. Verify your download against the repository, not this website (Option B, step 2). If it does not verify, don't run it.
ImpactPackages: swaylock
RecoveryGuided: backups in ~/.local/state/0xtsoa/backups/, undo with bash install.sh --rollback.Manual: the steps below only write in the download folder or run listed commands.
Option A: manual installAdvanced
Read the source at the reviewed commit, back up, then run each step yourself.
$git clone https://github.com/swaywm/swaylock ~/0xtsoa-review/swaywm-swaylock# 1. clone to a review folder
$git -C ~/0xtsoa-review/swaywm-swaylock checkout --detach 44b82de635c3bc66b0093abd1cf8cc1c8b1b9c0f# 2. the reviewed commit
Then the steps. Package commands are written for Arch; on other distros use your package manager.

Step-by-step deployment protocol

Step-by-step deployment
1Install swaylock (Arch repos)
$sudo pacman -S --needed swaylock
$# Other distros: see the upstream README
Option B: guided installerRecommended
The same steps as one script for any distro. It shows the plan first, keeps files you already have unless you approve replacing them, and backs up everything it changes in your home folder. Never pipe it into a shell.
$curl -fsSLo install.sh 'https://www.0xtsoa.dev/configs/swaywm/swaylock/install.sh'# 1. download
$gh attestation verify install.sh --repo nyharena25/0xTsoa --signer-workflow nyharena25/0xTsoa/.github/workflows/attest-installers.yml# 2. verify (GitHub CLI 2.49+, signed in)
$less install.sh# 3. read it
$bash install.sh --dry-run# 4. preview: changes nothing
$bash install.sh# 5. install (asks first)
$bash install.sh --rollback# undo the file changes
View script in browserOther options: --force (replace conflicts, backed up first), --yes, --help

03. Documentation & Guide

Source: swaywm/swaylockRef: 44b82de635
README.md|GitHub Flavored Markdown

swaylock

swaylock is a screen locking utility for Wayland compositors. It is compatible with any Wayland compositor which implements the ext-session-lock-v1 Wayland protocol.

See the man page, swaylock(1), for instructions on using swaylock.

Release Signatures

Releases are signed with E88F5E48 and published on GitHub. swaylock releases are managed independently of sway releases.

Installation

From Packages

Swaylock is available in many distributions. Try installing the "swaylock" package for yours.

Compiling from Source

Install dependencies:

  • meson *
  • wayland
  • wayland-protocols *
  • libxkbcommon
  • cairo
  • gdk-pixbuf2 **
  • pam (optional)
  • scdoc (optional: man pages) *
  • git *

* Compile-time dep
** Optional: required for background images other than PNG

Run these commands:

meson build
ninja -C build
sudo ninja -C build install
Without PAM

On systems without PAM, swaylock uses shadow.h.

Systems which rely on a tcb-like setup (either via musl's native support or via glibc+tcb), require no further action.

For most other systems, where passwords for all users are stored in /etc/shadow, swaylock needs to be installed suid:

sudo chmod a+s /usr/local/bin/swaylock

Optionally, on systems where the file /etc/shadow is owned by the shadow group, the binary can be made sgid instead:

sudo chgrp shadow /usr/local/bin/swaylock
sudo chmod g+s /usr/local/bin/swaylock

Swaylock will drop root permissions shortly after startup.

GitHub Flavored Markdown (github-markdown-css)README snapshot at 44b82de635