This is a fork of swaylock
, a screen
locking utility for Wayland compositors. With swaylock-plugin
, you can for
your lockscreen background display the animated output from any wallpaper program
that implements the wlr-layer-shell-unstable-v1
protocol. All you have to do
is run swaylock-plugin --command 'my-wallpaper ...'
, where my-wallpaper ...
is replaced by your desired program. Examples:
swaybg
, which displays regular background imagesmpvpaper
, which lets you play videosshaderbg
, renders OpenGL shadersrwalkbg
, a very slow animationwscreensaver
, an experiment in porting a few xscreensaver hacks to Wayland. Best with the--command-each
flag.windowtolayer
, a tool that can be used to run normally windowed applications, like terminals, as wallpapers. Requires--command-each
flag.- You can rotate between wallpapers in a folder by setting the following script
as the command; e.g.:
swaylock-plugin --command './example_rotate.sh /path/to/folder'
. (This works by periodically killing the wallpaper program, after whichswaylock-plugin
automatically restarts it.)#!/bin/sh file=`ls $1 | shuf -n 1` delay=60. echo "Runnning swaybg for $delay secs on: $1/$file" timeout $delay swaybg -i $1/$file
swaylock-plugin
requires that the Wayland compositor implement the ext-session-lock-v1
protocol.
This is experimental software, so if something fails to work it's probably a bug in this program -- report it at https://github.com/mstoeckl/swaylock-plugin .
As this fork is not nearly as well tested as the original swaylock, before using this
program, ensure that you can recover from both an unresponsive lockscreen and one
that has crashed. (For example, in Sway, by creating a --locked
bindsym to kill and
restart swaylock-plugin; or by switching to a different virtual terminal, running
killall swaylock-plugin
and running swaylock-plugin, and restarting with e.g. WAYLAND_DISPLAY=wayland-1 swaylock-plugin
.)
See the man page, swaylock-plugin(1)
, for instructions on using swaylock-plugin.
Install dependencies:
- meson *
- wayland
- wayland-protocols *
- libxkbcommon
- cairo
- gdk-pixbuf2
- pam (optional)
- scdoc (optional: man pages) *
- git *
- swaybg
* Compile-time dep
Run these commands:
meson build
ninja -C build
sudo ninja -C build install
On systems without PAM, you need to suid the swaylock-plugin binary:
sudo chmod a+s /usr/local/bin/swaylock-plugin
Swaylock will drop root permissions shortly after startup.