Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Tip] disabling gnome-screensaver when using mplayer
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
catkfr
Guru
Guru


Joined: 02 Aug 2004
Posts: 300

PostPosted: Sun Feb 17, 2008 7:11 pm    Post subject: [Tip] disabling gnome-screensaver when using mplayer Reply with quote

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
View user's profile Send private message
ceric35
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2006
Posts: 103

PostPosted: Sun Mar 09, 2008 4:20 pm    Post subject: Reply with quote

Also work for me :wink:
Back to top
View user's profile Send private message
catkfr
Guru
Guru


Joined: 02 Aug 2004
Posts: 300

PostPosted: Fri Apr 04, 2008 2:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
dragon6621
n00b
n00b


Joined: 23 May 2008
Posts: 3

PostPosted: Sun Aug 10, 2008 8:18 am    Post subject: Re: Disable gnome-screensaver while mplayer is playing a vid Reply with quote

I think this should work:

Code:
mplayer −heartbeat−cmd "gnome−screensaver−command −p" your_video.avi
Back to top
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 8224

PostPosted: Sun Aug 10, 2008 9:34 am    Post subject: Reply with quote

Merged the above post from another topic.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum