nova-shell/modules/PowerProfile.qml
2026-04-11 00:22:09 +02:00

38 lines
818 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
}