diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2020-03-25 13:52:00 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2020-03-30 17:29:07 +0200 |
commit | 1d5bd1d959189cf98700eaa8027d6e4dd01a164d (patch) | |
tree | c6cc394d1f78635e5e2876f589489f9cf49eff91 | |
parent | df49022cbec4f9ed0d9f6e90b8ac22b1bb6a6c82 (diff) | |
download | scripts-1d5bd1d959189cf98700eaa8027d6e4dd01a164d.tar.gz scripts-1d5bd1d959189cf98700eaa8027d6e4dd01a164d.zip |
Updated showURLImage.sh to get youtube thumbnails.
-rwxr-xr-x | i3blocks/i3corona.sh | 2 | ||||
-rwxr-xr-x | showURLimage.sh | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/i3blocks/i3corona.sh b/i3blocks/i3corona.sh index 54b71ec..3d76b36 100755 --- a/i3blocks/i3corona.sh +++ b/i3blocks/i3corona.sh @@ -18,5 +18,5 @@ tmpFile="${tmpDir}/coronaData.txt" curl https://corona-stats.online/spain > "$tmpFile" 2>/dev/null grep 'Spain' "$tmpFile" | sed 's/\s*//g; s/\x1b\[[0-9;]*m//g; s/[,▲║]//g' | - awk -F'│' '{print "😷 " $3 " (+" $6 ") 💪 " $7}' + awk -F'│' '{print "😷 " $3 " (+" $4 ") 💪 " $7}' diff --git a/showURLimage.sh b/showURLimage.sh index 2d5b485..cd7db1f 100755 --- a/showURLimage.sh +++ b/showURLimage.sh @@ -1,7 +1,14 @@ #!/bin/sh # Downloads an url to /tmp and opens it with sxiv. +# If the url is from youtube tries to download the thumbnail. + +url="$1" +echo "$url" | grep -i "youtube" >/dev/null && + url="$(youtube-dl --get-thumbnail "$url")" filename="/tmp/showURLimage$(date +%H%M%S)" -curl "$1" > "$filename" -sxiv -b -N "sxivfloat" "$filename" || notify-send "No image found at $1" + +curl "$url" > "$filename" +sxiv -b -N "sxivfloat" "$filename" || notify-send "No image found at $url" + |