# hyprtile-shotter

Native Hyprland screenshot helper without `grim`, without `slurp`, and without xdg-desktop-portal.

It uses:

- Hyprland IPC via `hyprctl monitors -j` only to find the focused monitor
- `wlr-screencopy-unstable-v1` for the actual screenshot
- `wlr-layer-shell-unstable-v1` for the selection overlay
- `wl_shm` buffers
- `libpng` for writing PNGs

## Dependencies

Arch/Hyprland-style package names:

```sh
sudo pacman -S base-devel wayland wayland-protocols libpng hyprland xdg-user-dirs
```

No `grim`. No `slurp`. No portal dependency.

## Build

```sh
make
```

## Install

User-local:

```sh
make install PREFIX="$HOME/.local"
```

System-wide:

```sh
sudo make install
```

## Usage

```sh
hyprtile-shotter --delay 3
hyprtile-shotter --delay 5
hyprtile-shotter --delay 10
hyprtile-shotter --select --delay 3
hyprtile-shotter --cursor --delay 3
hyprtile-shotter --output-dir "$HOME/Bilder" --delay 3
```

By default it writes:

```text
$(xdg-user-dir PICTURES)/Screenshots/Screenshot_YYYY-MM-DD_HH-MM-SS.png
```

Fallbacks are `~/Bilder`, `~/Pictures`, then a `Screenshots` subdirectory under that base path.

## Hyprland binds

```ini
bind = , PRINT, exec, hyprtile-shotter --delay 3
bind = SHIFT, PRINT, exec, hyprtile-shotter --select --delay 3

bind = ALT, PRINT, exec, hyprtile-shotter --delay 5
bind = CTRL, PRINT, exec, hyprtile-shotter --delay 10

bind = SHIFT ALT, PRINT, exec, hyprtile-shotter --select --delay 5
bind = SHIFT CTRL, PRINT, exec, hyprtile-shotter --select --delay 10
```

## Notes

- This is intentionally Hyprland/wlroots-oriented.
- It requires the compositor to expose `zwlr_screencopy_manager_v1`.
- Selection mode requires `zwlr_layer_shell_v1` and pointer support on the current seat.
- The selected region is output-local because the overlay is attached to the focused output.
