summary refs log tree commit diff
diff options
context:
space:
mode:
-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"