xmobar: show forecast frost/snow/heat probabilities as icons

The bar's forecast line now uses Nerd Font weather glyphs instead of the
words, like the rain drop; the week notification keeps the words.
This commit is contained in:
Daniele Fucini
2026-11-05 17:03:53 +01:00
parent 93b5bcbf30
commit 9da7cc8105
+4 -2
View File
@@ -47,9 +47,11 @@ if [ "$1" = "week" ]; then
fi fi
pick 1 2>/dev/null || exit 0 pick 1 2>/dev/null || exit 0
read -r day temps rain <<< "${line#*: }" read -r day temps rain extra <<< "${line#*: }"
# Probabilities as nf-weather icons: frost snowflake_cold, snow, heat hot
extra=${extra//frost /$'\xee\x8d\xaf' } extra=${extra//snow /$'\xee\x8c\x9a' } extra=${extra//heat /$'\xee\x8d\xab' }
label="" label=""
[[ $model != "${MODELS[0]}" ]] && label="${LABEL[$model]:-$model} " [[ $model != "${MODELS[0]}" ]] && label="${LABEL[$model]:-$model} "
stale="" stale=""
[[ ${line%%: *} == *STALE* ]] && stale=" <fc=#f7768e>!</fc>" [[ ${line%%: *} == *STALE* ]] && stale=" <fc=#f7768e>!</fc>"
echo "$label$day ${temps%C} "$''" $rain$stale" echo "$label$day ${temps%C} "$''" $rain${extra:+ $extra}$stale"