import QtQuick import Quickshell.Io import "." as M M.BarSection { id: root spacing: Math.max(1, M.Theme.moduleSpacing - 2) tooltip: root.freePct + "% free of " + root.totalTb.toFixed(1) + " TB" property int freePct: 0 property real totalTb: 0 Process { id: proc running: true command: ["sh", "-c", "df -B1 --output=size,avail / | tail -1"] stdout: StdioCollector { onStreamFinished: { const parts = text.trim().split(/\s+/).map(Number); const size = parts[0], avail = parts[1]; if (size > 0) { root.freePct = Math.round((avail / size) * 100); root.totalTb = size / 1e12; } } } } Timer { interval: 30000 running: true repeat: true onTriggered: proc.running = true } M.BarIcon { icon: "\uF0C9" color: M.Theme.base09 anchors.verticalCenter: parent.verticalCenter } Text { text: root.freePct + "% " + root.totalTb.toFixed(1) color: M.Theme.base09 font.pixelSize: M.Theme.fontSize font.family: M.Theme.fontFamily verticalAlignment: Text.AlignVCenter } }