UPowerDevice: QtObject [uncreatable]

import Quickshell.Services.UPower

A device exposed through the UPower system service.

Properties

Property Details

[readonly]

changeRate: real

Rate of energy change in watts (positive when charging, negative when discharging).

[readonly]

energy: real

Current energy level of the device in watt-hours.

[readonly]

energyCapacity: real

Maximum energy capacity of the device in watt-hours

[readonly]

healthPercentage: real

Health of the device as a percentage of its original health.

[readonly]

healthSupported: bool

No details provided.

[readonly]

iconName: string

Name of the icon representing the current state of the device, or an empty string if not provided.

[readonly]

isLaptopBattery: bool

If the device is a laptop battery or not. Use this to check if your device is a valid battery.

This will be equivalent to type == Battery && powerSupply == true.

[readonly]

isPresent: bool

If the power source is present in the bay or slot, useful for hot-removable batteries.

If the device type is not Battery, then the property will be invalid.

[readonly]

nativePath: string

Native path of the device specific to your OS.

[readonly]

percentage: real

Current charge level as a percentage.

This would be equivalent to energy / energyCapacity.

[readonly]

powerSupply: bool

If the device is a power supply for your computer and can provide charge.

[readonly]

state: UPowerDeviceState

Current state of the device.

[readonly]

timeToEmpty: real

Estimated time until the device is fully discharged, in seconds.

Will be set to 0 if charging.

[readonly]

timeToFull: real

Estimated time until the device is fully charged, in seconds.

Will be set to 0 if discharging.

[readonly]

type: UPowerDeviceType

The type of device.