Linux

Where Is the swaylock Config File?

Where swaylock reads its config on Linux, and how it pairs with swayidle for auto-locking.

Last updated

swaylock reads ~/.config/swaylock/config for colors, background image, and indicator behavior. Flags on the command line override the file for one run, which is handy for previews.

Most setups pair it with swayidle: idle timeouts and lid events trigger swaylock automatically. Keep both configs small and versioned together. A broken image path still locks, just without the wallpaper, so failures stay safe.

Where swaylock stores this, by platform

Linux
~/.config/swaylock/config

Lock screen config (image, colors, indicator, scaling). CLI flags override per run. Usually triggered by swayidle timeouts configured in the Sway config.

Frequently asked questions

How do I configure the lock screen?

Write ~/.config/swaylock/config with image, scaling, and indicator lines, then test with swaylock -C ~/.config/swaylock/config. Add exec swayidle with timeout and before-sleep hooks in your Sway config for idle locking.

Notice an outdated path? Let us know.