#wayland #layer-shell #wlr-layer-shell

app wlr-screen-fade

Fade the screen to black using wlr layer shell

3 unstable releases

Uses new Rust 2024

new 0.2.0 Apr 23, 2025
0.1.1 Apr 14, 2025
0.1.0 Apr 14, 2025

#447 in Command line utilities

Download history 108/week @ 2025-04-08 103/week @ 2025-04-15

211 downloads per month

MIT license

23KB
519 lines

wlr-screen-fade

Crates.io Version License

A simple program that fades the screen to black.

This requires that your Wayland compositor supports the wlr-layer-shell protocol.

Usage

Usage: wlr-screen-fade [OPTIONS] [-- <COMMAND>...]

Arguments:
  [COMMAND]...  Command to run after the fade animation finished

Options:
  -t, --fade-duration <ms>  Time to fade to black (in milliseconds) [default: 10000]
  -r, --reverse             Fade the screen from black to transparent instead

If the program manages to run without interruption it will exit with code 0.

Any detected input (keyboard, mouse) while the screen is fading will result in the program immediately exiting with code 1.

Examples

You can use wlr-screen-fade together with swayidle and wlopm to fade out the screen before turning it off after the system has been idle for a while. Any user input while the screen is still fading will result in it not turning off.

swayidle -w timeout 300 "wlr-screen-fade -t 10000 -- wlopm --off '*'" resume "wlopm --on '*'"

Installation

Cargo

Make sure the following dependencies are installed on your system:

  • libxkbcommon
  • wayland (libwayland-client)
  • pkg-config

You can install the latest release directly from crates.io:

cargo install wlr-screen-fade

Or the current development version from the repository:

cargo install --git https://codeberg.org/qtea/wlr-screen-fade --branch main

Nix Flake

You can test wlr-screen-fade by running it directly:

nix run git+https://codeberg.org/qtea/qwf-overview

Or adding it as an input and then using the provided package:

wlr-screen-fade.packages.x86-64-linux.default

Dependencies

~21–52MB
~855K SLoC