diff --git a/bin/omarchy-weather-icon b/bin/omarchy-weather-icon index ffe1a9df..6a936039 100755 --- a/bin/omarchy-weather-icon +++ b/bin/omarchy-weather-icon @@ -2,9 +2,9 @@ # omarchy:summary=Returns a weather condition icon, adjusted for live sunrise and sunset. -# Only consult the helper when a location is stored: this runs every minute, -# and the helper's dynamic fallback would cost an extra wttr.in request when -# nothing is set — the bare j1 fetch already auto-detects by IP. +# Only consult the helper when a location is stored. Its dynamic fallback would +# cost an extra wttr.in request when nothing is set; the bare j1 fetch already +# auto-detects by IP. query="" if [[ -s "$HOME/.local/state/omarchy/settings/weather.json" ]]; then location=$(omarchy-weather-location 2>/dev/null) diff --git a/shell/plugins/panels/weather/BarWidget.qml b/shell/plugins/panels/weather/BarWidget.qml index 845c23d3..1203c503 100644 --- a/shell/plugins/panels/weather/BarWidget.qml +++ b/shell/plugins/panels/weather/BarWidget.qml @@ -70,7 +70,6 @@ BarWidget { bar: root.bar text: panelLoader.item ? panelLoader.item.label : "" slotSize: Style.bar.statusSlot - active: panelLoader.item && panelLoader.item.klass === "active" // Tooltip suppressed because the panel is the detail view. tooltipText: "" diff --git a/shell/plugins/panels/weather/Model.js b/shell/plugins/panels/weather/Model.js index 02a49935..6562f83d 100644 --- a/shell/plugins/panels/weather/Model.js +++ b/shell/plugins/panels/weather/Model.js @@ -1,15 +1,3 @@ -function parseWeatherStatus(raw) { - try { - var data = JSON.parse(String(raw || "{}")) - return { - label: data.text || "", - klass: data.class || "" - } - } catch (e) { - return { label: "", klass: "" } - } -} - // weather.json holds {"name": ..., "latitude": ..., "longitude": ...} (see // omarchy-weather-location, which owns the format). Missing, blank, or // unparseable means the location is auto-detected from the IP address. @@ -279,7 +267,6 @@ function iconForCode(code, night) { if (typeof module !== "undefined") { module.exports = { - parseWeatherStatus: parseWeatherStatus, parseLocationFile: parseLocationFile, wttrLocationQuery: wttrLocationQuery, parseGeocodingResults: parseGeocodingResults, diff --git a/shell/plugins/panels/weather/Panel.qml b/shell/plugins/panels/weather/Panel.qml index 2053d88b..dacb4ac9 100644 --- a/shell/plugins/panels/weather/Panel.qml +++ b/shell/plugins/panels/weather/Panel.qml @@ -11,7 +11,6 @@ Panel { ipcTarget: "omarchy.weather" manageIpc: false - property string omarchyPath: Quickshell.env("OMARCHY_PATH") property var anchorItem: null property bool openedFromHotkey: false @@ -126,7 +125,6 @@ Panel { // Shared hero/bar icon state, updated with each successful weather response. property string label: "" - property string klass: "" // wttr's current conditions when available; open-meteo's (bundled with the // much faster daily forecast fetch) fill the hero while wttr is in flight. diff --git a/shell/plugins/panels/weather/status.sh b/shell/plugins/panels/weather/status.sh deleted file mode 100755 index 02e7bc2b..00000000 --- a/shell/plugins/panels/weather/status.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -icon=$(omarchy-weather-icon 2>/dev/null) - -if [[ -n $icon ]]; then - icon=$(printf '%s' "$icon" | sed 's/["\\]/\\&/g') - printf '{"text":"%s"}\n' "$icon" -else - printf '{"text":"","class":"unavailable"}\n' -fi diff --git a/test/shell.d/weather-test.sh b/test/shell.d/weather-test.sh index bc94c11b..85aca8ec 100644 --- a/test/shell.d/weather-test.sh +++ b/test/shell.d/weather-test.sh @@ -10,13 +10,6 @@ const weather = requireFromRoot('shell/plugins/panels/weather/Model.js') const panelSource = fs.readFileSync(root + '/shell/plugins/panels/weather/Panel.qml', 'utf8') const widgetSource = fs.readFileSync(root + '/shell/plugins/panels/weather/BarWidget.qml', 'utf8') -assertDeepEqual( - weather.parseWeatherStatus('{"text":"☀","class":"sunny"}'), - { label: '☀', klass: 'sunny' }, - 'weather parses pill status JSON' -) -assertDeepEqual(weather.parseWeatherStatus('{'), { label: '', klass: '' }, 'weather handles invalid pill status JSON') - assertDeepEqual(weather.parseLocationFile('{"name": "Malibu", "latitude": 34.02577, "longitude": -118.7804}\n'), { name: 'Malibu', latitude: 34.02577, longitude: -118.7804 }, 'weather parses name plus coordinates from weather.json') assertDeepEqual(weather.parseLocationFile('{"name": "New York"}'), { name: 'New York', latitude: null, longitude: null }, 'weather parses a name-only weather.json') assertDeepEqual(weather.parseLocationFile('{"name": "Malibu", "latitude": 34.02577}'), { name: 'Malibu', latitude: null, longitude: null }, 'weather requires both coordinates')