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 | |
| 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).
| -rw-r--r-- | dotfiles/hyprland/.config/hypr/hyprland.conf | 6 | ||||
| -rwxr-xr-x | dotfiles/hyprland/.local/bin/screenshot | 23 | ||||
| -rw-r--r-- | todo.org | 8 |
3 files changed, 32 insertions, 5 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 @@ -125,8 +125,12 @@ The script handles edge cases gracefully, provides detailed error messages with CLOSED: [2026-01-27 Tue] Added focus_on_activate = true to misc section in hyprland.conf. -**** TODO [#B] screenshot functionality should leave path of last image in the clipboard ready to paste. -**** TODO [#B] screenshot functionality should also bind shift printscreen to select region. +**** DONE [#B] screenshot functionality should leave path of last image in the clipboard ready to paste. +CLOSED: [2026-01-27 Tue] +Created screenshot script with fuzzel menu offering Copy Path, Copy Image, and Annotate. +**** DONE [#B] screenshot functionality should also bind shift printscreen to select region. +CLOSED: [2026-01-27 Tue] +Replaced with $mod+S (region) and $mod+Print (fullscreen), both using fuzzel menu. **** DONE [#B] waybar's network monitor should change color when there's no network available. CLOSED: [2026-01-27 Tue] Added #custom-netspeed.disconnected CSS rule with themed red color across |
