added battery widget on qs

This commit is contained in:
2026-03-13 00:58:44 +00:00
parent ea47a2ca71
commit 64f2e34018

View File

@@ -3,29 +3,21 @@ import QtQuick.Layouts
import Quickshell
import Quickshell.Services.UPower
Item {
id: root
// enabled: uPowerExists
width: content.width
height: content.height
Layout.alignment: Qt.AlignCenter
RowLayout {
id: content
height: 20
anchors.centerIn: root
Rectangle {
height: text.height
width: text.width
implicitHeight: text.height
implicitWidth: text.width
color: Colors.backgroundAlt
Layout.alignment: Qt.AlignCenter
Text {
property int power: UPower.displayDevice.percentage * 100
id: text
property int power: UPower.displayDevice.percentage * 100
anchors.centerIn: parent
text: power
text: power + "%"
color: Colors.textPrimary
}
}
}
}