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