basic battery percentage for now

This commit is contained in:
Sakooooo 2025-01-13 07:07:13 +04:00
parent 95fb3257fb
commit a7cc075664
Signed by: sako
GPG key ID: 3FD715D87D7725E0
2 changed files with 11 additions and 1 deletions

View file

@ -4,4 +4,14 @@ import Quickshell.Services.UPower
Item {
id: battery
readonly property var chargeState: UPower.displayDevice.state
readonly property bool isCharging: chargeState == UPowerDeviceState.Charging;
readonly property bool isPluggedIn: isCharging || chargeState == UPowerDeviceState.PendingCharge;
readonly property real percentage: UPower.displayDevice.percentage
readonly property bool isLow: percentage <= 0.2
Text {
color: "#FFFFFF"
text: percentage
}
}

View file

@ -74,7 +74,7 @@ ShellRoot {
ColumnLayout {
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
/* spacing: 5 */
spacing: 15
Tray {}
Battery { }