swaylock(1)
Screen locker for Wayland compositors that turns the screen off after a timeout.
Synopsis
swaylock [OPTION]..."Description
swaylock is a screen locker for Wayland compositors. It displays a locked screen and prevents further interaction with the desktop until the correct password is entered. The screen can be configured to turn off after a timeout, and supports multiple displays.
swaylock is the recommended lock screen for Sway and other Wayland-based window managers. It reads the user's password from the login database and compares it against the entered password.
Common options
| Flag | What it does |
|---|---|
-c, --color | Set the color displayed for the background when no image is set (hex value, e.g., #000000) |
-i, --image | Display an image on the lockscreen (path to image file, use output names like HDMI-1 for per-display images) |
-s, --scaling | Image scaling mode: stretch, fill, fit, center (default: fill) |
-t, --tiling | Tile the image instead of scaling it |
-f, --font | Set the font used for text (e.g., 'monospace' or 'DejaVu Sans 12') |
-S, --screenshot | Screenshot the current screen and use it as the background image |
-l, --line-uses-ring | Display the line and ring around the password indicator |
-e, --fadeout | Fade to black after the given number of milliseconds (requires dmpower support) |
-k, --key-binds | Show key bindings and exit |
-h, --help | Show help message and exit |
Examples
Lock the screen with a black background (default)
swaylockLock the screen with a dark gray background color
swaylock -c 1a1a1aLock the screen with a custom background image
swaylock -i ~/Pictures/lockscreen.pngLock the screen using a screenshot of the current desktop as the background
swaylock -S -c 000000Use different images for different displays
swaylock -i HDMI-1:~/wallpaper.png -i eDP-1:~/mobile.pngLock with an image fitted to the screen and dark gray fallback color
swaylock -i ~/bg.png -s fit -c 333333