summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoramane <61896496+soramanew@users.noreply.github.com>2025-07-16 21:44:27 +1000
committerSoramane <61896496+soramanew@users.noreply.github.com>2025-07-16 21:44:27 +1000
commitf263df3ccdc7eab6d3befe8f189715df3cf27b59 (patch)
tree3d6c4b272937fcbda00e0848939b13c630ce20d0
parentnix: add qt log rules to devshell (diff)
downloadcaelestia-shell-f263df3ccdc7eab6d3befe8f189715df3cf27b59.tar.gz
caelestia-shell-f263df3ccdc7eab6d3befe8f189715df3cf27b59.tar.bz2
caelestia-shell-f263df3ccdc7eab6d3befe8f189715df3cf27b59.zip
internal: create service config
-rw-r--r--config/Config.qml2
-rw-r--r--config/DashboardConfig.qml2
-rw-r--r--config/ServiceConfig.qml6
-rw-r--r--modules/dashboard/dash/Weather.qml2
-rw-r--r--modules/lock/WeatherInfo.qml2
-rw-r--r--services/Weather.qml4
6 files changed, 12 insertions, 6 deletions
diff --git a/config/Config.qml b/config/Config.qml
index f95e38f..2b8eff7 100644
--- a/config/Config.qml
+++ b/config/Config.qml
@@ -16,6 +16,7 @@ Singleton {
property alias session: adapter.session
property alias winfo: adapter.winfo
property alias lock: adapter.lock
+ property alias services: adapter.services
property alias paths: adapter.paths
FileView {
@@ -36,6 +37,7 @@ Singleton {
property JsonObject session: SessionConfig {}
property JsonObject winfo: WInfoConfig {}
property JsonObject lock: LockConfig {}
+ property JsonObject services: ServiceConfig {}
property JsonObject paths: UserPaths {}
}
}
diff --git a/config/DashboardConfig.qml b/config/DashboardConfig.qml
index 201b8d3..269d4b4 100644
--- a/config/DashboardConfig.qml
+++ b/config/DashboardConfig.qml
@@ -3,8 +3,6 @@ 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 bool useFahrenheit: false
property JsonObject sizes: JsonObject {
readonly property int tabIndicatorHeight: 3
diff --git a/config/ServiceConfig.qml b/config/ServiceConfig.qml
new file mode 100644
index 0000000..0b8b170
--- /dev/null
+++ b/config/ServiceConfig.qml
@@ -0,0 +1,6 @@
+import Quickshell.Io
+
+JsonObject {
+ property string weatherLocation: "" // A lat,long pair or empty for autodetection, e.g. "37.8267,-122.4233"
+ property bool useFahrenheit: false
+}
diff --git a/modules/dashboard/dash/Weather.qml b/modules/dashboard/dash/Weather.qml
index 52d026d..6bb9792 100644
--- a/modules/dashboard/dash/Weather.qml
+++ b/modules/dashboard/dash/Weather.qml
@@ -38,7 +38,7 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
animate: true
- text: Config.dashboard.useFahrenheit ? Weather.tempF : Weather.tempC
+ text: Config.services.useFahrenheit ? Weather.tempF : Weather.tempC
color: Colours.palette.m3primary
font.pointSize: Appearance.font.size.extraLarge
font.weight: 500
diff --git a/modules/lock/WeatherInfo.qml b/modules/lock/WeatherInfo.qml
index bbb529f..c5d1cf5 100644
--- a/modules/lock/WeatherInfo.qml
+++ b/modules/lock/WeatherInfo.qml
@@ -40,7 +40,7 @@ RowLayout {
Layout.fillWidth: true
animate: true
- text: Config.dashboard.useFahrenheit ? Weather.tempF : Weather.tempC
+ text: Config.services.useFahrenheit ? Weather.tempF : Weather.tempC
color: Colours.palette.m3primary
horizontalAlignment: Text.AlignHCenter
font.pointSize: Appearance.font.size.extraLarge
diff --git a/services/Weather.qml b/services/Weather.qml
index 493a2a0..38750ae 100644
--- a/services/Weather.qml
+++ b/services/Weather.qml
@@ -15,8 +15,8 @@ Singleton {
property string tempF: "0°F"
function reload(): void {
- if (Config.dashboard.weatherLocation)
- loc = Config.dashboard.weatherLocation;
+ if (Config.services.weatherLocation)
+ loc = Config.services.weatherLocation;
else if (!loc || timer.elapsed() > 900)
Requests.get("https://ipinfo.io/json", text => {
loc = JSON.parse(text).loc ?? "";