a BUNCH of qml which I havent reviewed yet

This commit is contained in:
2026-10-23 16:19:22 -06:00
parent 7a57f3a0d2
commit 0d297296ca
16 changed files with 921 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import QtQuick
// polybar 'internal/memory'; silent until memory usage is high
BarLabel {
id: memory
property int warnPercentage: 73
color: Colors.alert
text: ""
PollingCommand {
interval: 2000
command: ["cat", "/proc/meminfo"]
onOutput: output => {
const total = parseInt(output.match(/^MemTotal:\s+(\d+)/m)[1])
const available = parseInt(output.match(/^MemAvailable:\s+(\d+)/m)[1])
const used = Math.round((total - available) * 100 / total)
memory.text = used >= memory.warnPercentage
? `RAM${String(used).padStart(2)}%`
: ""
}
}
}