Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-04-29 16:41:40

jarnos
Member
From: Finland
Registered: 2009-03-22
Posts: 50
Website

Screensaver and power management inhibition mechanism

Hi

Can someone clarify how applications can make requests for screensaver and power management inhibition? Sometimes I see in Xfce power manager's menu an item stating that my web browser is currently inhibiting power management and

$ xfce4-screensaver-command -q

tells

The screensaver is inactive
The screensaver is being inhibited by:
    Application="xfce4-power-manager"; Since="2021-04-29T19:36:58+03"; Reason="Inhibit requested";

BTW, it would be great, if inhibition would be shown in the panel without opening power manager's menu.

Offline

#2 2021-05-15 09:54:17

jarnos
Member
From: Finland
Registered: 2009-03-22
Posts: 50
Website

Re: Screensaver and power management inhibition mechanism

Does xfce4-power-manager have some automatic mechanism to inhibit DMPS when playing video? Or does it depend on player?

Offline

#3 2021-05-15 09:55:19

jarnos
Member
From: Finland
Registered: 2009-03-22
Posts: 50
Website

Re: Screensaver and power management inhibition mechanism

Can xfce4-power-manager inhibit XScreenSaver, too?

Offline

#4 2021-05-15 20:26:47

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Screensaver and power management inhibition mechanism

jarnos wrote:

Can someone clarify how applications can make requests for screensaver and power management inhibition?

A dbus call by the application making a request for the power manager to inhibit power management. A good tool to see this in action is d-feet. For example:

- d-feet viewing session bus, org.xfce.PowerManager, org.freedesktop.Inhibit interface. Note that there are 4 methods that can be called:
db1.png

- Double-click on the "Inhibit" method, add in the two parameters it is looking for ("my app","testing inhibit") and press Execute (make note of the "method output" value):
db2.png

- xfce-power-manager showing myapp inhibiting power management:
db3.png

- Double-click the Unhibit method, enter in the value from above and press Execute:
db4.png

- xfce4-power-manager is not longer being inhibited:
db5.png


Sometimes I see in Xfce power manager's menu an item stating that my web browser is currently inhibiting power management

I believe chrome/chromium does, firefox doesn't, it is using the dbus method to do so.

and

$ xfce4-screensaver-command -q

tells

The screensaver is inactive
The screensaver is being inhibited by:
    Application="xfce4-power-manager"; Since="2021-04-29T19:36:58+03"; Reason="Inhibit requested";

xfce4-power-manager can inhibit xfce4-screensaver in the same manner. Note that the org.xfce.Screensaver interface also has an Inhibit method:
db6.png

BTW, it would be great, if inhibition would be shown in the panel without opening power manager's menu.

You could create an enhancement request for this feature.

Does xfce4-power-manager have some automatic mechanism to inhibit DMPS when playing video? Or does it depend on player?

Both. xfce4-power-manager has a "Presentation Mode" that does just that. Also, any app can inhibit power management via above. Some already do - I believe vlc has an option. xfce4-power-manager also has a hidden heartbeat-command setting. Its not well documented but discussed here.

Can xfce4-power-manager inhibit XScreenSaver, too?

I'm not sure, its been a while since I've used xscreensaver. You could use the heartbeat-command from above.

Personally, I just enable Presentation Mode when I need to prevent the screensaver/power saving features. I have it bound to a keyboard shortcut to toggle it on/off and it displays an icon in the panel when it is enabled.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2021-05-15 21:40:07

jarnos
Member
From: Finland
Registered: 2009-03-22
Posts: 50
Website

Re: Screensaver and power management inhibition mechanism

Oh, how does it display an icon on panel when presentation mode is enabled?

Offline

#6 2021-05-15 21:59:21

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Screensaver and power management inhibition mechanism

Right-click the Power-Manager plugin and select Properties. Make sure that "Show Presentation Mode Indicator is selected. Then use this command to toggle its state (you can bind it to a keyboard shortcut):

xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T

Looks like this (orange icon next to battery):
pm.png


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2021-05-16 10:05:17

jarnos
Member
From: Finland
Registered: 2009-03-22
Posts: 50
Website

Re: Screensaver and power management inhibition mechanism

Oh, the Presentation Mode Indicator is available in PM version 1.7.0, but I am using an older one. No wonder I did not find it.

Offline

#8 2021-05-16 13:09:56

jarnos
Member
From: Finland
Registered: 2009-03-22
Posts: 50
Website

Re: Screensaver and power management inhibition mechanism

I wonder which bus and interface video players use when they want to inhibit? I did not find  org.freedesktop.ScreenSaver using d-feet. They might not know anything about Xfce.

EDIT: there is summary on how some current audio/video players and such do inhibition and how current XScreenSaver deals with them:
https://github.com/Zygo/xscreensaver/bl … -systemd.c

Last edited by jarnos (2021-05-16 14:45:02)

Offline

#9 2021-05-16 15:28:02

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Screensaver and power management inhibition mechanism

jarnos wrote:

EDIT: there is summary on how some current audio/video players and such do inhibition and how current XScreenSaver deals with them:
https://github.com/Zygo/xscreensaver/bl … -systemd.c

That's a good link to describe the complexities around the issue.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB