diff --git a/Modules/ArchUpdaterPanel/ArchUpdaterPanel.qml b/Modules/ArchUpdaterPanel/ArchUpdaterPanel.qml index 67b6827..f1cb5eb 100644 --- a/Modules/ArchUpdaterPanel/ArchUpdaterPanel.qml +++ b/Modules/ArchUpdaterPanel/ArchUpdaterPanel.qml @@ -111,7 +111,7 @@ NPanel { id: checkbox label: "" description: "" - checked: (ArchUpdaterService.selectedPackagesCount, ArchUpdaterService.isPackageSelected(modelData.name)) + checked: (ArchUpdaterService.selectedPackagesCountArchUpdaterService.isPackageSelected(modelData.name)) onToggled: ArchUpdaterService.togglePackageSelection(modelData.name) activeColor: (modelData.source === "aur") ? Color.mSecondary : Color.mPrimary activeOnColor: (modelData.source === "aur") ? Color.mOnSecondary : Color.mOnPrimary diff --git a/Modules/SettingsPanel/Tabs/DisplayTab.qml b/Modules/SettingsPanel/Tabs/DisplayTab.qml index bbb7da8..f7ea808 100644 --- a/Modules/SettingsPanel/Tabs/DisplayTab.qml +++ b/Modules/SettingsPanel/Tabs/DisplayTab.qml @@ -2,6 +2,7 @@ import QtQuick import QtQuick.Layouts import QtQuick.Controls import Quickshell +import Quickshell.Io import qs.Commons import qs.Services import qs.Widgets @@ -27,6 +28,27 @@ ColumnLayout { } } + // Check for wlsunset availability when enabling Night Light + Process { + id: wlsunsetCheck + command: ["which", "wlsunset"] + running: false + + onExited: function (exitCode) { + if (exitCode === 0) { + Settings.data.nightLight.enabled = true + NightLightService.apply() + ToastService.showNotice("Night Light", "Enabled") + } else { + Settings.data.nightLight.enabled = false + ToastService.showWarning("Night Light", "wlsunset not installed") + } + } + + stdout: StdioCollector {} + stderr: StdioCollector {} + } + // Helper functions to update arrays immutably function addMonitor(list, name) { const arr = (list || []).slice() @@ -240,8 +262,14 @@ ColumnLayout { description: "Apply a warm color filter to reduce blue light emission." checked: Settings.data.nightLight.enabled onToggled: checked => { - Settings.data.nightLight.enabled = checked - NightLightService.apply() + if (checked) { + // Verify wlsunset exists before enabling + wlsunsetCheck.running = true + } else { + Settings.data.nightLight.enabled = false + NightLightService.apply() + ToastService.showNotice("Night Light", "Disabled") + } } } diff --git a/Widgets/NCheckbox.qml b/Widgets/NCheckbox.qml index 0f0a8e9..24944e2 100644 --- a/Widgets/NCheckbox.qml +++ b/Widgets/NCheckbox.qml @@ -11,10 +11,8 @@ RowLayout { property string description: "" property bool checked: false property bool hovering: false - // Active state colors (allow override per-usage) property color activeColor: Color.mPrimary property color activeOnColor: Color.mOnPrimary - // Smaller default footprint than NToggle property int baseSize: Math.max(Style.baseWidgetSize * 0.8, 14) signal toggled(bool checked)