Skip to content

Screen locker for Wayland -- fork with background plugin support

License

Notifications You must be signed in to change notification settings

mstoeckl/swaylock-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swaylock-plugin

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 images
  • mpvpaper, which lets you play videos
  • shaderbg, renders OpenGL shaders
  • rwalkbg, a very slow animation
  • wscreensaver, 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. For example:
    swaylock-plugin --command-each 'windowtolayer -- termite -e neo-matrix'
    swaylock-plugin --command-each 'windowtolayer -- alacritty -e asciiquarium'
    
  • 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 which swaylock-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.

Installation

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.

About

Screen locker for Wayland -- fork with background plugin support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 93.4%
  • Shell 3.1%
  • Meson 3.1%
  • Python 0.4%