about summary refs log tree commit diff
path: root/alpine-river/local/bin/take-slurpshot
diff options
context:
space:
mode:
Diffstat (limited to 'alpine-river/local/bin/take-slurpshot')
-rwxr-xr-xalpine-river/local/bin/take-slurpshot18
1 files changed, 18 insertions, 0 deletions
diff --git a/alpine-river/local/bin/take-slurpshot b/alpine-river/local/bin/take-slurpshot
new file mode 100755
index 0000000..0edc9ec
--- /dev/null
+++ b/alpine-river/local/bin/take-slurpshot
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# Generate base filename with timestamp
+base_filename=$(date +"%m-%d-%Y_%H-%M-%S")
+extension=".png"
+
+# Initialize full filename
+filename="${base_filename}${extension}"
+counter=1
+
+# Check if file exists and append incremental suffix if needed
+while [[ -e "$filename" ]]; do
+    filename="${base_filename}-${counter}${extension}"
+    ((counter++))
+done
+
+# Output the available filename
+wayshot -f "$HOME/Pictures/Screenshots/$filename" -s "$(slurp)"