Solved XFCE4 + Mplayer : how to ALLOW screensaver ?

Hi there !
I don't know if it's the good forum section... Very small question : I'm running mplayer at login from a single line script to run a CCTV into XFCE4. Works great, but it disables xfce4-screensaver and I'd like to get it running even with that Mplayer window. The screensaver does turn on fine if I close the stream.

I found some content on the Web, but only for people trying to get rid of the screensaver, but not the opposite. The commands to forcethe screensaver to turn OFF are :
xscreensaver-inhibit on -stop-xscreensaver

I've been trying to play with these and find a "reverted" -stop-screensaver option but no luck. I also tried to globally disable the screensaver drop in Mplayer options, but it works as expected : the screensaver does not turn on.

Does anyone has an idea on how to do this ?
Thank you :)

EDIT : problem solved, check laufdi message. Thanks !
:)
 
Last edited:
Do you need "screen saver" or just "want the monitor to blank".
If the latter, I just use "xset dpms 0 0 600" to turn the monitor off after 10 minutes of inactivity. Inactivity is mostly defined as keyboard/mouse inputs.
Things stay running, move the mouse or hit a key wakes the monitor up.

The only advantage of screensaver is it can be configured to force you to log back in; if you don't need that, try the xset dpms trick.
 
Thanks very much ! That's a nice idea, and I don't need at all to login after.
So I tested (10 seconds) and... hmm, it works, but when Mplayer is closed. If my script runs, it does not turn off the screen. Just like the screensaver behavior...
The best would to be to pass a command, on mplayer, to allow the screensaver.

I tested a sample video directly from mplayer and same result : mplayer disables the screensaver, even if I have unticked "Turn off XScreenSaver" from Mplayer's Misc options. I tick/untick, looks to work, the monitor turns off during the video.

But if I try from command line... No luck ! mplayer does block the screensaver.
 
xset command is talking directly to the X server, if you have a screensaver running you may want to stop it first. Not sure if they interact but it would let you eliminate that.
Are you running regular "Xorg" or are you running Wayland?

What I would try as a test:
Code:
make sure no screensavers are  running
Start mplayer
in a different command window, type in
  xset dpms force off
and see what happens. It should force the monitor off. Don't move the mouse or select another window; if the screen goes blank, give a few moments (seconds, minutes) then xset dpms on to get the screen back.

The man page for mplayer (man mplayer) looks like it has a few examples of stopping the screensaver.

I've always disabled screensavers and just the the xset dpms command in my .xinitrc, easier and I don't care about things flying around the screen when I'm not there.
 
You want the screensaver to continue? So you want -nostop-xscreensaver
Code:
> man mplayer
       -(no)stop-xscreensaver (X11 only)
              Turns off xscreensaver at startup and turns it on again on exit
              (default: enabled).  If your screensaver supports neither the
              XSS nor XResetScreenSaver API please use -heartbeat-cmd instead.

the same for
Code:
> man mpv
   Disabling Screensaver
       By default, mpv tries to disable the OS screensaver during playback
       (only if a VO using the OS GUI API is active). --stop-screensaver=no
       disables this.

works for me (with xfce4)
 
I just double checked on my setup. I have no screensavers running, made sure no aliases for mplayer.
In one window I did "mplayer video.mp4", waited for it to start playing.
In another window I did "xset dpms force off && sleep 15 && xset dpms force on"

Screen went blank, stayed off for 15 secs, then came back on. Video also has audio so I could hear it playing when the screen was off.

So in theory, it should also work under XFCE.
 
Ah !! laufdi found it !! It does work as expected, I added the -nostop-xscreensaver paramater to my screen and it does work as expected (afer 1 minute, the screensaver turns on). Too bad I couldn't find it in any documentation.

Thanks a lot mer , your options were promising but it is much easier to use that single parameter (by the way, when I'm running Xorg) - but I do keep your commands for other scripts I have, it will be very useful :) :)

Thank you both, problem solved !
 
Back
Top