upower
Learn how to use upower to query battery percentage, list power devices, and monitor power events for Bluetooth headsets and other devices on Linux
Grep battery percentage of headset
upower --dump|grep "percentage"
Show connected devices
upower -e
/org/freedesktop/UPower/devices/headset_dev_C1_09_55_18_8B_BB
/org/freedesktop/UPower/devices/DisplayDevice
Show info for our headset
upower -i /org/freedesktop/UPower/devices/headset_dev_C1_09_55_18_8B_BB
native-path: /org/bluez/hci0/dev_C1_09_55_18_8B_BB
model: WH-1000XM5
serial: 88:C9:E8:1E:9F:B5
power supply: no
updated: Thu Jan 29 00:01:15 2026 (514 seconds ago)
has history: yes
has statistics: no
headset
warning-level: none
percentage: 100%
icon-name: 'battery-missing-symbolic'
Output when we turn our bluetooth headphones on/off
upower -m
Monitoring activity from the power daemon. Press Ctrl+C to cancel.
[01:54:55.412] device removed: /org/freedesktop/UPower/devices/headset_dev_82_17_e4_c9_2d_a9
[01:55:09.747] device added: /org/freedesktop/UPower/devices/headset_dev_82_17_e4_c9_2d_a9
Output when we turn our bluetooth headphones on/off (it only dumps data when we connect our headphones)
upower --monitor-detail
Monitoring activity from the power daemon. Press Ctrl+C to cancel.
[01:57:23.256] device added: /org/freedesktop/UPower/devices/headset_dev_C1_09_55_18_8B_BB
native-path: /org/bluez/hci0/dev_C1_09_55_18_8B_BB
model: WH-1000XM5
serial: C1:09:55:18:8B:BB
power supply: no
updated: Thu Jan 29 01:57:23 2026 (0 seconds ago)
has history: yes
has statistics: no
headset
warning-level: none
percentage: 100%
icon-name: 'battery-missing-symbolic'
History (charge):
1769648243 0.000 unknown
History (rate):
1769648243 0.000 unknown
Resource(s)
https://upower.freedesktop.org/docs/