summaryrefslogtreecommitdiffstats
path: root/keyboard/screenshot
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2026-09-17 17:31:05 -0500
committerTim Keller <tjk@tjkeller.xyz>2026-09-17 17:31:05 -0500
commitff2d831980ee777ed85a0309e08d0b6fad3a6ef7 (patch)
treeaf373ec79aca15d9b58b7ee3b286470beb131e3f /keyboard/screenshot
parent3893c82e4f1f456aad4d8f6cf37ec53dfeca8285 (diff)
downloadscripts-ff2d831980ee777ed85a0309e08d0b6fad3a6ef7.tar.xz
scripts-ff2d831980ee777ed85a0309e08d0b6fad3a6ef7.zip
scrot script mkdir dir before attempting screenshotHEADmaster
Diffstat (limited to 'keyboard/screenshot')
-rwxr-xr-xkeyboard/screenshot11
1 files changed, 6 insertions, 5 deletions
diff --git a/keyboard/screenshot b/keyboard/screenshot
index 25e99cd..2df9049 100755
--- a/keyboard/screenshot
+++ b/keyboard/screenshot
@@ -10,9 +10,9 @@ HELPDOC
}
# Scrot and xclip opts
-fmt=$(date '+%m-%d-%4Y_%I:%M:%S_%p.png')
-tmppath=/tmp/$fmt
-savpath=~/pics/screenshots/$fmt
+fmt=$(date '+%m-%d-%4Y_%I:%M:%S_%p.png') # Scrot will output ..._000.png in case of rapid screenshots
+tmppath=/tmp
+savpath=~/pics/screenshots
normopt=''
cropopt='--select --freeze'
normexp='echo $f'
@@ -41,6 +41,7 @@ while getopts "cxh" arg; do
esac
done
-scrot $opt $path --exec "$exp" \
- && notify-send $notifyopts -i $path "$summ" "$body" \
+mkdir -p "$path"
+scrot $opt "$path/$fmt" --exec "$exp" \
+ && notify-send $notifyopts -i "$path/$fmt" "$summ" "$body" \
|| notify-send $notifyopts "Screenshot Failed!"