dotfiles-mirror/local/bin/screenie-wl

20 lines
403 B
Text
Raw Normal View History

2025-10-01 06:49:33 +03:30
#!/usr/bin/env zsh
2025-08-07 22:12:32 +03:30
2025-10-01 06:49:33 +03:30
DIR=~/Pictures/Screenshots
mkdir -p "$DIR"
2025-08-07 22:12:32 +03:30
2025-10-01 06:49:33 +03:30
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
FILENAME="screenshot_${TIMESTAMP}.png"
FILEPATH="${DIR}/${FILENAME}"
2025-08-07 22:12:32 +03:30
2025-10-01 06:49:33 +03:30
REGION=$(slurp)
if [[ -z "$REGION" ]]; then
notify-send "Screenshot canceled" "No region selected"
exit 1
fi
grim -g "$REGION" "$FILEPATH"
wl-copy < "$FILEPATH"
notify-send "Screenshot saved" "$FILEPATH"
echo "$FILEPATH"