How to harness UPS state change?
I know I can edit /usr/libexec/upsshutdown to meet my needs and, for example, send a notification email that the computer is shutting down.
However, I'd also like to be able to trigger a script when the UPS switches to battery power, and when electrical power is restored before any shutdown conditions are reached. This should be possible since the system pops up a warning dialog when the UPS switches to battery power, but I can't seem to find anything about how to detect that to trigger my own stuff.
TIA,
~Philly