LinuxCommandLibrary

hyprshot

Capture screenshots for Hyprland

TLDR

Select and take a screenshot of a region

$ hyprshot [[-m|--mode]] region
copy

Select and take a screenshot of a specific window
$ hyprshot [[-m|--mode]] window
copy

Select and take a screenshot of a specific output
$ hyprshot [[-m|--mode]] output
copy

Take a screenshot of the currently active window
$ hyprshot [[-m|--mode]] active [[-m|--mode]] window
copy

Freeze the screen and take a screenshot of the selected region
$ hyprshot [[-z|--freeze]] [[-m|--mode]] region
copy

Select and take a screenshot of a specific window, saving to the given output directory
$ hyprshot [[-o|--output-folder]] [path/to/directory] [[-m|--mode]] window
copy

Select and take a screenshot of a specific output, saving the screenshot to the clipboard only
$ hyprshot --clipboard [[-m|--mode]] output
copy

SYNOPSIS

hyprshot [-m MODE] [-s SOURCE] [-o PATH] [-c] [-e CMD] [-n] [-d SECONDS]

PARAMETERS

-m, --mode MODE
    Screenshot mode: output, monitor, activewindow, window, region (default: output)

-s, --source SOURCE
    Monitor name or window class (used with monitor or window modes)

-o, --output PATH
    File path to save screenshot (default: ~/Pictures/Screenshot-%Y%m%d-%H%M%S.png)

-c, --clipboard
    Copy screenshot to clipboard instead of saving to file

-e, --exec CMD
    Execute command after taking screenshot, with $output as argument

-n, --notify
    Send desktop notification after screenshot

-d, --delay SECONDS
    Delay in seconds before capturing (default: 0)

-h, --help
    Show help message

DESCRIPTION

Hyprshot is a dedicated screenshot tool designed specifically for Hyprland, a dynamic tiling Wayland compositor for Linux. It provides an intuitive interface for capturing screenshots in various modes, including full output, specific monitors, active windows, selected windows, or user-defined regions.

Under the hood, hyprshot leverages grim for capturing and slurp for region selection, integrating seamlessly with Hyprland's ecosystem. Users can save images to disk with customizable paths (defaulting to ~/Pictures/Screenshot-%Y%m%d-%H%M%S.png), copy to clipboard, add delays, execute post-capture commands, or trigger notifications.

This tool excels in keyboard-driven workflows, often bound to Hyprland keybinds for quick access (e.g., Super+Print for region shots). It supports window class targeting for precise captures and enhances productivity in minimalistic, Wayland-native environments. Unlike generic tools, hyprshot respects Hyprland's configuration for notifications and dispatchers.

CAVEATS

Requires Hyprland and Wayland; depends on grim(1) and slurp(1). Region selection needs swappy(1) or similar for editing. No X11 support.

INSTALLATION

Arch: hyprshot from AUR; other distros via source from GitHub. Bind in Hyprland config: bind = $mainMod, Print, exec, hyprshot -m region.

CONFIGURATION

Integrates with Hyprland's dispatchers and notifications. Customize output format with strftime specifiers in -o.

HISTORY

Developed around 2023 as part of Hyprland ecosystem by community contributors. Gained popularity with Hyprland v0.30+ for improved Wayland screenshot workflows, replacing ad-hoc scripts.

SEE ALSO

grim(1), slurp(1), swappy(1), hyprctl(1)

Copied to clipboard