Xfce Forum

Sub domains
 

You are not logged in.

#1 2010-10-20 14:00:02

lalebarde
Member
Registered: 2010-10-20
Posts: 2

How to hook the power manager with a script or add a process to "inhibit" ?

Hi all,
I would like to launch a script when the xfce power manager detects no activity for some time, before it goes to suspend (or whatever one has defined).

My needs are :
1) To check the activity rate of my PC and reset the power manager timer - For example, when I perform heavy calculation, I don't want my PC to go to suspend after 15', which is the time I parameterized my xfce power manager.
2) If I really have no activity, take the opportunity to perform some automatized maintenance tasks of my own.

So my questions are :
i) How to hook the power manager ? Possibly a script exist for it, but I have not found it in the documentation.
ii) How to reset the xfce power manage timer ? There may exist a dedicated feature for that. Otherwise, I may emulate a mouse move with cnee.

It seems that something exist (http://goodies.xfce.org/projects/applic … 1239402743)

and it provides the inhibit interface which allows applications to prevent automatic sleep actions via the power manager

But I have not found any explanation, nor howto. There might be some way to add some process in some inhibit list ?

Offline

#2 2010-10-20 18:48:42

herd
Member
From: Germany
Registered: 2006-05-18
Posts: 143
Website

Re: How to hook the power manager with a script or add a process to "inhibit" ?

If you are willing to dig into D-Bus, dbus-send etc., there is a way.

However, the most painless way to achieve this is to write a python program:
- You get to know if inhibition changes from some other program
- You can inhibit (lock) and de-inhibit in your program
- But you can't get a callback from power manager where it asks you if you think its OK to go to sleep/hibernate and your nay-saying is honoured.

Offline

#3 2010-10-22 08:22:34

lalebarde
Member
Registered: 2010-10-20
Posts: 2

Re: How to hook the power manager with a script or add a process to "inhibit" ?

Thanks for your answer.

herd wrote:

If you are willing to dig into D-Bus, dbus-send etc., there is a way.

Too geek for me. However, I could not find the documentation for the "xfce power manager" dbus interface. I would have expected a link in the power manager page : http://goodies.xfce.org/projects/applic … 1239402743.

herd wrote:

- But you can't get a callback from power manager where it asks you if you think its OK to go to sleep/hibernate and your nay-saying is honoured.

  :-( Too sad !

Offline

Board footer

Powered by FluxBB