31 lines
643 B
QML
31 lines
643 B
QML
import QtQuick
|
|
import Quickshell.Io
|
|
import "." as M
|
|
|
|
M.BarIcon {
|
|
id: root
|
|
|
|
property string profile: ""
|
|
|
|
icon: {
|
|
if (root.profile === "performance") return "";
|
|
if (root.profile === "power-saver") return "";
|
|
if (root.profile === "balanced") return "";
|
|
return "";
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|