aboutsummaryrefslogtreecommitdiff
path: root/i3blocks
diff options
context:
space:
mode:
Diffstat (limited to 'i3blocks')
-rwxr-xr-xi3blocks/i3corona.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/i3blocks/i3corona.sh b/i3blocks/i3corona.sh
new file mode 100755
index 0000000..8874f7f
--- /dev/null
+++ b/i3blocks/i3corona.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# i3corona.sh
+#
+# Shows daily stats about coronavirus in Spain
+
+#case $BLOCK_BUTTON in
+# 1) # Left click
+# 2) # Middle click
+# 3) # Right click
+#esac
+
+tmpDir="/tmp/corona"
+tmpFile="${tmpDir}/coronaData.txt"
+
+[ -d "$tmpDir" ] || mkdir -p "$tmpDir"
+[ -f "$tmpFile" ] ||
+ 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 " (+" $9 ") 💪 " $8 "%"}'
+