plugin: rust-side modules + theme services with serde-typed config
This commit is contained in:
parent
a86e90e927
commit
f34f3f2f4e
95 changed files with 2477 additions and 1011 deletions
|
|
@ -3,11 +3,12 @@ import Quickshell
|
|||
import "." as M
|
||||
import "../services" as S
|
||||
import "../applets" as C
|
||||
import NovaStats as NS
|
||||
|
||||
M.BarModule {
|
||||
id: root
|
||||
active: S.Modules.disk.enable
|
||||
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
|
||||
active: NS.ModulesService.diskEnable
|
||||
spacing: Math.max(1, NS.ThemeService.moduleSpacing - 2)
|
||||
tooltip: "Disk: " + _rootPct + "% used"
|
||||
panelNamespace: "nova-disk"
|
||||
panelContentWidth: 260
|
||||
|
|
@ -21,7 +22,7 @@ M.BarModule {
|
|||
|
||||
property var _mounts: S.SystemStats.diskMounts
|
||||
property int _rootPct: S.SystemStats.diskRootPct
|
||||
readonly property int _warnThreshold: S.Modules.disk.warnThreshold ?? 85
|
||||
readonly property int _warnThreshold: NS.ModulesService.diskWarnThreshold ?? 85
|
||||
readonly property bool _anyWarn: {
|
||||
for (const m of _mounts)
|
||||
if (m.pct >= _warnThreshold)
|
||||
|
|
@ -31,13 +32,13 @@ M.BarModule {
|
|||
|
||||
M.BarIcon {
|
||||
icon: "\uF0C9"
|
||||
color: root._anyWarn ? S.Theme.base09 : root.accentColor
|
||||
color: root._anyWarn ? NS.ThemeService.base09 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
M.BarLabel {
|
||||
label: root._rootPct + "%"
|
||||
minText: "100%"
|
||||
color: root._anyWarn ? S.Theme.base09 : root.accentColor
|
||||
color: root._anyWarn ? NS.ThemeService.base09 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue