Skip to content

shikoucore/hyprshot-rs

Repository files navigation

Crates.io Version Crates.io Downloads AUR version Crates.io License Rust


if you like this project, then the best way to express gratitude is to give it a star ⭐, it doesn't cost you anything, but I understand that I'm moving the project in the right direction.

Hyprshot-rs logo

Hyprshot-rs

0.1.8

CHANGELOG

A utility to easily take screenshots on Wayland (tested on Hyprland and Sway).

Features

  • Screenshot Capture
    • Capture the entire monitor (output)
    • Capture the active monitor (output + active)
    • Capturing the selected region
    • Capturing the selected window
    • Capture of the active window
  • Save & Clipboard
    • Save screenshots to a specified folder and copy to clipboard (use --clipboard-only for clipboard-only)
    • Screenshots saved in PNG format
  • Configuration System
    • TOML-based configuration (~/.config/hyprshot-rs/config.toml)
    • Persistent settings for paths, hotkeys, notifications, and more
    • CLI commands for config management (--init-config, --show-config, --set)
  • Hyprland Integration
    • Automatic keybinding generation (--generate-hyprland-config)
    • One-command installation to hyprland.conf (--install-binds)
    • Interactive hotkeys setup wizard (--setup-hotkeys)
  • Documentation

Installation

Via Cargo:

cargo install hyprshot-rs

Note: cargo install builds from source. Selector functionality is provided by slurp-rs directly, so no external slurp binary is required.

Via AUR (Arch Linux):

yay -S hyprshot-rs

The AUR package is the primary distribution channel: the newest releases and experimental features land there first. Dependencies are pulled automatically (no extra manual steps required).

Runtime Dependencies

Required:

  • wl-clipboard - for clipboard operations
  • a Wayland compositor (Hyprland or Sway)

Optional:

  • No extra tools required for --freeze

On Arch Linux (example):

sudo pacman -S wl-clipboard hyprland

Note: selector functionality is fully provided by slurp-rs API.


Usage

Make it available regardless of the shell

sudo ln -s ~/.local/share/cargo/bin/hyprshot-rs /usr/local/bin/
hyprshot-rs [options ..] [-m [mode] ..] -- [command]
possible values: output, window, region, active, OUTPUT_NAME

Note: active is a modifier and must be combined with output or window.

Compatibility

  • region and output work on Wayland without hyprctl (via slurp-rs API backend).
  • output -m DP-1 works without hyprctl (Wayland output enumeration).
  • window and active are supported on Hyprland and Sway only (via hyprctl/swaymsg).

Possible values:

  • Capture a window:
hyprshot-rs -m window
  • To take a screenshot of a specific area of the screen, use:
hyprshot-rs -m region
  • If you have 2 or more monitors and want to take a screenshot of the workspace on a specific monitor:
hyprshot-rs -m output
  • Quick capture (active monitor under the cursor):
hyprshot-rs -m output -m active
  • Capture the active window:
hyprshot-rs -m window -m active
  • Capture a specific monitor by name (example: DP-1):
hyprshot-rs -m output -m DP-1

Use your compositor to list output names (Hyprland: hyprctl monitors).

  • Take a screenshot of a selected area and save it in the current directory: ~/repository
hyprshot-rs -m region -r > output.png

redirects the output to output.png in your current working directory. So if you're currently in ~/repository when running this command, that's where the screenshot will be saved, not in the default ~/Pictures directory.

Run hyprshot-rs --help or hyprshot-rs -h for more options.

Configuration

Initialize configuration:

hyprshot-rs --init-config

Configure settings:

hyprshot-rs --set paths.screenshots_dir ~/user_name/Screenshots
hyprshot-rs --set capture.notification_timeout 500

View current configuration:

hyprshot-rs --show-config

Hyprland Integration

Quick setup with interactive wizard:

hyprshot-rs --setup-hotkeys

Or manually generate and install keybindings:

# Generate keybindings
hyprshot-rs --generate-hyprland-config --with-clipboard

# Install to hyprland.conf (creates backup)
hyprshot-rs --install-binds --with-clipboard

Manual configuration - add to hyprland.conf:

bind = SUPER, Print, exec, hyprshot-rs -m window
bind = SUPER SHIFT, Print, exec, hyprshot-rs -m region
bind = SUPER CTRL, Print, exec, hyprshot-rs -m output
bind = , Print, exec, hyprshot-rs -m output -m active

See HOTKEYS.md for more examples. Based on the implementation: Hypershot

License

GPL-3.0