Grab images from a Wayland compositor
See the code⚠️ Heads up! This project has moved to SourceHut.
Grab images from a Wayland compositor. Works great with slurp and with sway.
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 Sway, using swaymsg and
jq:
grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name')
Grab a screenshot from the focused window under Sway, using swaymsg and
jq:
grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')"
Pick a color, using ImageMagick:
grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:-
Install dependencies:
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.
Either send GitHub pull requests or send patches on the mailing list.
Join the IRC channel: #emersion on Libera Chat.
MIT
(top 24 of 25)
467 followers · starred Jun 2020
1,255 followers · starred Feb 2019
685 followers · starred Nov 2020
759 followers · starred May 2020
Grab images from a Wayland compositor
See the code⚠️ Heads up! This project has moved to SourceHut.
Grab images from a Wayland compositor. Works great with slurp and with sway.
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 Sway, using swaymsg and
jq:
grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name')
Grab a screenshot from the focused window under Sway, using swaymsg and
jq:
grim -g "$(swaymsg -t get_tree | jq -j '.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"')"
Pick a color, using ImageMagick:
grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:-
Install dependencies:
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.
Either send GitHub pull requests or send patches on the mailing list.
Join the IRC channel: #emersion on Libera Chat.
MIT
(top 24 of 25)
467 followers · starred Jun 2020
1,255 followers · starred Feb 2019
685 followers · starred Nov 2020
759 followers · starred May 2020