xxwhirlpool
·
2026-04-09
screenshot
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
22post () { # copy image to clip & send a notification
23 xclip -selection clipboard -t image/png -i $FILE && notify-send -i "$FILE" "$FILE copied to clipboard"
24}
25
26import -window root "$FILE" && post || exit 1