diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-27 07:53:00 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-27 07:53:00 -0600 |
| commit | 057a7d24ecd2d4360c59c77b71ccd85b33cd7785 (patch) | |
| tree | fe5e486e4bab8ca756460a01ce371ac7342989e8 /dotfiles/hyprland | |
| parent | d6374a32391a43ae051b6fdbe2f93431ef5dc9dc (diff) | |
feat(hyprland): screenshot script with fuzzel menu
Replaced inline grim/satty keybindings with screenshot script that
captures to file then presents fuzzel menu: Copy Path, Copy Image,
or Annotate. Bindings: $mod+S (region), $mod+Print (fullscreen).
Diffstat (limited to 'dotfiles/hyprland')
| -rw-r--r-- | dotfiles/hyprland/.config/hypr/hyprland.conf | 6 | ||||
| -rwxr-xr-x | dotfiles/hyprland/.local/bin/screenshot | 23 |
2 files changed, 26 insertions, 3 deletions
diff --git a/dotfiles/hyprland/.config/hypr/hyprland.conf b/dotfiles/hyprland/.config/hypr/hyprland.conf index 133c79e..cc51b9d 100644 --- a/dotfiles/hyprland/.config/hypr/hyprland.conf +++ b/dotfiles/hyprland/.config/hypr/hyprland.conf @@ -296,9 +296,9 @@ bind = CTRL ALT, SPACE, exec, amixer set Capture toggle && amixer get Capture | # Bluetooth (from DWM and sxhkdrc) bind = $mod SHIFT, B, exec, blueman-manager -# Screenshots (grim + slurp + satty for annotation) -bind = $mod, S, exec, grim -g "$(slurp)" - | satty --filename - --output-filename ~/pictures/screenshots/$(date +%Y.%m.%d-%H%M%S).png -bind = , Print, exec, grim - | satty --filename - --output-filename ~/pictures/screenshots/$(date +%Y.%m.%d-%H%M%S).png +# Screenshots (grim + slurp + fuzzel menu) +bind = $mod, S, exec, screenshot region +bind = $mod, Print, exec, screenshot fullscreen # Lock screen (from sxhkdrc: super+Escape) bind = $mod, ESCAPE, exec, hyprlock diff --git a/dotfiles/hyprland/.local/bin/screenshot b/dotfiles/hyprland/.local/bin/screenshot new file mode 100755 index 0000000..3e61291 --- /dev/null +++ b/dotfiles/hyprland/.local/bin/screenshot @@ -0,0 +1,23 @@ +#!/bin/sh +# Screenshot tool with fuzzel menu +# Usage: screenshot [region|fullscreen] + +DIR="$HOME/pictures/screenshots" +mkdir -p "$DIR" +FILE="$DIR/$(date +%Y.%m.%d-%H%M%S).png" + +# Capture +case "${1:-region}" in + region) grim -g "$(slurp)" "$FILE" || exit 1 ;; + fullscreen) grim "$FILE" || exit 1 ;; +esac + +# Menu +CHOICE=$(printf ' Copy Path\n Copy Image\n Annotate' | \ + fuzzel --dmenu --prompt "Screenshot: " --width 20 --lines 3) + +case "$CHOICE" in + *"Copy Path"*) echo -n "$FILE" | wl-copy ;; + *"Copy Image"*) wl-copy < "$FILE" ;; + *"Annotate"*) satty --filename "$FILE" --output-filename "$FILE" --copy-command wl-copy ;; +esac |
