dots


dots / config / .local / bin
xxwhirlpool  ·  2025-12-18

screenshotpick

 1#!/usr/bin/env bash
 2
 3# modified from this GH script:
 4#
 5# https://github.com/BreadOnPenguins/scripts/blob/master/screenshot_extra_features
 6
 7export DISPLAY=:0
 8
 9if [[ $(hostname) == "mariposa" ]]; then
10	SHOTPATH="/home/kat/Pictures/Screenshots"
11elif [[ $(hostname) == "kwangya" ]]; then
12	SHOTPATH="/media/kat/disk/Pictures/Screenshots"
13else
14	echo "fuck"
15fi
16
17COUNT=$(find $SHOTPATH -type f -printf x | wc -c | awk '{print $1+2}' | awk '{printf "%04d\n", $0}')
18FILE="$SHOTPATH/$COUNT.png"
19
20
21selection () { # draw a selection, or click to select a window
22		import "$FILE" && post
23}
24
25
26post () { # copy image to clip & send a notification
27		xclip -selection clipboard -t image/png -i $FILE && notify-send -i "$FILE" "$FILE copied to clipboard"
28}
29
30selection