Removed useless subdirectory, changed to dolphin
This commit is contained in:
parent
2e2d683c62
commit
f20db908ca
10 changed files with 4 additions and 4 deletions
44
quickshell/modules/Mem.qml
Normal file
44
quickshell/modules/Mem.qml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
import qs
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
property real ramUsage
|
||||
implicitHeight: Appearance.appletRadHeight
|
||||
radius: Appearance.appletRadHeight
|
||||
implicitWidth: ramText.width + 25
|
||||
color: Appearance.colAppBg
|
||||
Process {
|
||||
id: ramProc
|
||||
command: ["sh", "-c", "free | grep Mem"]
|
||||
running: true
|
||||
stdout: SplitParser {
|
||||
onRead: data => {
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
var parts = data.trim().split(/\s+/);
|
||||
var used = parseInt(parts[2]) || 0;
|
||||
root.ramUsage = used / 1048576;
|
||||
}
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
id: ramProcRestarter
|
||||
interval: 2000
|
||||
running: true
|
||||
repeat: true
|
||||
onTriggered: ramProc.running = true
|
||||
}
|
||||
Text {
|
||||
id: ramText
|
||||
anchors.centerIn: root
|
||||
text: "RAM: " + root.ramUsage.toFixed(2) + " GiB"
|
||||
font.family: Appearance.font
|
||||
font.pixelSize: Appearance.fontSize
|
||||
font.bold: true
|
||||
color: Appearance.colFg
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue