updated screenshot tools
This commit is contained in:
@@ -3,17 +3,19 @@
|
||||
### ~/.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)"')
|
||||
time=$(date +%Y-%m-%d-%H%M%S)
|
||||
dir="$(xdg-user-dir PICTURES)/Screenshots"
|
||||
file="Screenshot_${time}_${geometry}.png"
|
||||
file="Screenshot_${time}.png"
|
||||
|
||||
mkdir -p "$dir"
|
||||
|
||||
# Take screenshot of selected region using hyprshot
|
||||
hyprshot -m region -o "$dir" -f "$file"
|
||||
# Select a region with slurp; exit silently if cancelled (ESC/right-click)
|
||||
geometry=$(slurp) || exit 1
|
||||
|
||||
# Optional: open in swappy for annotation (since hyprshot doesn't pipe to swappy directly)
|
||||
# if command -v swappy >/dev/null 2>&1; then
|
||||
# swappy -f "$dir/$file"
|
||||
# fi
|
||||
# Capture region, save it and copy to clipboard
|
||||
grim -g "$geometry" "$dir/$file" || exit 1
|
||||
wl-copy -t image/png < "$dir/$file"
|
||||
|
||||
if command -v notify-send >/dev/null 2>&1; then
|
||||
notify-send -a Screenshot -i camera-photo "Screenshot saved" "$file"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user