summary refs log tree commit diff
path: root/.config/waybar
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2021-04-26 01:57:12 +0200
committerRobert Günzler <r@gnzler.io>2021-04-26 02:09:49 +0200
commit5bd9cdf6e45da7a9d22d9aedeb3ecd9fdce33bf0 (patch)
treefe73935e13f5a3c59b691592a9d984024aab76f6 /.config/waybar
parent72074db0c0ad60b6d7134cff34ef4855a134fb30 (diff)
waybar/covid: show history in tooltip
Diffstat (limited to '.config/waybar')
-rwxr-xr-x.config/waybar/modules/covid.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/.config/waybar/modules/covid.sh b/.config/waybar/modules/covid.sh
index d8f59a4..558c2c5 100755
--- a/.config/waybar/modules/covid.sh
+++ b/.config/waybar/modules/covid.sh
@@ -13,7 +13,7 @@ done
 
 # incidence = (sumCasesLast7Days / EWZ) * 100000
 lat=${HOME_LAT:?}
-lon=${HOME_LAT:?}
+lon=${HOME_LON:?}
 fields='GEN,RS,EWZ,EWZ_BL,BL_ID,cases,cases_per_100k,cases7_per_100k,cases7_bl_per_100k,last_update,BL,IBZ'
 # see https://experience.arcgis.com/experience/478220a4c454480e823b17327b2bf1d4
 uri="https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=${fields}&geometry=${lon}%2C${lat}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json"
@@ -66,6 +66,13 @@ if [ "${incidence_i}" -gt "250" ]; then
 	color='darkdarkred'
 fi
 
+tooltip="
+7 Tage Inzidenz für ${loc}
+last update: ${last_update}
+
+history (${trend_arrow}):
+$(awk -F, '{print $1 " " $2}' ${HISTFILE} | head -n10)
+"
+
 jq -nr \
-	"{ text: \"${trend_arrow}${incidence_f}\", percentage: \"${incidence_i}\", class: \"${color}\", alt: \"${color}\",
-	tooltip: \"7 Tage Inzidenz für \\n${loc}\\nLast update: ${last_update}\" } | @text"
+	"{ text: \"${trend_arrow}${incidence_f}\", percentage: \"${incidence_i}\", class: \"${color}\", alt: \"${color}\", tooltip: \"${tooltip}\" } | @text"