Skip to content

Integration

wlroots based compositors (Sway, Wayfire, River, ...)

You can bind a key to the following command:

grim -g "$(slurp -o -r -c '#ff0000ff')" -t ppm - | satty --filename - --fullscreen --output-filename ~/Pictures/Screenshots/satty-%Y%m%d-%H:%M:%S.png

Hyprland

The following Hyprland binding will use slurp and grim to make the screenshot, copy it to the clipboard by wl-copy and start Satty with a predefined output path:

hl.bind(
    "Print",
    hl.dsp.exec_cmd(
        'sh -c "grim -g \\"$(slurp -o -c \'#ff0000ff\')\\" -t ppm - | tee >(wl-copy --type image/png) | satty -f - --output-filename ~/Pictures/screenshot-%Y-%m-%d_%H-%M-%S.png"'
    ),
    { description = "Satty Screenshot" }
)

To make Satty a floating window in Hyprland, add a window rule:

hl.window_rule({
    match = { class = "com.gabm.satty" },
    no_anim = true,
    float = true,
    center = true,
    --min_size = { 200, 200 },
    --min_size = { 600, 600 },
})

Please note we're using ppm in both examples. Compared to png, ppm is uncompressed and this can save time.

Other examples

Image Resize

Satty does not provide a resize mechanism other than cropping. But you can pipe the result to other tools such as ImageMagick:

grim -g "0,0 3840x2160" -t ppm - | satty --filename - --output-filename - | convert -resize 50% - out.png

Sway mode

Add this to your ~/.config/sway/config. It needs grim and slurp.

# screenshots
# inspiration: https://www.reddit.com/r/swaywm/comments/ghnlea/comment/fqnzxkx/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
set $satty satty -f - --initial-tool=arrow --copy-command=wl-copy --actions-on-escape="save-to-clipboard,exit" --brush-smooth-history-size=5 --disable-notifications
set $printscreen_mode 'printscreen (r:region, f:full, w:window)'
mode $printscreen_mode {
    bindsym r exec swaymsg 'mode "default"' && grim -t ppm -g "$(slurp -d)" - | $satty
    bindsym f exec swaymsg 'mode "default"' && grim -t ppm - | $satty
    bindsym w exec swaymsg 'mode "default"' && swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | grim -t ppm -g - - | $satty

    bindsym Return mode "default"
    bindsym Escape mode "default"
}
bindsym $mod+Shift+p mode $printscreen_mode