How do I detect when my system wakes up from suspend via DBus or similar in a python app?

Posted by con-f-use on Ask Ubuntu See other posts from Ask Ubuntu or by con-f-use
Published on 2012-09-03T09:09:02Z Indexed on 2012/09/03 9:49 UTC
Read the original article Hit count: 221

In a background Python script I need to detect, when the system just woke up from suspend. What is a good way that does not rely on a root script but rather on python modules such as DBus?

I'm new to dbus so I could really use some example code. From what I read it's related to

org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Resuming

Can anyone help me out with some code that connects the resuming signal to callback?

© Ask Ubuntu or respective owner

Related posts about python

Related posts about power-management