2025-01-10 11:57:36 +04:00
|
|
|
import QtQuick
|
|
|
|
import Quickshell.Services.UPower
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: battery
|
|
|
|
|
2025-01-13 07:07:13 +04:00
|
|
|
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
|
|
|
|
}
|
2025-01-10 11:57:36 +04:00
|
|
|
}
|