Watch
1
0
Fork
You've already forked Zoe-Dotfiles
0
mirror of synced 2026-11-04 21:27:17 +00:00

Removed useless subdirectory, changed to dolphin

This commit is contained in:
MysteryBirb 2026-09-10 09:39:34 +02:00
commit f20db908ca
10 changed files with 4 additions and 4 deletions

View file

@ -1,52 +0,0 @@
import Quickshell
import Quickshell.Io
import QtQuick
import qs
Rectangle {
id: root
property real lastCpuTotal: 0.0
property real lastCpuIdle: 0.0
property real cpuUsage: 0.0
color: Appearance.colAppBg
implicitHeight: Appearance.appletRadHeight
implicitWidth: cpuText.width + 25
radius: Appearance.appletRadHeight
Process {
id: cpuProc
command: ["sh", "-c", "head -1 /proc/stat"]
property double cpuUsage
stdout: SplitParser {
onRead: data => {
if (!data) {
return;
}
else {
var p = data.trim().split(/\s+/);
var idle = parseInt(p[4]) + parseInt(p[5]);
var total = p.slice(1, 8).reduce((a, b) => a + parseInt(b), 0);
root.cpuUsage = Math.round(100 * (1 - (idle - root.lastCpuIdle) / (total - root.lastCpuTotal)));
root.lastCpuTotal = total;
root.lastCpuIdle = idle;
}
}
}
Component.onCompleted: running = true
}
Timer {
id: cpuProcRestarter
interval: 2000
repeat: true
running: true
onTriggered: cpuProc.running = true
}
Text {
font.family: Appearance.font
font.pixelSize: Appearance.fontSize
font.bold: true
color: Appearance.colFg
id: cpuText
anchors.centerIn: parent
text: "CPU: " + root.cpuUsage + "%"
}
}