Subject: bug#25559: Trouble getting battery status

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 23 Aug 2019 02:41:47 +0200

Lars Ingebrigtsen <[email-masked]> writes:

> It looks like it just looks for batteries named BATx:
>
> (defcustom battery-linux-sysfs-regexp "[bB][aA][tT][0-9]?$"
>
> That seems unnecessary -- surely we can just look into all the
> directories there and see whether it looks like we have a battery
> directory?  The patch below does this, but perhaps it's problematic.  Do
> all power_supply/<battery> directories have a "capacity" file, or does
> that vary by Linux kernel version?

There were no comments, and I've tested the patch on three different
GNU/Linux systems, and it seems to work OK.  But like I said, I'm not
extremely confident about this change -- if this leads to problems,
feel free to revert.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no