adds overview, removes old stuff

This commit is contained in:
2026-08-19 20:47:29 +02:00
parent 6a9ae98c26
commit 67d50fb504
75 changed files with 3558 additions and 1691 deletions
@@ -0,0 +1,43 @@
// MemoryWidget.qml - " X.XX / Y GB"
import QtQuick
import Quickshell.Io
import ".."
Pill {
id: root
property real usedGb: 0
property real totalGb: 0
onClicked: (m) => {
if (m.button === Qt.LeftButton) Exec.run(["kitty", "-e", "btop"])
}
Text {
text: " " + root.usedGb.toFixed(2) + " / " + root.totalGb.toFixed(0) + " GB"
font.family: Theme.fontSans
font.pixelSize: Theme.fontSize
color: Theme.pillText
}
Process {
id: memProc
running: false
command: ["cat", "/proc/meminfo"]
stdout: StdioCollector {
onStreamFinished: {
const text = this.text
const total = parseInt((/MemTotal:\s+(\d+)/.exec(text) || [])[1] || "0")
const avail = parseInt((/MemAvailable:\s+(\d+)/.exec(text) || [])[1] || "0")
root.totalGb = total / 1048576
root.usedGb = (total - avail) / 1048576
}
}
onExited: memProc.running = false
}
Timer {
interval: 5000; running: true; repeat: true
triggeredOnStart: true
onTriggered: memProc.running = true
}
}