aboutsummaryrefslogtreecommitdiff
path: root/showURLimage.sh
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2020-03-30 17:32:36 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2020-03-30 17:32:36 +0200
commitbac5c5170cd48d913dc08cd64e8dd01046487e51 (patch)
tree2c5794adc2de57273860525ea9d91d4d00a0e742 /showURLimage.sh
parent1d5bd1d959189cf98700eaa8027d6e4dd01a164d (diff)
downloadscripts-bac5c5170cd48d913dc08cd64e8dd01046487e51.tar.gz
scripts-bac5c5170cd48d913dc08cd64e8dd01046487e51.zip
showURLimage.sh now downloads to its own folder.
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"