Added a check to see if wlsunset is enabled, if it isn't you can change
the NightLight settings. DisplayTab: add wlsunsetCheck process
This commit is contained in:
parent
a845067cf0
commit
39d8d8bcfa
3 changed files with 31 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
if (checked) {
|
||||
// Verify wlsunset exists before enabling
|
||||
wlsunsetCheck.running = true
|
||||
} else {
|
||||
Settings.data.nightLight.enabled = false
|
||||
NightLightService.apply()
|
||||
ToastService.showNotice("Night Light", "Disabled")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue