View previous topic :: View next topic |
Author |
Message |
catkfr Guru
Joined: 02 Aug 2004 Posts: 300
|
Posted: Sun Feb 17, 2008 7:11 pm Post subject: [Tip] disabling gnome-screensaver when using mplayer |
|
|
Edit: Changes were made in mplayer and a new way of doing this can be found 2 posts down.
----
I've watched movies using players based on mplayer and have gnome-screensaver launch. Doing some searching, bugs have been filed both to the mplayer guys and the gnome-screensaver guys and both are saying the other should fix it. Gentoo devs point upstream as well.
My workaround is a script that I launch through gnome-session and it does the job just fine!
Code: | #!/bin/sh
PIDGS=`pgrep gnome-session`
while [ $PIDGS -eq `pgrep gnome-session` ]
do
if pgrep mplayer &>/dev/null; then
gnome-screensaver-command -p
fi
# Modify sleep time (in seconds) as needed below
sleep 60
done
|
Of course, this works for mplayer (and mplayer based players who launch an mplayer process), but it can be adapted to other programs as well...
I have no bash scripting experience, so feel free to tell me if there are better ways to write this.
Hope this will help some.
Catkfr
Last edited by catkfr on Fri Apr 04, 2008 2:38 pm; edited 1 time in total |
|
Back to top |
|
|
ceric35 Tux's lil' helper
Joined: 27 Aug 2006 Posts: 115
|
Posted: Sun Mar 09, 2008 4:20 pm Post subject: |
|
|
Also work for me |
|
Back to top |
|
|
catkfr Guru
Joined: 02 Aug 2004 Posts: 300
|
Posted: Fri Apr 04, 2008 2:36 pm Post subject: |
|
|
Apparently, starting with version mplayer-1.0_rc2_p25993 (source: http://www.gossamer-threads.com/lists/mythtv/users/327503?page=last), there was a change in mplayer to stick to screensaver X11 standards. This doesn't change anything for gnome-screensaver for the moment as they do not support but they have added a new functionality which makes this script less interesting.
So, the current best workaround is editing your ~/.mplayer/config file to contain the heartbeat command. I've added the xscreensaver command that was in the url given above but haven't tested it myself.
Code: | [default]
# Write your default config options here!
#stop-xscreensaver=1 # no longer works
#
# for gnome-screensaver:
heartbeat-cmd="/usr/bin/gnome-screensaver-command -p > /dev/null"
#
# for xscreensaver:
#heartbeat-cmd="/usr/bin/xscreensaver-command -deactivate > /dev/null"
|
This should work with all mplayer based applications and allows the screensaver to run when in pause.
Tested with mplayer version 1.0_rc2_p26300-r1 in gnome-2.22 |
|
Back to top |
|
|
dragon6621 n00b
Joined: 23 May 2008 Posts: 3
|
Posted: Sun Aug 10, 2008 8:18 am Post subject: Re: Disable gnome-screensaver while mplayer is playing a vid |
|
|
I think this should work:
Code: | mplayer −heartbeat−cmd "gnome−screensaver−command −p" your_video.avi |
|
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Sun Aug 10, 2008 9:34 am Post subject: |
|
|
Merged the above post from another topic. |
|
Back to top |
|
|
|