15

I have an Apple Wireless Keyboard and a Magic Trackpad, and I was wondering if there is a way to monitor the battery life remaining/percentage like there is in OSX.

4 Answers 4

19

There isn't a GUI for read wireless mouse or keyboard battery data.

You can find useful information on sysfs under /sys/class/power_supply/. For example the Apple Wireless Keyboard is under /sys/class/power_supply/hid-78:CA:39:4E:6F:C7-battery/. In the device directory there is a file named capacity, this is a capacity in percents.

So in summary, for reading Apple Wireless Keyboard battery capacity you should do:

cat /sys/class/power_supply/hid-78:CA:39:4E:6F:C7-battery/capacity

Note that hid-78:CA:39:4E:6F:C7-battery can be different for your device.

2
  • Huh, this is a really cool directory I never knew about! Thanks! Feb 11, 2018 at 18:09
  • My device does not show in power_supply/ what to do? Jul 24, 2018 at 14:29
9

In newer Ubuntu (starting from 16.04, I guess), check under Settings -> Power

Here's a screenshot for Ubuntu 16.04 .

3
  • Could you be specific about the first version you saw this on? Oct 10, 2018 at 18:56
  • @MarkStosberg updated answer Oct 11, 2018 at 19:50
  • Sadly on 18.04 AirPods do not show here.
    – Steven Lu
    Jun 8, 2020 at 22:11
3

According to this article on webupd8, this functionality is planned for Ubuntu 11.10 as part of Ubuntu's new Power Indicator.

0
0

if you are using your magic keyboard on Linux (I'm using Ubuntu 20.04), In settings, Select Power Statistics and look for keyboard

Below is the screenshot

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .