aboutsummaryrefslogtreecommitdiff
path: root/showURLimage.sh
diff options
context:
space:
mode:
Diffstat (limited to 'showURLimage.sh')
-rwxr-xr-xshowURLimage.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/showURLimage.sh b/showURLimage.sh
index cd7db1f..0650f0c 100755
--- a/showURLimage.sh
+++ b/showURLimage.sh
@@ -7,8 +7,10 @@ url="$1"
echo "$url" | grep -i "youtube" >/dev/null &&
url="$(youtube-dl --get-thumbnail "$url")"
-filename="/tmp/showURLimage$(date +%H%M%S)"
+folder="/tmp/showURLimage"
+filename="${folder}/$(date +%H%M%S)"
+[ -d "$folder" ] || mkdir -p "$folder"
curl "$url" > "$filename"
sxiv -b -N "sxivfloat" "$filename" || notify-send "No image found at $url"