I'm trying to automate desktop setup, and as part of that I'd like to install a battery monitor package only if the machine currently has a battery attached (UPSes and other external batteries are not relevant). How can I go about detecting this?
My laptop has a directory
/sys/class/power_supply/BAT1 and my desktop has nothing in the
/sys/class/power_supply directory. Is that a rock-solid indicator on a system with sysfs? The reference doesn't mention
BATn directories; are they likely a vendor-specific feature?