4

I have a Fedora Core 19 system powered via a desk-side UPS. I've connected the UPS' USP port to the FC19 system, and it was apparently recognized, as upower -d now reports its presence:

 ups
     present:             yes
     state:               fully-charged
     time to empty:       1.3 hours
     percentage:          100%

I'd like to have a script run for power state changes (on battery, on line power, etc.) The documentation for upower is pretty sketchy and I can't find any reference to hooks for running scripts for these events; is this possible?

Braiam
  • 35,380
  • 25
  • 108
  • 167
TomG
  • 249
  • 1
  • 6
  • I think `-m` is your friend. – Braiam Aug 19 '14 at 01:17
  • -m isn't much help -- I want a script to run whenever it goes on battery. I was looking for something like /etc/sysconfig/ifup-xyz – TomG Aug 19 '14 at 02:08
  • If this is an APC power supply, there is [apcupsd](http://www.apcupsd.org/) which comes out of the box pre-configured to send mail to `root` on the local machine. If your system is configured to send root mail to a real address, it'll work with 0 configuration. The mail thing is just a script as well, so you can tweak it however you like. – phemmer Aug 19 '14 at 04:37
  • It's a cyberpower device; looks like they have a Linux package http://www.cyberpowersystems.com/products/management-software/ppl.html I'll be checking it out. – TomG Aug 20 '14 at 02:14
  • per https://wiki.ubuntu.com/DebuggingGNOMEPowerManager, the starting point is `dbus-monitor --session "type='signal',interface='org.freedesktop.PowerManagement'"` – sendmoreinfo Aug 21 '15 at 21:18

0 Answers0