nova-shell/modules/PowerProfile.qml
2026-04-10 10:49:48 +02:00

35 lines
782 B
QML

import QtQuick
import Quickshell.Io
import "." as M
Text {
id: root
property string profile: ""
Process {
id: proc
running: true
command: ["powerprofilesctl", "get"]
stdout: StdioCollector {
onStreamFinished: root.profile = text.trim()
}
}
Timer {
interval: 5000
running: true
repeat: true
onTriggered: proc.running = true
}
text: {
if (root.profile === "performance") return "";
if (root.profile === "power-saver") return "";
if (root.profile === "balanced") return "";
return "";
}
color: M.Theme.base05
font.pixelSize: M.Theme.fontSize + 1
font.family: M.Theme.fontFamily
verticalAlignment: Text.AlignVCenter
}