Files
hyprland-dotfiles/.config/hypr/scripts/screenshot/screenshot_area.sh
2026-01-17 23:02:56 +01:00

17 lines
430 B
Bash
Executable File

#!/bin/bash
###
### ~/.config/hypr/scripts/screenshot/screenshot_area.sh
###
time=`date +%Y-%m-%d-%I-%M-%S`
geometry=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | "\(.width)x\(.height)"')
dir="`xdg-user-dir PICTURES`/Screenshots"
file="Screenshot_${time}_${geometry}.png"
if [[ ! -d "$dir" ]]; then
mkdir -p "$dir"
fi
# Take Screenshot
cd "$dir" && grim -g "$(slurp)" - | swappy -f - -o "$file" && wl-copy < "$file"