Tell mplayer to prevent the screensaver from kicking in while playing
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I know mplayer has some heartbeat setting but I don't recall what it is, could anyone tell me?
another one of those annoying things that used to just work and somewhere along the line stopped being default
mplayer screensaver
add a comment |
up vote
1
down vote
favorite
I know mplayer has some heartbeat setting but I don't recall what it is, could anyone tell me?
another one of those annoying things that used to just work and somewhere along the line stopped being default
mplayer screensaver
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I know mplayer has some heartbeat setting but I don't recall what it is, could anyone tell me?
another one of those annoying things that used to just work and somewhere along the line stopped being default
mplayer screensaver
I know mplayer has some heartbeat setting but I don't recall what it is, could anyone tell me?
another one of those annoying things that used to just work and somewhere along the line stopped being default
mplayer screensaver
mplayer screensaver
asked Aug 28 '10 at 14:01
xenoterracide
25.2k52157221
25.2k52157221
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
4
down vote
accepted
mplayer
has the switch -heartbeat-cmd
to run a command every 30 seconds, but as the man page says:
This can be "misused" to disable screensavers that do not support the proper X API
The actual switch meant to disable screensavers is -stop-xscreensaver
; you should probably try that first
I put-stop-xscreensaver
in~/.mplayer/config
when trying to play a video I got this error:Option -stop-xscreensaver needs a parameter at line 2
ideas?
– xenoterracide
Aug 28 '10 at 15:47
3
@xeno Every option in the config file needs to have a value; if it's just a boolean flag, set it equal totrue
,yes
, or1
. You also shouldn't include the-
when you're using the config file, so you'll get a warning about an unknown option (it sees your entry for-stop-xscreensaver
and looks for the flag--stop-xscreensaver
); it should readstop-xscreensaver=true
instead
– Michael Mrozek♦
Aug 28 '10 at 18:03
now if only I could do the same thing with flash/<video>
– xenoterracide
Aug 29 '10 at 14:12
1
@xenoterracide you can use mplayer to watch flash videos, load the video, look in /tmp and play the video with mplayer :P
– hiena
Aug 30 '10 at 12:56
add a comment |
up vote
0
down vote
For me it's --stop-screensaver
When using --stop-xscreensaver the mplayer warns me: option --stop-xscreensaver was replaced with --stop-screensaver and might be removed in the future.
Debian & mpv 0.23.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
Are you quoting from somewhere? If so, please identify the source. Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 24 at 21:21
add a comment |
up vote
0
down vote
mplayer -stop-xscreensaver
does not work for me (Debian wheezy; xscreensaver=5.15-3, xfce4=4.8.0.3, mplayer=2:1.0~rc4.dfsg1+svn34540-1+b2) - the screensaver still comes on during the movie. I wrote a screensaver inhibition tool xscreensaver-inhibit
, and an mplayer wrapper play
. xscreensaver-inhibit
is useful for other things like youtube so I put a shortcut on my panel for it.
$HOME/bin/xscreensaver-inhibit
is as follows:
#!/bin/bash
usage ()
echo "usage: $0 [on
if [ -n "$1" ] ; then
[ "$1" = "on" -o "$1" = "off" ] || usage
fi
inhibit ()
while [ -f "$lock" ] ; do
# echo "$lock exists"
# UPDATE Dec 2018 this command seems to have stopped working after upgrading to Debian Stretch.
# DISPLAY=:0 xdg-screensaver reset
# Replaced with this command which is working for me,
# though if you do not use xscreensaver you might need something else.
DISPLAY=:0 xscreensaver-command -deactivate
sleep 50
done
# echo "$lock is gone"
lock="/tmp/xsi.lock"
if [ -e "$lock" ] ; then
echo 'Screensaver currently inhibited.'
on='on'
else
echo 'Screensaver operating normally.'
on=''
fi
if [ "$1" = "on" ] ; then
if [ -n "$on" ] ; then
echo 'Starting screensaver inhibitor anyway.'
else
echo 'Screensaver inhibitor started.'
fi
touch "$lock" && inhibit &
fi
if [ "$1" = "off" ] ; then
if [ -n "$on" ] ; then
echo 'Screensaver inhibitor(s) stopped.'
else
echo 'Perhaps the screensaver daemon is not running or another program is inhibiting it.'
fi
rm -f "$lock"
fi
if [ ! -n "$1" ] ; then
if [ -n "$on" ] ; then
echo 'Screensaver inhibitor(s) stopped.'
rm -f "$lock"
else
echo 'Screensaver inhibitor started.'
touch "$lock" && inhibit &
fi
fi
$HOME/bin/play
is as follows:
#!/bin/sh
xscreensaver-inhibit on
DISPLAY=:0 mplayer -fs "$@"
xscreensaver-inhibit off
I included DISPLAY=:0
so the movie will play on the local active display even when I am logged in over SSH. play
is also the default handler for all movie files in my file manager.
Note that sox
provides /usr/bin/play
so if you have sox
installed, you might want to call play
something else.
You can write similar wrappers for your other fullscreen apps that you don't want the screensaver interrupting.
xscreensaver-inhibit
works on all DEs, Linuxes, and screensavers on which I have tried it. In case you get xdg-screensaver: command not found
, run apt-get install xdg-utils
.
UPDATE Dec 2018 changed main command in xscreensaver-inhibit
from xdg-screensaver
to xscreensaver-command
- NOT tested on all DEs, Linuxes, screensavers. YMMV
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
mplayer
has the switch -heartbeat-cmd
to run a command every 30 seconds, but as the man page says:
This can be "misused" to disable screensavers that do not support the proper X API
The actual switch meant to disable screensavers is -stop-xscreensaver
; you should probably try that first
I put-stop-xscreensaver
in~/.mplayer/config
when trying to play a video I got this error:Option -stop-xscreensaver needs a parameter at line 2
ideas?
– xenoterracide
Aug 28 '10 at 15:47
3
@xeno Every option in the config file needs to have a value; if it's just a boolean flag, set it equal totrue
,yes
, or1
. You also shouldn't include the-
when you're using the config file, so you'll get a warning about an unknown option (it sees your entry for-stop-xscreensaver
and looks for the flag--stop-xscreensaver
); it should readstop-xscreensaver=true
instead
– Michael Mrozek♦
Aug 28 '10 at 18:03
now if only I could do the same thing with flash/<video>
– xenoterracide
Aug 29 '10 at 14:12
1
@xenoterracide you can use mplayer to watch flash videos, load the video, look in /tmp and play the video with mplayer :P
– hiena
Aug 30 '10 at 12:56
add a comment |
up vote
4
down vote
accepted
mplayer
has the switch -heartbeat-cmd
to run a command every 30 seconds, but as the man page says:
This can be "misused" to disable screensavers that do not support the proper X API
The actual switch meant to disable screensavers is -stop-xscreensaver
; you should probably try that first
I put-stop-xscreensaver
in~/.mplayer/config
when trying to play a video I got this error:Option -stop-xscreensaver needs a parameter at line 2
ideas?
– xenoterracide
Aug 28 '10 at 15:47
3
@xeno Every option in the config file needs to have a value; if it's just a boolean flag, set it equal totrue
,yes
, or1
. You also shouldn't include the-
when you're using the config file, so you'll get a warning about an unknown option (it sees your entry for-stop-xscreensaver
and looks for the flag--stop-xscreensaver
); it should readstop-xscreensaver=true
instead
– Michael Mrozek♦
Aug 28 '10 at 18:03
now if only I could do the same thing with flash/<video>
– xenoterracide
Aug 29 '10 at 14:12
1
@xenoterracide you can use mplayer to watch flash videos, load the video, look in /tmp and play the video with mplayer :P
– hiena
Aug 30 '10 at 12:56
add a comment |
up vote
4
down vote
accepted
up vote
4
down vote
accepted
mplayer
has the switch -heartbeat-cmd
to run a command every 30 seconds, but as the man page says:
This can be "misused" to disable screensavers that do not support the proper X API
The actual switch meant to disable screensavers is -stop-xscreensaver
; you should probably try that first
mplayer
has the switch -heartbeat-cmd
to run a command every 30 seconds, but as the man page says:
This can be "misused" to disable screensavers that do not support the proper X API
The actual switch meant to disable screensavers is -stop-xscreensaver
; you should probably try that first
answered Aug 28 '10 at 15:18
Michael Mrozek♦
60k28187208
60k28187208
I put-stop-xscreensaver
in~/.mplayer/config
when trying to play a video I got this error:Option -stop-xscreensaver needs a parameter at line 2
ideas?
– xenoterracide
Aug 28 '10 at 15:47
3
@xeno Every option in the config file needs to have a value; if it's just a boolean flag, set it equal totrue
,yes
, or1
. You also shouldn't include the-
when you're using the config file, so you'll get a warning about an unknown option (it sees your entry for-stop-xscreensaver
and looks for the flag--stop-xscreensaver
); it should readstop-xscreensaver=true
instead
– Michael Mrozek♦
Aug 28 '10 at 18:03
now if only I could do the same thing with flash/<video>
– xenoterracide
Aug 29 '10 at 14:12
1
@xenoterracide you can use mplayer to watch flash videos, load the video, look in /tmp and play the video with mplayer :P
– hiena
Aug 30 '10 at 12:56
add a comment |
I put-stop-xscreensaver
in~/.mplayer/config
when trying to play a video I got this error:Option -stop-xscreensaver needs a parameter at line 2
ideas?
– xenoterracide
Aug 28 '10 at 15:47
3
@xeno Every option in the config file needs to have a value; if it's just a boolean flag, set it equal totrue
,yes
, or1
. You also shouldn't include the-
when you're using the config file, so you'll get a warning about an unknown option (it sees your entry for-stop-xscreensaver
and looks for the flag--stop-xscreensaver
); it should readstop-xscreensaver=true
instead
– Michael Mrozek♦
Aug 28 '10 at 18:03
now if only I could do the same thing with flash/<video>
– xenoterracide
Aug 29 '10 at 14:12
1
@xenoterracide you can use mplayer to watch flash videos, load the video, look in /tmp and play the video with mplayer :P
– hiena
Aug 30 '10 at 12:56
I put
-stop-xscreensaver
in ~/.mplayer/config
when trying to play a video I got this error: Option -stop-xscreensaver needs a parameter at line 2
ideas?– xenoterracide
Aug 28 '10 at 15:47
I put
-stop-xscreensaver
in ~/.mplayer/config
when trying to play a video I got this error: Option -stop-xscreensaver needs a parameter at line 2
ideas?– xenoterracide
Aug 28 '10 at 15:47
3
3
@xeno Every option in the config file needs to have a value; if it's just a boolean flag, set it equal to
true
, yes
, or 1
. You also shouldn't include the -
when you're using the config file, so you'll get a warning about an unknown option (it sees your entry for -stop-xscreensaver
and looks for the flag --stop-xscreensaver
); it should read stop-xscreensaver=true
instead– Michael Mrozek♦
Aug 28 '10 at 18:03
@xeno Every option in the config file needs to have a value; if it's just a boolean flag, set it equal to
true
, yes
, or 1
. You also shouldn't include the -
when you're using the config file, so you'll get a warning about an unknown option (it sees your entry for -stop-xscreensaver
and looks for the flag --stop-xscreensaver
); it should read stop-xscreensaver=true
instead– Michael Mrozek♦
Aug 28 '10 at 18:03
now if only I could do the same thing with flash/<video>
– xenoterracide
Aug 29 '10 at 14:12
now if only I could do the same thing with flash/<video>
– xenoterracide
Aug 29 '10 at 14:12
1
1
@xenoterracide you can use mplayer to watch flash videos, load the video, look in /tmp and play the video with mplayer :P
– hiena
Aug 30 '10 at 12:56
@xenoterracide you can use mplayer to watch flash videos, load the video, look in /tmp and play the video with mplayer :P
– hiena
Aug 30 '10 at 12:56
add a comment |
up vote
0
down vote
For me it's --stop-screensaver
When using --stop-xscreensaver the mplayer warns me: option --stop-xscreensaver was replaced with --stop-screensaver and might be removed in the future.
Debian & mpv 0.23.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
Are you quoting from somewhere? If so, please identify the source. Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 24 at 21:21
add a comment |
up vote
0
down vote
For me it's --stop-screensaver
When using --stop-xscreensaver the mplayer warns me: option --stop-xscreensaver was replaced with --stop-screensaver and might be removed in the future.
Debian & mpv 0.23.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
Are you quoting from somewhere? If so, please identify the source. Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 24 at 21:21
add a comment |
up vote
0
down vote
up vote
0
down vote
For me it's --stop-screensaver
When using --stop-xscreensaver the mplayer warns me: option --stop-xscreensaver was replaced with --stop-screensaver and might be removed in the future.
Debian & mpv 0.23.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
For me it's --stop-screensaver
When using --stop-xscreensaver the mplayer warns me: option --stop-xscreensaver was replaced with --stop-screensaver and might be removed in the future.
Debian & mpv 0.23.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
edited Feb 24 at 21:54
answered Feb 24 at 19:56
premek.v
344
344
Are you quoting from somewhere? If so, please identify the source. Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 24 at 21:21
add a comment |
Are you quoting from somewhere? If so, please identify the source. Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 24 at 21:21
Are you quoting from somewhere? If so, please identify the source. Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 24 at 21:21
Are you quoting from somewhere? If so, please identify the source. Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 24 at 21:21
add a comment |
up vote
0
down vote
mplayer -stop-xscreensaver
does not work for me (Debian wheezy; xscreensaver=5.15-3, xfce4=4.8.0.3, mplayer=2:1.0~rc4.dfsg1+svn34540-1+b2) - the screensaver still comes on during the movie. I wrote a screensaver inhibition tool xscreensaver-inhibit
, and an mplayer wrapper play
. xscreensaver-inhibit
is useful for other things like youtube so I put a shortcut on my panel for it.
$HOME/bin/xscreensaver-inhibit
is as follows:
#!/bin/bash
usage ()
echo "usage: $0 [on
if [ -n "$1" ] ; then
[ "$1" = "on" -o "$1" = "off" ] || usage
fi
inhibit ()
while [ -f "$lock" ] ; do
# echo "$lock exists"
# UPDATE Dec 2018 this command seems to have stopped working after upgrading to Debian Stretch.
# DISPLAY=:0 xdg-screensaver reset
# Replaced with this command which is working for me,
# though if you do not use xscreensaver you might need something else.
DISPLAY=:0 xscreensaver-command -deactivate
sleep 50
done
# echo "$lock is gone"
lock="/tmp/xsi.lock"
if [ -e "$lock" ] ; then
echo 'Screensaver currently inhibited.'
on='on'
else
echo 'Screensaver operating normally.'
on=''
fi
if [ "$1" = "on" ] ; then
if [ -n "$on" ] ; then
echo 'Starting screensaver inhibitor anyway.'
else
echo 'Screensaver inhibitor started.'
fi
touch "$lock" && inhibit &
fi
if [ "$1" = "off" ] ; then
if [ -n "$on" ] ; then
echo 'Screensaver inhibitor(s) stopped.'
else
echo 'Perhaps the screensaver daemon is not running or another program is inhibiting it.'
fi
rm -f "$lock"
fi
if [ ! -n "$1" ] ; then
if [ -n "$on" ] ; then
echo 'Screensaver inhibitor(s) stopped.'
rm -f "$lock"
else
echo 'Screensaver inhibitor started.'
touch "$lock" && inhibit &
fi
fi
$HOME/bin/play
is as follows:
#!/bin/sh
xscreensaver-inhibit on
DISPLAY=:0 mplayer -fs "$@"
xscreensaver-inhibit off
I included DISPLAY=:0
so the movie will play on the local active display even when I am logged in over SSH. play
is also the default handler for all movie files in my file manager.
Note that sox
provides /usr/bin/play
so if you have sox
installed, you might want to call play
something else.
You can write similar wrappers for your other fullscreen apps that you don't want the screensaver interrupting.
xscreensaver-inhibit
works on all DEs, Linuxes, and screensavers on which I have tried it. In case you get xdg-screensaver: command not found
, run apt-get install xdg-utils
.
UPDATE Dec 2018 changed main command in xscreensaver-inhibit
from xdg-screensaver
to xscreensaver-command
- NOT tested on all DEs, Linuxes, screensavers. YMMV
add a comment |
up vote
0
down vote
mplayer -stop-xscreensaver
does not work for me (Debian wheezy; xscreensaver=5.15-3, xfce4=4.8.0.3, mplayer=2:1.0~rc4.dfsg1+svn34540-1+b2) - the screensaver still comes on during the movie. I wrote a screensaver inhibition tool xscreensaver-inhibit
, and an mplayer wrapper play
. xscreensaver-inhibit
is useful for other things like youtube so I put a shortcut on my panel for it.
$HOME/bin/xscreensaver-inhibit
is as follows:
#!/bin/bash
usage ()
echo "usage: $0 [on
if [ -n "$1" ] ; then
[ "$1" = "on" -o "$1" = "off" ] || usage
fi
inhibit ()
while [ -f "$lock" ] ; do
# echo "$lock exists"
# UPDATE Dec 2018 this command seems to have stopped working after upgrading to Debian Stretch.
# DISPLAY=:0 xdg-screensaver reset
# Replaced with this command which is working for me,
# though if you do not use xscreensaver you might need something else.
DISPLAY=:0 xscreensaver-command -deactivate
sleep 50
done
# echo "$lock is gone"
lock="/tmp/xsi.lock"
if [ -e "$lock" ] ; then
echo 'Screensaver currently inhibited.'
on='on'
else
echo 'Screensaver operating normally.'
on=''
fi
if [ "$1" = "on" ] ; then
if [ -n "$on" ] ; then
echo 'Starting screensaver inhibitor anyway.'
else
echo 'Screensaver inhibitor started.'
fi
touch "$lock" && inhibit &
fi
if [ "$1" = "off" ] ; then
if [ -n "$on" ] ; then
echo 'Screensaver inhibitor(s) stopped.'
else
echo 'Perhaps the screensaver daemon is not running or another program is inhibiting it.'
fi
rm -f "$lock"
fi
if [ ! -n "$1" ] ; then
if [ -n "$on" ] ; then
echo 'Screensaver inhibitor(s) stopped.'
rm -f "$lock"
else
echo 'Screensaver inhibitor started.'
touch "$lock" && inhibit &
fi
fi
$HOME/bin/play
is as follows:
#!/bin/sh
xscreensaver-inhibit on
DISPLAY=:0 mplayer -fs "$@"
xscreensaver-inhibit off
I included DISPLAY=:0
so the movie will play on the local active display even when I am logged in over SSH. play
is also the default handler for all movie files in my file manager.
Note that sox
provides /usr/bin/play
so if you have sox
installed, you might want to call play
something else.
You can write similar wrappers for your other fullscreen apps that you don't want the screensaver interrupting.
xscreensaver-inhibit
works on all DEs, Linuxes, and screensavers on which I have tried it. In case you get xdg-screensaver: command not found
, run apt-get install xdg-utils
.
UPDATE Dec 2018 changed main command in xscreensaver-inhibit
from xdg-screensaver
to xscreensaver-command
- NOT tested on all DEs, Linuxes, screensavers. YMMV
add a comment |
up vote
0
down vote
up vote
0
down vote
mplayer -stop-xscreensaver
does not work for me (Debian wheezy; xscreensaver=5.15-3, xfce4=4.8.0.3, mplayer=2:1.0~rc4.dfsg1+svn34540-1+b2) - the screensaver still comes on during the movie. I wrote a screensaver inhibition tool xscreensaver-inhibit
, and an mplayer wrapper play
. xscreensaver-inhibit
is useful for other things like youtube so I put a shortcut on my panel for it.
$HOME/bin/xscreensaver-inhibit
is as follows:
#!/bin/bash
usage ()
echo "usage: $0 [on
if [ -n "$1" ] ; then
[ "$1" = "on" -o "$1" = "off" ] || usage
fi
inhibit ()
while [ -f "$lock" ] ; do
# echo "$lock exists"
# UPDATE Dec 2018 this command seems to have stopped working after upgrading to Debian Stretch.
# DISPLAY=:0 xdg-screensaver reset
# Replaced with this command which is working for me,
# though if you do not use xscreensaver you might need something else.
DISPLAY=:0 xscreensaver-command -deactivate
sleep 50
done
# echo "$lock is gone"
lock="/tmp/xsi.lock"
if [ -e "$lock" ] ; then
echo 'Screensaver currently inhibited.'
on='on'
else
echo 'Screensaver operating normally.'
on=''
fi
if [ "$1" = "on" ] ; then
if [ -n "$on" ] ; then
echo 'Starting screensaver inhibitor anyway.'
else
echo 'Screensaver inhibitor started.'
fi
touch "$lock" && inhibit &
fi
if [ "$1" = "off" ] ; then
if [ -n "$on" ] ; then
echo 'Screensaver inhibitor(s) stopped.'
else
echo 'Perhaps the screensaver daemon is not running or another program is inhibiting it.'
fi
rm -f "$lock"
fi
if [ ! -n "$1" ] ; then
if [ -n "$on" ] ; then
echo 'Screensaver inhibitor(s) stopped.'
rm -f "$lock"
else
echo 'Screensaver inhibitor started.'
touch "$lock" && inhibit &
fi
fi
$HOME/bin/play
is as follows:
#!/bin/sh
xscreensaver-inhibit on
DISPLAY=:0 mplayer -fs "$@"
xscreensaver-inhibit off
I included DISPLAY=:0
so the movie will play on the local active display even when I am logged in over SSH. play
is also the default handler for all movie files in my file manager.
Note that sox
provides /usr/bin/play
so if you have sox
installed, you might want to call play
something else.
You can write similar wrappers for your other fullscreen apps that you don't want the screensaver interrupting.
xscreensaver-inhibit
works on all DEs, Linuxes, and screensavers on which I have tried it. In case you get xdg-screensaver: command not found
, run apt-get install xdg-utils
.
UPDATE Dec 2018 changed main command in xscreensaver-inhibit
from xdg-screensaver
to xscreensaver-command
- NOT tested on all DEs, Linuxes, screensavers. YMMV
mplayer -stop-xscreensaver
does not work for me (Debian wheezy; xscreensaver=5.15-3, xfce4=4.8.0.3, mplayer=2:1.0~rc4.dfsg1+svn34540-1+b2) - the screensaver still comes on during the movie. I wrote a screensaver inhibition tool xscreensaver-inhibit
, and an mplayer wrapper play
. xscreensaver-inhibit
is useful for other things like youtube so I put a shortcut on my panel for it.
$HOME/bin/xscreensaver-inhibit
is as follows:
#!/bin/bash
usage ()
echo "usage: $0 [on
if [ -n "$1" ] ; then
[ "$1" = "on" -o "$1" = "off" ] || usage
fi
inhibit ()
while [ -f "$lock" ] ; do
# echo "$lock exists"
# UPDATE Dec 2018 this command seems to have stopped working after upgrading to Debian Stretch.
# DISPLAY=:0 xdg-screensaver reset
# Replaced with this command which is working for me,
# though if you do not use xscreensaver you might need something else.
DISPLAY=:0 xscreensaver-command -deactivate
sleep 50
done
# echo "$lock is gone"
lock="/tmp/xsi.lock"
if [ -e "$lock" ] ; then
echo 'Screensaver currently inhibited.'
on='on'
else
echo 'Screensaver operating normally.'
on=''
fi
if [ "$1" = "on" ] ; then
if [ -n "$on" ] ; then
echo 'Starting screensaver inhibitor anyway.'
else
echo 'Screensaver inhibitor started.'
fi
touch "$lock" && inhibit &
fi
if [ "$1" = "off" ] ; then
if [ -n "$on" ] ; then
echo 'Screensaver inhibitor(s) stopped.'
else
echo 'Perhaps the screensaver daemon is not running or another program is inhibiting it.'
fi
rm -f "$lock"
fi
if [ ! -n "$1" ] ; then
if [ -n "$on" ] ; then
echo 'Screensaver inhibitor(s) stopped.'
rm -f "$lock"
else
echo 'Screensaver inhibitor started.'
touch "$lock" && inhibit &
fi
fi
$HOME/bin/play
is as follows:
#!/bin/sh
xscreensaver-inhibit on
DISPLAY=:0 mplayer -fs "$@"
xscreensaver-inhibit off
I included DISPLAY=:0
so the movie will play on the local active display even when I am logged in over SSH. play
is also the default handler for all movie files in my file manager.
Note that sox
provides /usr/bin/play
so if you have sox
installed, you might want to call play
something else.
You can write similar wrappers for your other fullscreen apps that you don't want the screensaver interrupting.
xscreensaver-inhibit
works on all DEs, Linuxes, and screensavers on which I have tried it. In case you get xdg-screensaver: command not found
, run apt-get install xdg-utils
.
UPDATE Dec 2018 changed main command in xscreensaver-inhibit
from xdg-screensaver
to xscreensaver-command
- NOT tested on all DEs, Linuxes, screensavers. YMMV
edited Nov 24 at 19:13
answered Jul 23 '14 at 17:38
retrospectacus
1011
1011
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f1337%2ftell-mplayer-to-prevent-the-screensaver-from-kicking-in-while-playing%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown