This commit is contained in:
entailz 2026-04-09 14:04:52 -07:00
commit 1a50f2bf11
23 changed files with 13058 additions and 0 deletions

98
README.md Normal file
View file

@ -0,0 +1,98 @@
## Blast
A pretty Wayland screenshot tool supporting multiple capture modes, including window-aware capture.
│ Note
│ This tool includes a proof-of-concept implementation of the
│ xx-foreign-toplevel-geometry-v1 protocol for tracking client geometry.
│ It is experimental and may be incomplete or subject to change.
## Supported Compositors
- Hyprland
- Wry
## Features
### Actions
- **`copy`** - Copy to clipboard
- **`save`** - Save to file (or - for stdout)
- **`copysave`** - Copy and save, save path defaults to home directory
- **`edit`** - Open in image editor
- **`check`** - Verify protocol support
### Subjects
- **`screen`** - All monitors stitched into a single image at logical resolution
- **`output`** - The currently focused monitor
- **`active`** - The currently focused window
- **`area`** - Interactive selection with window snap hints (like `slurp -w`)
- **`region`** - Free-form interactive selection with no snap hints
### Fine Tune
```
--no-shadow Disable shadow and rounding entirely
--radius px Corner radius
--shadow-offset X,Y Shadow offset
--shadow-alpha 0-255 Shadow opacity
--shadow-spread PX Shadow spread distance
--shadow-blur PX Shadow blur radius
```
### Freeze overlay
`-f / --freeze` captures the current screen state before the selection UI appears and renders it as a static layer shell overlay. The screen appears frozen while you draw your selection and is captured directly from the compositor.
The screenshot is taken while the freeze is still active, so what you see is exactly what you get.
### Cursor inclusion
`-c / --cursor` includes the cursor in the screenshot.
### Wait
`-w / --wait N` waits N seconds before capturing. Useful for capturing tooltips or hover states.
### Notifications
`-n / --notify` sends a desktop notification on completion with the saved file path as the notification body.
### Editor integration
`blast edit` saves the screenshot to `/tmp/<timestamp>.png` and opens it in your configured editor. Set `$BLAST_EDITOR` to override the default (`gimp`).
### Save path resolution
Output paths follow XDG priority: `$XDG_SCREENSHOTS_DIR``$XDG_PICTURES_DIR``$HOME`. Default filenames are `<window-class>_<random>.png`.
---
## Usage examples
```sh
# Copy a window-snapping region selection to clipboard, with freeze and shadow
blast -fn copy area
# Save the active window to ~/Pictures
blast save active
# Copy full screen of all monitors to clipboard
blast copy screen
# Save a free-form selection to a specific path
blast save region ~/screenshots/test.png
# Copy to clipboard and save, no shadow
blast --no-shadow copysave area
# Open focused monitor screenshot in editor
blast edit output
```
## Building
```sh
cargo build --release
```