The appleir driver was posted here: http://thread.gmane.org/gmane.linux.kernel.input/4898 The patch shows that it only prints out a warning when the battery is running flat: + dev_err(&appleir->input_dev->dev, "possible flat battery?\n"); Instead, it should use power_supply class, so that the device's battery status can be propagated to user-space, and allow programs like gnome-power-manager to warn the user about the low-battery.
Is the userspace smart enough to distinguish between the main power source and somewhat uninteresting power supplys like this one and not try to shut down the box when power is low?
Of course it is. Otherwise we'd have been broken for a lot of other devices.
(In reply to comment #2) > Of course it is. Otherwise we'd have been broken for a lot of other devices. DeviceKit-power supports lots of device types, and only does the shutdown logic on system devices like UPS and internal laptop battery. I think it would be very simple to implement the power_supply class in this case.
FWIW, I reposted the appleir driver, and it wouldn't be possible to use the power_supply class, because the data is about the remote, not the receiver, and you can use whichever remote you fancy. So you'd get data from one remote, and have no idea the other remote's battery was not dead. I'll use a kobject_uevent instead.