Catch power events (suspend, resume) on linux
Hi, on Windows I implemented QWidget::winEvent() and process the power events (suspend, standby, resume; using WM_POWERBROADCAST) there. This works quite well.
Now I need to implement the same functionality under linux. I looked at QWidget::X11Event(), but it seems that XEvent does not handle power events like standby or resume.
Did I overlook something? Or is there another way to catch power events on linux?
Ginsengelf
Re: Catch power events (suspend, resume) on linux
The closest to a standard API you can get on Linux desktops probably is UPower (http://upower.freedesktop.org/), which is exposed as the D-Bus interface org.freedesktop.UPower. It features a few interesting signals, such as Sleeping() and Resuming(). See the documentation of Qt D-Bus to know how to interface them with your application.
Re: Catch power events (suspend, resume) on linux
If you are looking for a Qt API, have a look at Solid: http://inqlude.org/libraries/solid.html
Cheers,
_