import QtQuick import Quickshell.Io import QtQuick.Controls import "." as M Row { id: root spacing: 2 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" anchors.verticalCenter: parent.verticalCenter } Text { text: root.freePct + "% " + root.totalTb.toFixed(1) color: M.Theme.base05 font.pixelSize: M.Theme.fontSize font.family: M.Theme.fontFamily verticalAlignment: Text.AlignVCenter } HoverHandler { id: hover } ToolTip { visible: hover.hovered text: root.freePct + "% free of " + root.totalTb.toFixed(1) + " TB" } }