You are not logged in.
Hello everyone,
from quite some time i got this kind of problem that when i watch movie with VLC or Totem on Openbox my Monitors goes blank every 10 minutes.
Triyed a lot of google-ing bbs.archlinux.org search and frankly i did not see any salvation
.
So i try to solve this "Ugly" way and i want to share it with those who need it (i realy hope i m not alone here and i did not miss somewhere some better idea Oo)
1st - create script file (aka. ~/player.sh)
> #!/bin/sh
#ugly way to prevent DMPS , maybe i ll try pidof instead of ps aux , but i m too lazy atm ;)
SERVICE1='vlc'
SERVICE2='totem'
if pgrep $SERVICE1 > /dev/null
then
xset -dpms
elif pgrep $SERVICE2 > /dev/null
then
xset -dpms
else
xset +dpms
ficorrected as karol suggest
2nd - put it in :
2.1 - conky (recomended)
${execi 300 ~/player.sh}2.2 - crontab (not recomended if u ask me) see here
downsides are - its ugly and it wont let dpms works until u close player .
Hope it will help someone, and best wishes ![]()
Last edited by cybertorture (2011-07-19 18:08:07)
O' rly ? Ya rly Oo
Offline
IIRC 'ps ax | grep -v grep | grep foo' is equivalent to 'pgrep foo'.
Offline
Thanks a lot karol
O' rly ? Ya rly Oo
Offline
totem relies on gnome-session to inhibit the monitor and screensaver. no wonder it doesn't work out of his environment. in the end is a gnome application.
Give what you have. To someone, it may be better than you dare to think.
Offline
True, i can understand totem, but its a real shame for vlc. I can confirm that vlc works same way in Freebsd 8.2 with hal support etc..
O' rly ? Ya rly Oo
Offline
I do it with this running in the background:
#!/bin/bash
# Stop xscreensaver from starting and monitor from blanking
# if one or more defined processes are running
#
# Last edited: 27-Jun-10
for instance in $(pidof -x -o %PPID $(basename $0)); do
if [ -n "$(ps -p $instance -o user | grep $USER)" ]; then
echo $(basename $0)": Killing now defunct instance (pid $instance)"
kill $instance
fi
done
# Disable screensaver etc. when any of the following processes are running
process_list="firefox-bin,mplayer,vdr-sxfe,vlc,xine"
# Get current DPMS state (enabled/disabled) as default
dpms_default=$(xset q | grep "DPMS is" | cut -d" " -f5)
while [ true ]; do
sleep 60
dpms_state=$(xset q | grep "DPMS is" | cut -d" " -f5)
if [ -n "$(ps -o pid --no-headers -C ${process_list})" ]; then
if [ -n "$(pidof "xscreensaver")" ]; then
xscreensaver-command -deactivate &> /dev/null
fi
if [ "${dpms_state}" = "Enabled" ]; then
xset -dpms
fi
elif [ "${dpms_state}" = "Disabled" ] && [ "${dpms_default}" = "Enabled" ]; then
xset +dpms
fi
doneOffline
@azleifel
This looks prommising, i can say way better than mine ![]()
Thanks ![]()
O' rly ? Ya rly Oo
Offline