mirror of
https://github.com/fscotto/infra.git
synced 2026-07-29 16:20:01 +00:00
Add Hyprland Void desktop profile
This commit is contained in:
38
dotfiles/desktop/.config/hypr/scripts/screenshot
Executable file
38
dotfiles/desktop/.config/hypr/scripts/screenshot
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
# Quick screenshot helpers for Hyprland. Captures via grim, saves to disk and
|
||||
# also copies to the Wayland clipboard. Use the flameshot binding for
|
||||
# annotations / fancy capture.
|
||||
#
|
||||
# Usage: screenshot {full|region|output|window}
|
||||
|
||||
set -eu
|
||||
|
||||
mode="${1:-full}"
|
||||
dir="$HOME/Pictures/Screenshots"
|
||||
mkdir -p "$dir"
|
||||
file="$dir/$(date +%Y%m%d_%H%M%S).png"
|
||||
|
||||
case "$mode" in
|
||||
full)
|
||||
grim "$file"
|
||||
;;
|
||||
region)
|
||||
grim -g "$(slurp)" "$file"
|
||||
;;
|
||||
output)
|
||||
out=$(hyprctl monitors -j | jq -r '.[] | select(.focused == true) | .name')
|
||||
grim -o "$out" "$file"
|
||||
;;
|
||||
window)
|
||||
geom=$(hyprctl activewindow -j \
|
||||
| jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')
|
||||
grim -g "$geom" "$file"
|
||||
;;
|
||||
*)
|
||||
printf 'Usage: %s {full|region|output|window}\n' "$0" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
wl-copy < "$file"
|
||||
notify-send "Screenshot saved" "$file" -i image-x-generic >/dev/null 2>&1 || true
|
||||
Reference in New Issue
Block a user