52 lines
1.5 KiB
QML
52 lines
1.5 KiB
QML
import QtQuick
|
|
import Quickshell
|
|
import "." as M
|
|
import "../services" as S
|
|
import "../applets" as C
|
|
|
|
M.BarModule {
|
|
id: root
|
|
active: S.Modules.memory.enable
|
|
spacing: Math.max(1, S.Theme.moduleSpacing - 2)
|
|
tooltip: "Memory: " + usedGb.toFixed(1) + " / " + totalGb.toFixed(1) + " GB"
|
|
panelNamespace: "nova-memory"
|
|
panelTitle: "Memory"
|
|
panelContentWidth: 240
|
|
panelComponent: Component {
|
|
C.MemoryApplet {
|
|
width: parent.width
|
|
percent: root.percent
|
|
usedGb: root.usedGb
|
|
totalGb: root.totalGb
|
|
availGb: root.availGb
|
|
cachedGb: root.cachedGb
|
|
buffersGb: root.buffersGb
|
|
processes: root._procs.processes
|
|
accentColor: root.accentColor
|
|
active: root._showPanel
|
|
}
|
|
}
|
|
|
|
property int percent: S.SystemStats.memPercent
|
|
property real usedGb: S.SystemStats.memUsedGb
|
|
property real totalGb: S.SystemStats.memTotalGb
|
|
property real availGb: S.SystemStats.memAvailGb
|
|
property real cachedGb: S.SystemStats.memCachedGb
|
|
property real buffersGb: S.SystemStats.memBuffersGb
|
|
|
|
property M.ProcessList _procs: M.ProcessList {
|
|
sortBy: "mem"
|
|
active: root._showPanel
|
|
onProcessesChanged: root.keepPanelOpen(300)
|
|
}
|
|
|
|
M.BarIcon {
|
|
icon: "\uEFC5"
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
M.BarLabel {
|
|
label: root.percent + "%"
|
|
minText: "100%"
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
}
|