diff options
-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" + |