blob: c5803c80cbf4abf1a1f7c5476682e7f62468d6a4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/bin/sh
# Screenshot tool with fuzzel menu
# Usage: screenshot [region|fullscreen]
DIR="$HOME/pictures/screenshots"
mkdir -p "$DIR"
FILE="$DIR/$(date +%Y.%m.%d-%H%M%S).png"
# Capture
case "${1:-region}" in
region) grim -g "$(slurp)" "$FILE" || exit 1 ;;
fullscreen) grim "$FILE" || exit 1 ;;
esac
# Menu
CHOICE=$(printf ' Copy Path\n Copy Image\n Annotate' | \
fuzzel --dmenu --prompt "Screenshot: " --width 20 --lines 3)
case "$CHOICE" in
*"Copy Path"*) echo -n "$FILE" | wl-copy --type text/plain ;;
*"Copy Image"*) wl-copy --type image/png < "$FILE" ;;
*"Annotate"*) satty --filename "$FILE" --output-filename "$FILE" --copy-command wl-copy ;;
esac
|