dots


commit
1fe5ab8
parent
f829623
author
xxwhirlpool
date
2025-06-07 07:09:10 -0400 EDT
add screenshot scripts
2 files changed,  +47, -0
A config/.local/bin/screenshot
+25, -0
 1@@ -0,0 +1,25 @@
 2+#!/usr/bin/env bash
 3+#
 4+# modified from this GH script:
 5+#
 6+# https://github.com/BreadOnPenguins/scripts/blob/master/screenshot_extra_features
 7+
 8+export DISPLAY=:0
 9+SHOTPATH="/home/kat/Pictures/Screenshots"
10+COUNT=$(find $SHOTPATH -type f -printf x | wc -c | awk '{print $1+1}' | awk '{printf "%04d\n", $0}')
11+FILE="$SHOTPATH/$COUNT.png"
12+
13+# Determine screenshot utility
14+if command -v import &> /dev/null; then
15+    TOOL="import"
16+elif command -v scrot &> /dev/null; then
17+    TOOL="scrot"
18+else
19+    notify-send "Screenshot Tool Missing" "Neither ImageMagick (import) nor scrot is installed!"
20+    echo "Error: No screenshot tool found (import or scrot)."
21+    exit 1
22+fi
23+
24+import -window root "$FILE" || exit 1
25+
26+notify-send "Screenshot Taken" "Saved as ${FILE} in ${SHOTPATH}"
A config/.local/bin/screenshotpick
+22, -0
 1@@ -0,0 +1,22 @@
 2+#!/usr/bin/env bash
 3+
 4+# modified from this GH script:
 5+#
 6+# https://github.com/BreadOnPenguins/scripts/blob/master/screenshot_extra_features
 7+
 8+export DISPLAY=:0
 9+SHOTPATH="/home/kat/Pictures/Screenshots"
10+COUNT=$(find $SHOTPATH -type f -printf x | wc -c | awk '{print $1+1}' | awk '{printf "%04d\n", $0}')
11+FILE="$SHOTPATH/$COUNT.png"
12+
13+
14+selection () { # draw a selection, or click to select a window
15+		import "$FILE" && post
16+}
17+
18+
19+post () { # copy image to clip & send a notification
20+		xclip -selection clipboard -t image/png -i $FILE && notify-send -i "$FILE" "$FILE copied to clipboard"
21+}
22+
23+selection