From b0e2cae63ebd25d340193248eb9796d5ab44944c Mon Sep 17 00:00:00 2001 From: Penelope Gwen Date: Wed, 19 Mar 2025 00:43:53 -0700 Subject: [PATCH] New backup 2025-03-19 00:43:53 --- de/home/.config/eww/modules/home/weather.yuck | 2 +- de/home/.config/eww/scripts/widgets/weather | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/de/home/.config/eww/modules/home/weather.yuck b/de/home/.config/eww/modules/home/weather.yuck index 5ce104c..d131251 100644 --- a/de/home/.config/eww/modules/home/weather.yuck +++ b/de/home/.config/eww/modules/home/weather.yuck @@ -8,7 +8,7 @@ :width 300 :height 125 :space-evenly true - "Eugene, OR | ${json.condition}" + "Eugene, OR | ${json.condition} ${json.icon}" "${json.current_temp}°F  / ${json.humidity}% " " ${json.max_temp}°F  ${json.min_temp}°F" " ${json.updated}")) diff --git a/de/home/.config/eww/scripts/widgets/weather b/de/home/.config/eww/scripts/widgets/weather index cc6f37b..2825155 100755 --- a/de/home/.config/eww/scripts/widgets/weather +++ b/de/home/.config/eww/scripts/widgets/weather @@ -20,4 +20,22 @@ max_temp="$(jq -r '.weather[0].maxtempF' ${wttr_cache})" humidity="$(jq -r '.current_condition[0].humidity' ${wttr_cache})" updated="$(date -r ${wttr_cache} '+%Y-%m-%d, %H:%M')" -jq -n --arg condition "${condition}" --arg current_temp "${current_temp}" --arg feels_temp "${feels_temp}" --arg min_temp "${min_temp}" --arg max_temp "${max_temp}" --arg humidity "${humidity}" --arg updated "${updated}" '{condition: $condition,current_temp: $current_temp,feels_temp: $feels_temp,min_temp: $min_temp,max_temp: $max_temp,humidity: $humidity,updated: $updated}' +case "${condition_code}" in + 113) + "" + ;; + 116|119|122|143) + condition_icon="" + ;; + 179|227|230) + condition_icon="" + ;; + 248|260) + condition_icon="▒" + ;; + 176|182|185|200|263|266|281|284|293|296|299|302|305|308|311) + condition_icon="" + ;; +esac + +jq -n --arg condition "${condition}" --arg current_temp "${current_temp}" --arg feels_temp "${feels_temp}" --arg min_temp "${min_temp}" --arg max_temp "${max_temp}" --arg humidity "${humidity}" --arg icon "${condition_icon}" --arg updated "${updated}" '{condition: $condition,current_temp: $current_temp,feels_temp: $feels_temp,min_temp: $min_temp,max_temp: $max_temp,humidity: $humidity,icon: $icon,updated: $updated}'