aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdotfiles/.local/bin/imgurl5
1 files changed, 4 insertions, 1 deletions
diff --git a/dotfiles/.local/bin/imgurl b/dotfiles/.local/bin/imgurl
index f9cad49..c594712 100755
--- a/dotfiles/.local/bin/imgurl
+++ b/dotfiles/.local/bin/imgurl
@@ -2,5 +2,8 @@
[ -z "$1" ] && exit
-setsid curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && nsxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 &
+base="$(basename $1)"
+ext="${base##*.}"
+fname="/tmp/imgurl-$(date '+%s').$ext"
+setsid curl -sL "$1" > "$fname" && nsxiv -a "$fname" &