mirror of
https://git.sr.ht/~coasteen/dotfiles
synced 2025-11-04 14:47:38 +01:00
19 lines
403 B
Bash
Executable file
19 lines
403 B
Bash
Executable file
#!/usr/bin/env zsh
|
|
|
|
DIR=~/Pictures/Screenshots
|
|
mkdir -p "$DIR"
|
|
|
|
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
|
|
FILENAME="screenshot_${TIMESTAMP}.png"
|
|
FILEPATH="${DIR}/${FILENAME}"
|
|
|
|
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"
|