LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How to disable xscreensaver while MPlayer is running? (https://www.linuxquestions.org/questions/slackware-14/how-to-disable-xscreensaver-while-mplayer-is-running-701384/)

sljunkie 06-30-2010 04:41 PM

The "heartbeat-cmd" option solves the problem, but the "xscreensaver-command -deactivate" command may be a little slow and prejudice mplayer performance:
Code:

$time xscreensaver-command -deactivate
xscreensaver-command: not active: idle timer reset.


real        0m1.035s
user        0m0.002s
sys        0m0.003s

If so, try niceing the program:
Code:

heartbeat-cmd = "nice xscreensaver-command -deactivate >& /dev/null"
The signal is still sent to xscreensaver, but it doesn't get in the way.

kayasaman 08-02-2011 03:06 PM

I know this is an old thread but I just wanted to say thanks for the information as was just looking for a fix as Xine isn't working currently on my Fedora 15 setup so having to default back to mplayer (which is not my first choice).

Quote:

Though the thread's rather old, hope this will be useful for someone.

The problem can be solved by adding this to ~/.mplayer/config
Quote:
heartbeat-cmd="xscreensaver-command -deactivate"
(from mplayer man page)
This did the trick; although maybe inclinded to checkout making the program nice

Quote:

If so, try niceing the program:
Code:

heartbeat-cmd = "nice xscreensaver-command -deactivate >& /dev/null"

The signal is still sent to xscreensaver, but it doesn't get in the way.
I don't get the performance deficite as in what actually degrades but will keep the latter in mind perhaps as comment within the mplayer/config file.

ROXR 08-02-2011 04:05 PM

For disable kernel screensaver I used this order

Code:

$ setterm -powersave off -blank 0

kayasaman 08-02-2011 04:23 PM

Quote:

For disable kernel screensaver I used this order

Code:

$ setterm -powersave off -blank 0

Isn't it just better to let mplayer do it as per the OP's request?


I mean I set my screensaver for 15 minutes turn black then off after another 15.

Of course this is during normal run, however, when playing vidoes I want it to be disabled but since I am lazy to run Mplayer from the CLI as my video+directory names can be quite long; I prefer to have mplayer turn the screensaver off for me when run from Thunar (XFCE file manager).

This is actually per the original intent of this thread which is what I also was after :)

ReaperX7 08-02-2011 09:03 PM

If you use the GUI there is an option to disable xscreensaver. Not sure if this helps but that's all I can offer.

bnguyen 08-03-2011 12:21 AM

Quote:

Originally Posted by ReaperX7 (Post 4432168)
If you use the GUI there is an option to disable xscreensaver. Not sure if this helps but that's all I can offer.

The difference is doing that will completely disable xscreensaver while the OP only wants it to be disables while MPlayer is running.

Quote:

heartbeat-cmd = "nice xscreensaver-command -deactivate >& /dev/null"
Should it be: heartbeat-cmd = "nice xscreensaver-command -deactivate & >/dev/null" ?

ponce 08-03-2011 01:04 AM

personally I use this is my .bashrc
Code:

#mplayer wrapper to turn off the screensaver and DPMS
#requires xset
function mplayerwrap {
        xscreensaver-command -exit
        xset -dpms
        mplayer "$@"
        xset +dpms
        xscreensaver &
}
#make wrapper execute by default
alias mplayer="mplayerwrap"

slightly modified from gentoo's hints.

bnguyen 08-03-2011 06:56 AM

I use a simpler solution: use xdotool to emulate pressing ctrl key every 30 seconds. This has almost no impact on Mplayer performance as opposed to "xscreensaver-command -deactivate" method.

Put this to ~/.mplayer/config (requires xdotool installed):
heartbeat-cmd="xdotool key ctrl"

kayasaman 08-03-2011 07:05 AM

Quote:

I use a simpler solution: use xdotool to emulate pressing ctrl key every 30 seconds. This has almost no impact on Mplayer performance as opposed to "xscreensaver-command -deactivate" method.

Put this to ~/.mplayer/config (requires xdotool installed):
heartbeat-cmd="xdotool key ctrl"
When you say 'Mplayer performace' what exactly are you referring to?

I have been using the command I posted above since my last post (yesterday) but haven't noticed anything on straight playback of video files even HD ones or any CPU overhead.

I know am using a different distro to Slackware as mine is Fedora 15, and I also understand that am in the Slackware path of the forums but still..... my initial post did apply and was a thankyou note rather then: "this aint workin' on my distro" note.

bnguyen 08-03-2011 09:08 AM

Quote:

Originally Posted by kayasaman (Post 4432549)
When you say 'Mplayer performace' what exactly are you referring to?

In my case, I had a very noticeable freeze every 30 seconds using "xscreensaver-command -deactivate"

kayasaman 08-03-2011 09:14 AM

Ah ok.

Thanks for that.

I haven't noticed anything like that but then I've activated H/W acceleration on my system so mplayer is using very little CPU.

The majority of the processing gets done on the GPU itself.

tramni1980 09-25-2012 01:20 AM

The only thing that worked for me (Slackware13.37, KDE) was adding:
Code:

heartbeat-cmd="qdbus org.freedesktop.ScreenSaver  /ScreenSaver SimulateUserActivity"
to ~/.mplayer/config.


All times are GMT -5. The time now is 02:22 AM.