xxwhirlpool
·
2026-04-09
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"
13elif [[ $(hostname) == "tokki" ]]; then
14 SHOTPATH="/home/kat/Pictures/Screenshots"
15else
16 echo "fuck"
17fi
18
19COUNT=$(find $SHOTPATH -type f -printf x | wc -c | awk '{print $1+2}' | awk '{printf "%04d\n", $0}')
20FILE="$SHOTPATH/$COUNT.png"
21
22
23selection () { # draw a selection, or click to select a window
24 import "$FILE" && post
25}
26
27
28post () { # copy image to clip & send a notification
29 xclip -selection clipboard -t image/png -i $FILE && notify-send -i "$FILE" "$FILE copied to clipboard"
30}
31
32selection