01. Overview & Architecture

Profile: v1.7.0.0
Schema validatedSource pinned
Purpose
swaylock fork with blur, vignette, clock and fade-in effects.
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-effects (some from the Arch AUR)
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/jirutka/swaylock-effects ~/0xtsoa-review/jirutka-swaylock-effects# 1. clone to a review folder
$git -C ~/0xtsoa-review/jirutka-swaylock-effects checkout --detach 496059a8565c2d5eed672c2e5bc5e1edd14b3de8# 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-effects (AUR)
$yay -S swaylock-effects # AUR
$# 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/jirutka/swaylock-effects/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. Screenshot Gallery // swaylock-effects

Capture 01 // Fullscreen
swaylock-effects screenshot 1
01 / 02

04. Documentation & Guide

Source: jirutka/swaylock-effectsRef: 496059a856
README.md|GitHub Flavored Markdown

swaylock-effects

Swaylock-effects is a fork of swaylock which adds built-in screenshots and image manipulation effects like blurring. It's inspired by i3lock-color, although the feature sets aren't perfectly overlapping.

This repository (jirutka/swaylock-effects) is a fork of mortie/swaylock-effects which is no longer maintained.

Screenshot

Example Command

swaylock \
	--screenshots \
	--clock \
	--indicator \
	--indicator-radius 100 \
	--indicator-thickness 7 \
	--effect-blur 7x5 \
	--effect-vignette 0.5:0.5 \
	--ring-color bb00cc \
	--key-hl-color 880033 \
	--line-color 00000000 \
	--inside-color 00000088 \
	--separator-color 00000000 \
	--grace 2 \
	--fade-in 0.2

New Features

The main new features compared to upstream swaylock are:

  • --screenshots to use screenshots instead of an image on disk or a color
  • --clock to show date/time in the indicator
    • Use --indicator to make the indicator always active
    • Use --timestr and --datestr to set the date/time formats (using strftime-style formatting)
  • --submit-on-touch to use your touchscreen to submit a password. If you can unlock your device with anything else than your password, this might come helpful to trigger PAM's authentication process.
  • --grace <seconds> to set a password grace period, so that the password isn't required to unlock until some number of seconds have passed.
    • Used together with --indicator, the indicator is always shown, even in the grace period.
    • Used together with --indicator-idle-visible, the indicator is only visible after the grace period.
    • By default, a key press, a mouse event or a touch event will unlock during the grace period. Use --grace-no-mouse to not unlock as a response to a mouse event, and --grace-no-touch to not unlock as a response to a touch event.
  • --fade-in <seconds> to make the lock screen fade in.
  • --indicator-image <path> to display an image inside the indicator.
  • --text-clear <string>, --text-caps-lock <string>, --text-ver <string>, and --text-wrong <string> to change the texts displayed inside the indicator.
  • Various effects which can be applied to the background image
    • --effect-blur <radius>x<times>: Blur the image (thanks to yvbbrjdr's fast box blur algorithm in i3lock-fancy-rapid)
    • --effect-pixelate <factor>: Pixelate the image.
    • --effect-scale <scale>: Scale the image by a factor. This can be used to make other effects faster if you don't need the full resolution.
    • --effect-greyscale: Make the image greyscale.
    • --effect-vignette <base>:<factor>: Apply a vignette effect (range is 0-1).
    • --effect-compose <position>;<size>;<gravity>;<path>: Overlay another image.
    • --effect-custom <path>: Load a custom effect from a C file or shared object.

New feature ideas are welcome as issues (though I may never get around to implement them), new feature implementations are welcome as pull requests :)

Versions

swaylock-effects continuously incorporates changes from the original swaylock. The following table shows the relation between the swaylock-effect and swaylock versions.

swaylock-effects swaylock (original)
1.6-0 1.5
1.6-1 1.5-7-ga99afe6a
1.6-2 1.5-9-g235b925d
1.6-3 1.5-9-g235b925d
1.6.10 1.6
1.6.11 1.6
1.7.0.0 1.7-8-gb4e3a2b

Installation

From Packages

The original mortie/swaylock-effects (now unmaintained) has been packaged for:

Compiling from Source

Install dependencies:

  • meson *
  • wayland
  • wayland-protocols *
  • libxkbcommon
  • cairo
  • gdk-pixbuf2 **
  • pam (optional)
  • scdoc (optional: man pages) *
  • git *
  • openmp (if using a compiler other than GCC)

*Compile-time dep

**Optional: required for background images other than PNG

Run these commands:

meson build
ninja -C build
sudo ninja -C build install

On systems without PAM, you need to suid the swaylock binary:

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

Swaylock will drop root permissions shortly after startup.

Effects

Blur

--effect-blur <radius>x<times>: Blur the image.

<radius> is a number specifying how big the blur is, <times> is a number which specifies essentially how high quality the blur is (i.e how closely the effect will resemble a true gaussian blur).

Pixelate

--effect-pixelate <factor>: Pixelate the image.

<factor> is the amount of pixelation; a value of 10 will make each 10x10 square of pixels the same color.

Scale

--effect-scale <scale>: Scale the image by a factor.

This effect scales the internal buffer. This has a few uses:

  • Use --effect-scale in combination with --scaling to create a zoom effect: --efect-scale 1.1 --scaling center
  • Speed up other effects by making the resolution smaller: with --effect-scale 0.5 --effect-blur 7x5 --effect-scale 2, swaylock-effect needs to blur only 1/4 as many pixels.

Greyscale

--effect-greyscale: Make the displayed image greyscale.

Vignette

--effect-vignette <base>:<factor>: Apply a vignette effect. Base and factor should be between 0 and 1.

Compose

--effect-compose "<position>;<size>;<gravity>;<path>": Overlay another image to your lock screen.

  • <position>: Optional. The position on the screen to put the image, as <x>,<y>.
    • Can be a percentage (10%,10%), a number of pixels (20,20), or a mix (30%,40).
    • A negative number indicates that number of pixels away from the right/bottom instead of from the top/left; -1,-1 would be the bottom right pixel.
    • Default: 50%,50%.
  • <size>: Optional. The size of the image on the screen, as <w>x<h>.
    • Can be a percentage (10%x10%), a number of pixels (20x20), or a mix (30%x40).
    • If the width is -1, the width is figured out based on the height and aspect ratio.
    • If the height is -1, the height is figured out based on the width and aspect ratio.
    • Default: The size of the image file.
  • <gravity>: Optional. Determine which point of the image is placed at <position>.
    • Possible values: center, north, south, west, east, northwest, northeast, southwest, southeast`.
    • With a <gravity> of northwest, <position> gives the location of the top/left corner of the image; with southeast, <position> controls the bottom/right corner, center controls the middle of the image, etc.
    • Default: center if no <position> is given; otherwise, intelligently decide a gravity based on position (10,10 -> northwest, -10,10 -> northeast, etc).
  • <path>: The path to an image file.

This command requires swaylock-effects to be compiled with gdk-pixbuf2. It supports all image formats gdk-pixbuf2 supports; on my system, that's png, jpeg, gif, svg, bmp, ico, tiff, wmf, ani, icns, pnm, qtif, tga, xbm and xpm.

Custom

--effect-custom <path>: Load a custom effect from a shared object.

The .so must export a function void swaylock_effect(uint32_t *data, int width, int height) or a function uint32_t swaylock_pixel(uint32_t pix, int x, int y, int width, int height).

GitHub Flavored Markdown (github-markdown-css)README snapshot at 496059a856