From eceb453036313db2052ead4b70474dbac02e12c7 Mon Sep 17 00:00:00 2001 From: zach Date: Thu, 9 Apr 2026 19:25:56 +0200 Subject: [PATCH] check updates config option --- Config/Config.qml | 2 +- Config/Services.qml | 1 + Helpers/Updates.qml | 6 ++++-- Modules/Settings/Categories/Services.qml | 17 +++++++++++++---- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Config/Config.qml b/Config/Config.qml index b88f373..c4777dc 100644 --- a/Config/Config.qml +++ b/Config/Config.qml @@ -270,6 +270,7 @@ Singleton { function serializeServices(): var { return { weatherLocation: services.weatherLocation, + updates: services.updates, useFahrenheit: services.useFahrenheit, ddcutilService: services.ddcutilService, useTwelveHourClock: services.useTwelveHourClock, @@ -322,7 +323,6 @@ Singleton { ElapsedTimer { id: timer - } Timer { diff --git a/Config/Services.qml b/Config/Services.qml index e091fa2..4711120 100644 --- a/Config/Services.qml +++ b/Config/Services.qml @@ -14,6 +14,7 @@ JsonObject { "to": "YT Music" } ] + property bool updates: true property bool useFahrenheit: false property bool useTwelveHourClock: Qt.locale().timeFormat(Locale.ShortFormat).toLowerCase().includes("a") property int visualizerBars: 30 diff --git a/Helpers/Updates.qml b/Helpers/Updates.qml index ec165d0..fb1bbab 100644 --- a/Helpers/Updates.qml +++ b/Helpers/Updates.qml @@ -5,6 +5,7 @@ import QtQuick import Quickshell import Quickshell.Io import qs.Paths +import qs.Config Singleton { id: root @@ -44,13 +45,14 @@ Singleton { Timer { interval: 1 repeat: true - running: true + running: Config.services.updates onTriggered: { if (!root.loaded || !root.commandReady) return; - updatesProc.running = true; + if (Config.services.updates) + updatesProc.running = true; interval = 5000; } } diff --git a/Modules/Settings/Categories/Services.qml b/Modules/Settings/Categories/Services.qml index 3d34fea..d730c74 100644 --- a/Modules/Settings/Categories/Services.qml +++ b/Modules/Settings/Categories/Services.qml @@ -18,6 +18,15 @@ SettingsPage { Separator { } + SettingSwitch { + name: "Check for updates" + object: Config.services + setting: "updates" + } + + Separator { + } + SettingSwitch { name: "Use Fahrenheit" object: Config.services @@ -60,9 +69,9 @@ SettingsPage { } SettingSpinBox { - name: "Audio increment" max: 1 min: 0 + name: "Audio increment" object: Config.services setting: "audioIncrement" step: 0.05 @@ -72,9 +81,9 @@ SettingsPage { } SettingSpinBox { - name: "Brightness increment" max: 1 min: 0 + name: "Brightness increment" object: Config.services setting: "brightnessIncrement" step: 0.05 @@ -84,9 +93,9 @@ SettingsPage { } SettingSpinBox { - name: "Max volume" max: 5 min: 0 + name: "Max volume" object: Config.services setting: "maxVolume" step: 0.05 @@ -105,8 +114,8 @@ SettingsPage { } SettingSpinBox { - name: "Visualizer bars" min: 1 + name: "Visualizer bars" object: Config.services setting: "visualizerBars" step: 1