diff options
| author | Petri Hienonen <petri.hienonen@gmail.com> | 2024-05-23 13:56:00 +0300 |
|---|---|---|
| committer | Petri Hienonen <petri.hienonen@gmail.com> | 2025-11-30 12:29:57 +0200 |
| commit | 08297376a85a1719518507e54fca9de954d2376a (patch) | |
| tree | 3b9c58304b40248533bbb2bb5b7bad2da9da1ff0 /home/quickshell/bar/blocks/Memory.qml | |
| parent | 75c2af4aedd2ac5c2cfc74b346625fa4b265541d (diff) | |
| download | nixos-08297376a85a1719518507e54fca9de954d2376a.tar.zst | |
Agenix configuration
Diffstat (limited to 'home/quickshell/bar/blocks/Memory.qml')
| -rw-r--r-- | home/quickshell/bar/blocks/Memory.qml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/home/quickshell/bar/blocks/Memory.qml b/home/quickshell/bar/blocks/Memory.qml new file mode 100644 index 0000000..4a931c1 --- /dev/null +++ b/home/quickshell/bar/blocks/Memory.qml @@ -0,0 +1,31 @@ +import QtQuick +import QtQuick.Controls +import Quickshell +import Quickshell.Io +import "../" + +BarBlock { + id: text + content: BarText { + symbolText: `- ${Math.floor(percentFree)}%` + } + + property real percentFree + + Process { + id: memProc + command: ["sh", "-c", "free | grep Mem | awk '{print $3/$2 * 100.0}'"] + running: true + + stdout: SplitParser { + onRead: data => percentFree = data + } + } + + Timer { + interval: 2000 + running: true + repeat: true + onTriggered: memProc.running = true + } +} |
