UPowerDevice: QtObject [uncreatable]
import Quickshell.Services.UPower
A device exposed through the UPower system service.
Properties
- changeRate: real
- energy: real
- energyCapacity: real
- healthPercentage: real
- healthSupported: bool
- iconName: string
- isLaptopBattery: bool
- isPresent: bool
- nativePath: string
- percentage: real
- powerSupply: bool
- state: UPowerDeviceState
- timeToEmpty: real
- timeToFull: real
- type: UPowerDeviceType
Property Details
changeRate: real
Rate of energy change in watts (positive when charging, negative when discharging).
energy: real
Current energy level of the device in watt-hours.
energyCapacity: real
Maximum energy capacity of the device in watt-hours
healthPercentage: real
Health of the device as a percentage of its original health.
healthSupported: bool
No details provided.
iconName: string
Name of the icon representing the current state of the device, or an empty string if not provided.
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.
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.
nativePath: string
Native path of the device specific to your OS.
percentage: real
Current charge level as a percentage.
This would be equivalent to energy / energyCapacity.
powerSupply: bool
If the device is a power supply for your computer and can provide charge.
state: UPowerDeviceState
Current state of the device.
timeToEmpty: real
Estimated time until the device is fully discharged, in seconds.
Will be set to 0
if charging.
timeToFull: real
Estimated time until the device is fully charged, in seconds.
Will be set to 0
if discharging.
type: UPowerDeviceType
The type of device.