plugin: rust-side modules + theme services with serde-typed config

This commit is contained in:
Damocles 2026-05-04 22:58:12 +02:00
parent a86e90e927
commit f34f3f2f4e
95 changed files with 2477 additions and 1011 deletions

View file

@ -3,6 +3,7 @@ pragma Singleton
import QtQuick
import Quickshell.Services.UPower
import "." as S
import NovaStats as NS
QtObject {
id: root
@ -20,11 +21,11 @@ QtObject {
readonly property bool healthSupported: dev?.healthSupported ?? false
readonly property real healthPercent: (dev?.healthPercentage ?? 1) * 100
readonly property int critThresh: S.Modules.battery.critical || 15
readonly property int warnThresh: S.Modules.battery.warning || 25
readonly property int critThresh: NS.ModulesService.batteryCritical || 15
readonly property int warnThresh: NS.ModulesService.batteryWarning || 25
readonly property bool critical: percent < critThresh && !charging
readonly property color stateColor: charging ? S.Theme.base0B : critical ? S.Theme.base09 : percent < warnThresh ? S.Theme.base0A : S.Theme.base05
readonly property color stateColor: charging ? NS.ThemeService.base0B : critical ? NS.ThemeService.base09 : percent < warnThresh ? NS.ThemeService.base0A : NS.ThemeService.base05
// 24h history (1440 samples @ 60s)
property var history: []