initial commit

This commit is contained in:
Damocles 2026-04-10 10:49:48 +02:00
commit 9fde6d4fc6
27 changed files with 1110 additions and 0 deletions

36
modules/Memory.qml Normal file
View file

@ -0,0 +1,36 @@
import QtQuick
import Quickshell.Io
import "." as M
Text {
id: root
property int percent: 0
FileView {
id: meminfo
path: "/proc/meminfo"
onLoaded: {
const m = {};
text().split("\n").forEach(l => {
const [k, v] = l.split(":");
if (v) m[k.trim()] = parseInt(v.trim());
});
const total = m.MemTotal;
const avail = m.MemAvailable;
if (total > 0) root.percent = Math.round(((total - avail) / total) * 100);
}
}
Timer {
interval: 2000
running: true
repeat: true
onTriggered: meminfo.reload()
}
text: " " + root.percent + "%"
color: M.Theme.base05
font.pixelSize: M.Theme.fontSize
font.family: M.Theme.fontFamily
verticalAlignment: Text.AlignVCenter
}