LinuxCommandLibrary

swaylock

Screen locker for Sway Wayland compositor

TLDR

Lock screen

$ swaylock
copy
With solid color
$ swaylock -c [1a1a2e]
copy
With image
$ swaylock -i [wallpaper.jpg]
copy
Per-output images
$ swaylock -i [HDMI-A-1:wallpaper.jpg]
copy
Blur effect
$ swaylock --effect-blur [7x5]
copy
Show failed attempts
$ swaylock -f --show-failed-attempts
copy
Daemonize
$ swaylock -f
copy

SYNOPSIS

swaylock [-c color] [-i image] [-f] [options]

DESCRIPTION

swaylock is a screen locking utility for Sway and other Wayland compositors, providing secure session locking with PAM-based authentication. It renders a lock screen over all outputs and requires the user's password to unlock.
The lock screen background can be customized with solid colors or images, with per-output image support for multi-monitor setups. An indicator ring shows the current state: idle, typing, password verification, and incorrect password. The swaylock-effects fork adds additional visual effects like blur.
The daemonize flag causes swaylock to fork to the background after the lock screen is displayed, which is essential when used with swayidle's before-sleep event to ensure the screen is locked before the system suspends.

PARAMETERS

-c, --color COLOR

Background color.
-i, --image IMAGE
Background image.
-f, --daemonize
Run as daemon.
-s, --scaling MODE
Image scaling.
--effect-blur PARAMS
Blur effect.
--show-failed-attempts
Show failures.
--indicator-radius N
Indicator size.

CAVEATS

Wayland/Sway only. PAM configuration needed. Some effects need swaylock-effects fork.

HISTORY

swaylock is the screen locker for Sway compositor. It's a Wayland replacement for i3lock.

SEE ALSO

sway(1), swaybg(1), i3lock(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community