Skip to content

A fork of grim that takes advantage of Hyprland's custom protocols to grab specific windows.

License

Notifications You must be signed in to change notification settings

eriedaberrie/grim-hyprland

Repository files navigation

grim-hyprland

A fork of grim that takes advantage of Hyprland's custom protocols to grab specific windows.

Example usage

Grab a screenshot from the focused window under Hyprland, using hyprctl and jq:

grim -w "$(hyprctl activewindow -j | jq -r '.address')"

All original usages of Grim still work:

Screenshoot all outputs:

grim

Screenshoot a specific output:

grim -o DP-1

Screenshoot a region:

grim -g "10,20 300x400"

Select a region and screenshoot it:

grim -g "$(slurp)"

Use a custom filename:

grim $(xdg-user-dir PICTURES)/$(date +'%s_grim.png')

Screenshoot and copy to clipboard:

grim - | wl-copy

Grab a screenshot from the focused monitor under Hyprland, using hyprctl and jq:

grim -o "$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name')"

Pick a color, using ImageMagick:

grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:-

Building from source

Install dependencies:

  • meson
  • wayland
  • pixman
  • libpng
  • libjpeg (optional)

Then run:

meson build
ninja -C build

To run directly, use build/grim, or if you would like to do a system installation (in /usr/local by default), run ninja -C build install.

Contributing

This fork is on GitHub, you know what to do.

Upstream contributions

Report bugs on the issue tracker, send patches on the mailing list.

Join the IRC channel: #emersion on Libera Chat.

License

MIT