Compare commits

..
2 Commits
Author SHA1 Message Date
Daniele Fucini 9896d9bb21 xmobar: draw the weather icon larger
Add a 13 pt additional font and use it for the weather icon only, so the
rest of the bar and its height are unchanged.
2026-11-13 18:39:53 +01:00
Daniele Fucini 248a9b7d1f 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.
2026-11-13 18:23:14 +01:00
3 changed files with 6 additions and 2 deletions

No files matched your search

+4 -2
View File
@@ -18,7 +18,7 @@ declare -A ICON=(
report=$(curl -sf --max-time 20 https://tgftp.nws.noaa.gov/data/observations/metar/decoded/"$STATION".TXT)
temp=$(sed -n 's/^Temperature: .*(\([-0-9.]*\) C).*/\1/p' <<< "$report")
if [[ -z $temp ]]; then
if [[ $1 == notify ]]; then notify-send "Weather" "No report from $STATION"; else echo "${ICON[thermometer]} N/A"; fi
if [[ $1 == notify ]]; then notify-send "Weather" "No report from $STATION"; else echo "<fn=1>${ICON[thermometer]}</fn> N/A"; fi
exit 0
fi
@@ -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
@@ -76,4 +78,4 @@ if [[ $1 == notify ]]; then
notify-send "${ICON[$icon]} Weather" "${desc^}, $temp°C"
exit 0
fi
echo "${ICON[$icon]} <fc=$color>$temp</fc>°C"
echo "<fn=1>${ICON[$icon]}</fn> <fc=$color>$temp</fc>°C"
+1
View File
@@ -1,6 +1,7 @@
Config { overrideRedirect = True
, lowerOnStart = True
, font = "Jetbrains Mono Nerd Font Bold 10"
, additionalFonts = ["Jetbrains Mono Nerd Font Bold 13"]
, bgColor = "#24283b"
, fgColor = "#737aa2"
, position = TopH 24
+1
View File
@@ -1,6 +1,7 @@
Config { overrideRedirect = True
, lowerOnStart = True
, font = "Jetbrains Mono Nerd Font Bold 10"
, additionalFonts = ["Jetbrains Mono Nerd Font Bold 13"]
, bgColor = "#24283b"
, fgColor = "#737aa2"
, position = TopH 24