diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-16 00:50:38 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-16 00:50:38 +1000 |
| commit | 4fe6ff22f6def77f30170c007c185685a13a9a2e (patch) | |
| tree | 02f71d72eddc8c7a5391e44d03e41453e0aa6c25 | |
| parent | Merge pull request #52 from thaemisch/betteractions (diff) | |
| download | caelestia-shell-4fe6ff22f6def77f30170c007c185685a13a9a2e.tar.gz caelestia-shell-4fe6ff22f6def77f30170c007c185685a13a9a2e.tar.bz2 caelestia-shell-4fe6ff22f6def77f30170c007c185685a13a9a2e.zip | |
feat: configurable weather location
Impls #76
| -rw-r--r-- | config/DashboardConfig.qml | 1 | ||||
| -rw-r--r-- | services/Weather.qml | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/config/DashboardConfig.qml b/config/DashboardConfig.qml index 269d4b4..02f838e 100644 --- a/config/DashboardConfig.qml +++ b/config/DashboardConfig.qml @@ -3,6 +3,7 @@ import Quickshell.Io JsonObject { property int mediaUpdateInterval: 500 property int visualiserBars: 45 + property string weatherLocation: "" // A lat,long pair, e.g. "37.8267,-122.4233" property JsonObject sizes: JsonObject { readonly property int tabIndicatorHeight: 3 diff --git a/services/Weather.qml b/services/Weather.qml index 4f53d0b..29858eb 100644 --- a/services/Weather.qml +++ b/services/Weather.qml @@ -1,8 +1,10 @@ pragma Singleton +import "root:/config" import "root:/utils" import Quickshell import Quickshell.Io +import QtQuick Singleton { id: root @@ -13,15 +15,18 @@ Singleton { property real temperature function reload(): void { - wttrProc.running = true; + if (Config.dashboard.weatherLocation) + loc = Config.dashboard.weatherLocation; + else + ipProc.running = true; } onLocChanged: wttrProc.running = true + Component.onCompleted: reload() Process { id: ipProc - running: true command: ["curl", "ipinfo.io"] stdout: StdioCollector { onStreamFinished: root.loc = JSON.parse(text).loc |