Skip to content

Tool to freeze the screen of a Wayland compositor

License

Notifications You must be signed in to change notification settings

Jappie3/wayfreeze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wayfreeze

A small CLI tool to freeze the screen of a wlroots compositor, this can be useful to, for example, take a screenshot. Supports multiple monitors & fractional scaling.

Usage

Run wayfreeze, click or press escape to exit.

Usage: wayfreeze [OPTIONS]

Options:
      --hide-cursor  Hide cursor when freezing the screen
  -h, --help         Print help
  -V, --version      Print version

Example usage with Grim & Slurp:

wayfreeze & PID=$!; sleep .1; grim -g "$(slurp)" - | wl-copy; kill $PID

Installing

Wayfreeze can be installed either by using nixpkgs-unstable or flake.

Nixpkgs:

Add this to your configuration and rebuild your system:

environment.systemPackages = [ pkgs.wayfreeze ];

Flake:

Add this repository as a flake to your inputs:

wayfreeze.url = "github:jappie3/wayfreeze";

Define the package and then rebuild your system:

environment.systemPackages = [ inputs.wayfreeze.packages.${pkgs.system}.wayfreeze ];

From source:

First, make sure you have Rust & Cargo installed. Then clone this repo & run cargo build --release, the compiled binary should be under ./target/release/wayfreeze.

Technical

The following protocols should be supported by your compositor:

  • wlr-layer-shell-unstable-v1 -> used for creating & rendering a layer surface
  • wlr-screencopy-unstable-v1 -> used for copying the current output to a client buffer
  • wp-fractional-scale-v1 -> to support fractional scaling
  • wp-viewporter -> for scaling the surface

Credits

In no particular order, here are some resources that were helpful when creating this tool & learning about the Wayland protocol:

About

Tool to freeze the screen of a Wayland compositor

Topics

Resources

License

Stars

Watchers

Forks