Skip to content

About

macOS-style screenshot preview with drag-and-drop for Wayland/Hyprland

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

omarchy-screenshot-preview

macOS-style screenshot preview for Wayland/Hyprland. After taking a screenshot, a draggable thumbnail appears in the bottom-right corner.

  • Drag it into any app to share the image
  • Click to open the screenshot editor (satty by default)
  • Hover to pause the auto-dismiss timer
  • Auto-dismisses after 5 seconds with a fade animation

Built with Rust, GTK4, and gtk4-layer-shell. Single 420K binary, no runtime dependencies beyond GTK4.

Install

From AUR

yay -S omarchy-screenshot-preview

From source

git clone https://github.com/rodrigo-sntg/omarchy-screenshot-preview.git
cd omarchy-screenshot-preview
cargo build --release
sudo install -Dm755 target/release/omarchy-screenshot-preview /usr/bin/omarchy-screenshot-preview

Build dependencies: cargo, gtk4, gtk4-layer-shell

Setup on Omarchy

The preview tool needs to be wired into the screenshot workflow. There is a pending PR to add native hook support. Until it's merged, follow these steps:

Step 1: Override the screenshot command

Copy the original script and patch it:

cp ~/.local/share/omarchy/bin/omarchy-cmd-screenshot ~/.local/bin/omarchy-cmd-screenshot

Edit ~/.local/bin/omarchy-cmd-screenshot and find this block near the end of the file:

  (
    ACTION=$(notify-send "Screenshot saved to clipboard and file" "Edit with Super + Alt + , (or click this)" -t 10000 -i "$FILEPATH" -A "default=edit")
    [[ $ACTION == "default" ]] && open_editor "$FILEPATH"
  ) &

Replace it with:

  pkill -f 'omarchy-screenshot-preview' 2>/dev/null
  omarchy-screenshot-preview "$FILEPATH" &

Step 2: Override the Print Screen binding

Hyprland may not have ~/.local/bin in its PATH. Add this to ~/.config/hypr/bindings.conf:

unbind = , PRINT
bindd = , PRINT, Screenshot, exec, ~/.local/bin/omarchy-cmd-screenshot

Hyprland auto-reloads on save. Press Print Screen to test.

After the PR is merged

Once PR #5054 is merged, the setup simplifies to:

yay -S omarchy-screenshot-preview

# Enable the screenshot hook
cp ~/.config/omarchy/hooks/screenshot.sample ~/.config/omarchy/hooks/screenshot

Edit ~/.config/omarchy/hooks/screenshot to contain:

#!/bin/bash
omarchy-screenshot-preview "$1"

No binding override needed.

Setup on other Hyprland systems (non-Omarchy)

The preview tool works standalone. Call it after capturing with grim:

grim -g "$(slurp)" /tmp/screenshot.png && wl-copy < /tmp/screenshot.png && omarchy-screenshot-preview /tmp/screenshot.png &

Usage

omarchy-screenshot-preview <filepath> [editor_args...]

Examples:

# Default: click opens satty editor
omarchy-screenshot-preview ~/Pictures/screenshot.png

# Custom editor
omarchy-screenshot-preview ~/Pictures/screenshot.png gimp ~/Pictures/screenshot.png

Hyprland layer rule (optional)

Add to ~/.config/hypr/looknfeel.conf for a slide-in animation:

layerrule = animation slide bottom, match:namespace screenshot-preview

License

MIT

About

macOS-style screenshot preview with drag-and-drop for Wayland/Hyprland

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages