You are not logged in.
I am using Awesome and when I run VLC my screen shuts off after 10 minutes. I know it's because of my xorg,
Section "ServerFlags"
Option "DefaultServerLayout" "Layout0"
Option "BlankTime" "5"
Option "StandbyTime" "10"
Option "OffTime" "15"
EndSection
My question is, how can I disable it when VLC is full screen (or running at all?). It didn't give me any problems when I had a DE, but now I don't. I assume it must be something with Awesome. Is there anything I can do?
I have checked the option in VLC to disable hibernation and everything, but that doesn't do anything.
Offline
Try running caffeine:
http://aur.archlinux.org/packages.php?ID=29762
You can even configure it to run when you start vlc.
Offline
How do you do that?
I have dug up this, but how do you use it and how does that work ?
#!/bin/bash
PID=$(pgrep caffeine)
if [ -z "$PID" ]; then
caffeine -a &>/dev/null &
PID=$!
fi
/usr/bin/vlc "$@"
kill $PID
Offline
Personally I just run caffeine and use its tray icon to control/config it.
Offline
$ caffeine
** Message: pygobject_register_sinkfunc is deprecated (GtkWindow)
** Message: pygobject_register_sinkfunc is deprecated (GtkInvisible)
** Message: pygobject_register_sinkfunc is deprecated (GtkObject)
Traceback (most recent call last):
File "/usr/bin/caffeine", line 38, in <module>
import caffeine
File "/usr/lib/python2.6/site-packages/caffeine/__init__.py", line 171, in <module>
from caffeine.main import main
File "/usr/lib/python2.6/site-packages/caffeine/main.py", line 46, in <module>
generic = icon_theme.load_icon("application-x-executable", 16, gtk.ICON_LOOKUP_NO_SVG)
glib.GError: Icon 'application-x-executable' not present in theme
edit:
There are a butt load of dependencies and what not for caffeine, including fam, hal etc. I don't use hal. I don't use fam or gamin. Hmmmm
Last edited by Google (2010-07-03 14:40:09)
Offline
http://wiki.archlinux.org/index.php/DPM … s_damir.29
Now I will try to find how to execute this at VLC launch
Edit :
[Deprecated]
# nano /usr/bin/vlc-dpms
#!/bin/sh
/usr/bin/xset -dpms &
/usr/bin/vlc $1
# chmod 777 /usr/bin/vlc-dpms
vlc-dpms
Now You have to find how to do" xset dpms" when you turn off VLC.
Last edited by ApotheoZ (2010-07-03 14:52:22)
Offline
So we need to execute 'xset -dpms' before launching VLC and then turn dpms back on when VLC closes? Sounds like a bash script to me:
I am a newbie, but won't this turn off dpms when VLC is running?
#!/bin/bash
PID=$(pgrep vlc)
if [ -z "$PID" ]; then
xset -dpms
PID=$!
fi
Last edited by Google (2010-07-03 14:54:27)
Offline
I dont know anything about bash, but the script i gave you works.
If you prefer, you can make it in your home and make an alias to run this script.
But you still have the problem to turn on dpms when VLC stop
Offline
I have made two scripts. One you posted for turning off dpms and one for turning it back on. I just need to figure out how to launch the turn on script when the VLC process is killed. I guess I can wait until someone has a solution T___T
Thanks!
Offline
You can make one script which runs vlc, and then runs the script to turn on dpms. For example:
#!/bin/bash
# run the real vlc with all arguments passed to this script
/usr/bin/vlc "$@"
# Then once it has quit, turn on dpms
/path/to/turn/on/dpms
With this you can even name it vlc and it will work as a drop in replacement. If you already are using a script to turn off dpms when vlc starts in this manner, just add the line to run the turn-on script at the end.
I think you had the right idea with your scripts, but it would just be easier to have one script to turn it off, run vlc, and turn it back on. Otherwise you manually run one script whenever you run vlc to turn dpms off. Then you also have to manually run the turn on script once your done.
Last edited by jac (2010-07-03 16:01:43)
Offline
You mean "/path/to/turn/on/dpms" will not be execute as soon as vlc has started ?
Because if it's the case, Google you have here a solved problem .
Offline
Correct, since you do not background the vlc process (using & at the end) it will stop right there until vlc exits.
Something I just noticed about the script in post #7 is the fact that it turns off dpms if vlc is NOT running, that is when the PID of vlc is zero.
Offline
So here is your final script :
#!/bin/sh
/usr/bin/xset -dpms &
/usr/bin/vlc $1
/usr/bin/xset dpms
@jac : why do you use $@ instead of $1 (in the way I don't know what is $@ )
Offline
I ran the script directly but the screen is still turning off
I am clueless
Offline
@ApotheoZ: $1 is the first argument to the script only, $@ expands to all arguments to the script. For instance, if you tried to pass any switches to vlc with your example, it would only get the first thing (probably a switch). With $@ it gets the switches and all.
@Google: Maybe try turning off dpms with xset, to see if that actually works?
Also, Looking at the man page, maybe you should use
#!/bin/sh
xset dpms 0 0 0
# we only need the full path here in order to avoid an infinite loop in case this script is named vlc
/usr/bin/vlc $1
xset +dpms
I'm uncertain whether or not "xset +dpms" returns the times to default or not...
Last edited by jac (2010-07-03 17:16:22)
Offline
I just gave it a shot and my screen still shut off. It's being really stubborn. Could it be because I am also using blanktime? I don't see blank time anywhere in there, only standby, offtime and suspend.
Offline
It could be, I really don't know anything about this. I see your blank time is set to 5 minutes, so does it go off after 5 minutes? I'd say if it does then blank time is to blame.
Flipping through the man page for xset, I see that the screensaver has the word "blank" in it, so you could also try using "xset s off" before you start vlc, to see if it is a screensaver activating and not dpms.
Does your monitor actually turn off, or does it just go black? My monitor can be on (viewing something), blank but on, and off. I'm not sure exactly how those correspond to the three values in the dpms setting, but it might help determine if it actually is dpms and not something like a screensaver.
Offline
# Disable screen blanking
xset s noblank
xset s noexpose
xset s off -dpms
Let us know how it goes.
You need to install an RTFM interface.
Offline
# Disable screen blanking
xset s noblank
xset s noexpose
xset s off -dpmsLet us know how it goes.
I did a lot of testing and this script seems to do the trick for me:
#!/bin/sh
#Script to turn off monitor modes that will power down, standby or blank the screen
#
#Disable modes
/usr/bin/xset -dpms &
/usr/bin/xset s off &
#Open VLC
/usr/bin/vlc $1
#Re-enable modes
/usr/bin/xset dpms
/usr/bin/xset s on
I wrote an alias in .bashrc, "alias vlc='vlc.sh' and it works when I call vlc from the command line. The only problem is my file manager. I am using Ranger, and in apps.py I coded it to open movie extensions with 'vlc' and it does, but it doesn't seem to use the 'vlc' from .bashrc, because the screen shuts off when I open movies from Ranger.
I am using this is Ranger:
if f.extension in (c, 'tp', 'wav', 'asf', 'vob', 'ts', 'mpg', 'mpeg', 'mp3', 'flv', 'wmv'):
return self.either(c, 'vlc')
Any ideas why Ranger isn't working?
Offline
I'm guessing that Ranger is still running the actual vlc. I'm going to take a stab at it and say that you could either change that line to be
if f.extension in (c, 'tp', 'wav', 'asf', 'vob', 'ts', 'mpg', 'mpeg', 'mp3', 'flv', 'wmv'):
return self.either(c, 'vlc.sh')
Or, rename vlc.sh to just vlc and make sure it's in your path (the directory it's in must also be before the /usr/bin directory, so that it will take precedence). If it is, anything trying to execute vlc from your user should execute the script without needing any aliases or other work-arounds.
Last edited by jac (2010-07-04 11:36:25)
Offline
hi I addressed some issues and some unique to me.
1) check if you are loading VLC or a file with VLC (so launch VLC or VLC $1)
2) make the $1 work with spaces in the file name "$1")
3) check if you have alternate sound devices available
This may or may not be useful but I post anyway in case it is...
#!/bin/bash
function askuser {
#ask user
ans=$(zenity --width="210" --height="190" --title="VLC" --text="Standard or USB sound output?:" --list --radiolist --column "" --column "" FALSE Standard TRUE USB); echo $ans
# cases for user to select
case $ans in
Standard)
# use VLC with speakers
cp ~/mybin/vlc-speakers ~/.config/vlc/vlcrc;
;;
USB)
# use VLC with headphones
cp ~/mybin/vlc-headphones ~/.config/vlc/vlcrc;
;;
esac
}
#
if [ -a /dev/audio1 ]
then
askuser
else
echo "skipping usb question"
fi
#Turn off monitor modes that will power down, standby or blank the screen
#Disable modes
/usr/bin/xset -dpms &
/usr/bin/xset s off &
#Open VLC
if [ -n "$1" ]
then
/usr/bin/vlc "$1"
else
/usr/bin/vlc
fi
#Re-enable modes
/usr/bin/xset dpms
/usr/bin/xset s on
exit
EDIT: oops left some comments in that shouldn't be there
Last edited by tawan (2010-07-10 03:14:15)
Offline
Thanks, everything is working well. I have one more problem but the problem is in Ranger file manager. The script is working nicely, but for some reason it's not reading filenames with spaces in it.
Offline
i was having the same issues but with openbox.
disabling x screensaver and dpms worked.
on further investigation i didnt have a problem with smplayer
there seems to be a bug in the latest vlc causing this: http://forum.videolan.org/viewtopic.php?f=13&t=78698
Offline
I had the same problem too, but now, I have understand it.
In VLC preferences, showing all, in advanced settings there is a checkbox about the power management daemon. When checked, VLC disable DPMS.
You can see it by playing a video and run
xset q|grep DPMS
wich should show
DPMS is Disabled
.Then stop the video and the same command should output
DPMS is Enabled
BUT, VLC seems not to disable screensaver. You can see if screensaver is running with
xset q|grep -A 2 Screen
. If timeout is non-null, then screensaver/blank screen is enabled.
So you must run
xset s off
before running VLC. And if you want to enabled screensaver again
xset s on
which restore default blanking time.
In fact, I think screensaver is redundant with DPMS (and makes trouble with web browser too); so I disable it in xinitrc (but still have power saving with DPMS).
PS: I don't know how, but MPlayer (with --stop-xscreensaver) manage all of this very well...
Offline