NightLight: check if wlsunset exists, else dont enable NightLight

SystemMonitorSettings: If RAM usage is not toggled, don't show % option
Settings: remove NightLight from default bar widgets
This commit is contained in:
Ly-sec
2025-09-27 15:14:44 +02:00
parent 13e32dc11b
commit fe2654268d
5 changed files with 13 additions and 9 deletions
+1 -4
View File
@@ -1,5 +1,5 @@
{
"settingsVersion": 8,
"settingsVersion": 9,
"bar": {
"position": "top",
"backgroundOpacity": 1,
@@ -51,9 +51,6 @@
{
"id": "Brightness"
},
{
"id": "NightLight"
},
{
"id": "Clock"
},
+2 -4
View File
@@ -114,7 +114,7 @@ Singleton {
JsonAdapter {
id: adapter
property int settingsVersion: 8
property int settingsVersion: 9
// bar
property JsonObject bar: JsonObject {
@@ -156,10 +156,8 @@ Singleton {
"id": "Battery"
}, {
"id": "Volume"
}, {
}, {
"id": "Brightness"
}, {
"id": "NightLight"
}, {
"id": "Clock"
}, {
+6
View File
@@ -24,6 +24,12 @@ NIconButton {
icon: Settings.data.nightLight.enabled ? (Settings.data.nightLight.forced ? "nightlight-forced" : "nightlight-on") : "nightlight-off"
tooltipText: Settings.data.nightLight.enabled ? (Settings.data.nightLight.forced ? I18n.tr("tooltips.night-light-forced") : I18n.tr("tooltips.night-light-enabled")) : I18n.tr("tooltips.night-light-disabled")
onClicked: {
// Check if wlsunset is available before enabling night light
if (!ProgramCheckerService.wlsunsetAvailable) {
ToastService.showWarning(I18n.tr("settings.display.night-light.section.label"), I18n.tr("toast.night-light.not-installed"))
return
}
if (!Settings.data.nightLight.enabled) {
Settings.data.nightLight.enabled = true
Settings.data.nightLight.forced = false
@@ -62,6 +62,7 @@ ColumnLayout {
label: I18n.tr("bar.widget-settings.system-monitor.memory-percentage")
checked: valueShowMemoryAsPercent
onToggled: checked => valueShowMemoryAsPercent = checked
visible: valueShowMemoryUsage
}
NToggle {
+3 -1
View File
@@ -18,6 +18,7 @@ Singleton {
property bool fuzzelAvailable: false
property bool vesktopAvailable: false
property bool gpuScreenRecorderAvailable: false
property bool wlsunsetAvailable: false
// Signal emitted when all checks are complete
signal checksCompleted
@@ -31,7 +32,8 @@ Singleton {
"footAvailable": ["which", "foot"],
"fuzzelAvailable": ["which", "fuzzel"],
"vesktopAvailable": ["which", "vesktop"],
"gpuScreenRecorderAvailable": ["sh", "-c", "command -v gpu-screen-recorder >/dev/null 2>&1 || (command -v flatpak >/dev/null 2>&1 && flatpak list --app | grep -q 'com.dec05eba.gpu_screen_recorder')"]
"gpuScreenRecorderAvailable": ["sh", "-c", "command -v gpu-screen-recorder >/dev/null 2>&1 || (command -v flatpak >/dev/null 2>&1 && flatpak list --app | grep -q 'com.dec05eba.gpu_screen_recorder')"],
"wlsunsetAvailable": ["which", "wlsunset"]
})
// Internal tracking