mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-20 01:58:11 +02:00
read-only-mirror of https://gitlab.freedesktop.org/upower/upower
Analog to time-to-empty, but taking into account that time-to-action happens before that, so it estimates the time until the system stops working normally and it's instead forced to suspend/power-off/etc., when the battery is almost depleted. It makes the calculations necessary based on the configured values, whether they are time-based, or percentage-based. This property is only valid for /org/freedesktop/UPower/devices/DisplayDevice and not for actual batteries, because it is a property of the system as a whole and not physical batteries. In most systems (e.g. laptops) they would be the same, since there is only one battery; but depending on the system, there can be multiple batteries and they can deplete at different rates, so the per-battery calculation would not be useful. Also, similar to time-to-empty, it's only valid when the system is Discharging. Add also relevant integration test: - test_time_to_action |
||
|---|---|---|
| .ci | ||
| contrib | ||
| data/zsh-completion | ||
| dbus | ||
| doc | ||
| etc | ||
| libupower-glib | ||
| po | ||
| policy | ||
| rules | ||
| src | ||
| tools | ||
| .git-blame-ignore-revs | ||
| .gitconfig | ||
| .gitlab-ci.yml | ||
| .markdownlint.json | ||
| .pre-commit-config.yaml | ||
| AUTHORS | ||
| code-of-conduct.md | ||
| COMMITMENT | ||
| COPYING | ||
| HACKING.md | ||
| meson.build | ||
| meson_options.txt | ||
| NEWS | ||
| README.md | ||
| RELEASE | ||
UPower
Requirements:
glib-2.0 >= 2.66.0
gio-2.0 >= 2.16.1
gudev-1.0 >= 235 (Linux)
libimobiledevice-1.0 >= 0.9.7 (optional)
polkit-gobject-1 >= 124
UPower is an abstraction for enumerating power devices, listening to device events and querying history and statistics. Any application or service on the system can access the org.freedesktop.UPower service via the system message bus.
Debugging
When doing bug reports, the following information can be useful:
grep . /sys/class/power_supply/*/*
This includes the current kernel view of all power supplies in the system. It is always a good idea to include this information.udevadm info -e
This shows the hardware configuration and is relevant when e.g. the type of an external device is misdetected.upower -d
Shows upower's view of the stateupower --monitor-detail
Dumps device information every time that a change happens. This helps with debugging dynamic issues.udevadm monitor
Dumps the udev/kernel reported hardware changes (and addition/removal). This is helpful when debugging dynamic issues, in particular if it is not clear whether the issue is coming from the kernel or upower.
In addition, it can also be useful to run upower in debug mode and post the logs. There are two ways of doing so:
- Run upower daemon manually, you can do so using:
sudo /usr/libexec/upowerd -rd - Modify the systemd service and restart. This is best done by:
-
sudo systemctl edit upower.service -
Adding the two lines:
[Service] Environment=G_MESSAGES_DEBUG=all -
sudo systemctl restart upower.service -
Grab logs using
journalctl -u upower.serviceor similar
-