Compare commits
2
Commits
216e1bff0f
...
9896d9bb21
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9896d9bb21
|
||
|
|
248a9b7d1f
|
No files matched your search
@@ -18,7 +18,7 @@ declare -A ICON=(
|
|||||||
report=$(curl -sf --max-time 20 https://tgftp.nws.noaa.gov/data/observations/metar/decoded/"$STATION".TXT)
|
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")
|
temp=$(sed -n 's/^Temperature: .*(\([-0-9.]*\) C).*/\1/p' <<< "$report")
|
||||||
if [[ -z $temp ]]; then
|
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
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -26,6 +26,8 @@ fi
|
|||||||
wx=$(sed -n 's/^Weather: //p' <<< "$report" | tr ';' '\n' | sed 's/^ *//' | grep -v vicinity)
|
wx=$(sed -n 's/^Weather: //p' <<< "$report" | tr ';' '\n' | sed 's/^ *//' | grep -v vicinity)
|
||||||
wx=${wx,,}
|
wx=${wx,,}
|
||||||
sky=$(sed -n 's/^Sky conditions: //p' <<< "$report")
|
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,,}
|
sky=${sky,,}
|
||||||
|
|
||||||
# Sun above the horizon (elevation > -0.833°, as for sunrise/sunset) right now, from the low-precision solar position
|
# 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"
|
notify-send "${ICON[$icon]} Weather" "${desc^}, $temp°C"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "${ICON[$icon]} <fc=$color>$temp</fc>°C"
|
echo "<fn=1>${ICON[$icon]}</fn> <fc=$color>$temp</fc>°C"
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
Config { overrideRedirect = True
|
Config { overrideRedirect = True
|
||||||
, lowerOnStart = True
|
, lowerOnStart = True
|
||||||
, font = "Jetbrains Mono Nerd Font Bold 10"
|
, font = "Jetbrains Mono Nerd Font Bold 10"
|
||||||
|
, additionalFonts = ["Jetbrains Mono Nerd Font Bold 13"]
|
||||||
, bgColor = "#24283b"
|
, bgColor = "#24283b"
|
||||||
, fgColor = "#737aa2"
|
, fgColor = "#737aa2"
|
||||||
, position = TopH 24
|
, position = TopH 24
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
Config { overrideRedirect = True
|
Config { overrideRedirect = True
|
||||||
, lowerOnStart = True
|
, lowerOnStart = True
|
||||||
, font = "Jetbrains Mono Nerd Font Bold 10"
|
, font = "Jetbrains Mono Nerd Font Bold 10"
|
||||||
|
, additionalFonts = ["Jetbrains Mono Nerd Font Bold 13"]
|
||||||
, bgColor = "#24283b"
|
, bgColor = "#24283b"
|
||||||
, fgColor = "#737aa2"
|
, fgColor = "#737aa2"
|
||||||
, position = TopH 24
|
, position = TopH 24
|
||||||
|
|||||||
Reference in new issue
Block a user