From 248a9b7d1f6682cc02adad1633d91fc6c0f6eec9 Mon Sep 17 00:00:00 2001 From: Daniele Fucini Date: Fri, 13 Nov 2026 18:23:14 +0100 Subject: [PATCH] xmobar: treat CAVOK/NSC weather reports as clear NOAA's decoded METAR has no sky conditions line for CAVOK or NSC, so the weather showed a generic cloud icon and "Unknown"; read them from the raw observation as clear. --- .config/xmobar/weather.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.config/xmobar/weather.sh b/.config/xmobar/weather.sh index 895b5a5..4ea17ac 100755 --- a/.config/xmobar/weather.sh +++ b/.config/xmobar/weather.sh @@ -26,6 +26,8 @@ fi wx=$(sed -n 's/^Weather: //p' <<< "$report" | tr ';' '\n' | sed 's/^ *//' | grep -v vicinity) wx=${wx,,} sky=$(sed -n 's/^Sky conditions: //p' <<< "$report") +# CAVOK/NSC (no cloud below 5000 ft) have no sky line in the decoded report +[[ -z $sky ]] && grep -qE '^ob: .* (CAVOK|NSC) ' <<< "$report" && sky=clear sky=${sky,,} # Sun above the horizon (elevation > -0.833°, as for sunrise/sunset) right now, from the low-precision solar position