commit 45e7c2163a9ec9fc20128b8cf3eb5acc43a5ed04
parent 11533eb7b819fb4e47c09b9626bc1502387a2db2
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Fri, 11 Sep 2020 10:45:43 +0200
maimpick: add .png file extension if user didn't
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/.local/bin/maimpick b/.local/bin/maimpick
@@ -4,6 +4,10 @@ set -e
c="$(printf 'area\nwindow\nscreen' | dmenu -i)"
out="$(printf 'tmp/pic-%s-%s.png' "$c" "$(date '+%y-%m-%d_%H:%M:%S')" | dmenu -l 1 -p "outfile:")"
+if [ ! "${out##*.}" = "png" ]; then
+ out="${out}.png"
+fi
+
case "$c" in
area)
maim --hidecursor -s "$out" ;;