push changes

This commit is contained in:
2026-04-21 21:38:35 +02:00
parent 4cbfa9464b
commit 01d3f91896
6 changed files with 58 additions and 58 deletions

View File

@@ -23,7 +23,7 @@ markup_escape() {
icon_markup() {
local icon="$1"
local color="$2"
printf '<span font_desc="SauceCodePro Nerd Font 15" foreground="%s">%s</span>' "$color" "$icon"
printf '<span font_desc="SauceCodePro Nerd Font 14" foreground="%s">%s</span>' "$color" "$icon"
}
icon_for_condition() {
@@ -59,14 +59,14 @@ icon_for_condition() {
}
if ! command -v curl >/dev/null 2>&1; then
text="<span foreground=\"#EBCB8B\">--°C Unavailable</span> $(icon_markup "󰖐" "#D08770")"
text="$(icon_markup "󰖐 " "#D08770")<span foreground=\"#EBCB8B\">--°C Unavailable</span>"
printf '{"text":"%s","tooltip":"curl is required for weather","class":"weather-unavailable"}\n' "$(json_escape "$text")"
exit 0
fi
raw=$(curl -fsS --max-time 6 "$URL" 2>/dev/null || true)
if [[ -z "$raw" || "$raw" != *"|"* ]]; then
text="<span foreground=\"#EBCB8B\">--°C Unavailable</span> $(icon_markup "󰖐" "#D08770")"
text="$(icon_markup "󰖐 " "#D08770")<span foreground=\"#EBCB8B\">--°C Unavailable</span>"
printf '{"text":"%s","tooltip":"Weather unavailable for Norrkoping","class":"weather-unavailable"}\n' "$(json_escape "$text")"
exit 0
fi
@@ -75,7 +75,7 @@ temp=${raw%%|*}
condition=${raw#*|}
icon=$(icon_for_condition "$condition")
updated=$(date '+%H:%M')
text="<span foreground=\"#D8DEE9\">$(markup_escape "$temp $condition")</span> $(icon_markup "$icon" "#88C0D0")"
text="$(icon_markup "$icon " "#88C0D0")<span foreground=\"#D8DEE9\">$(markup_escape "$temp $condition")</span>"
tooltip=$(cat <<EOF
Norrkoping, Sweden
$temp - $condition