You are not logged in.
I want to do this primary so I can have a video play and when it's done immediately turn the monitor off. I'll often go to sleep watching something and it's annoying if the monitor stays on lighting up the room yunno. Figured the easiest solution would just be to use mplayer since it exits once the video is over and just have the next command run. If there's not is there any other way to accomplish this?
Last edited by kryptobs2000 (2010-08-12 03:42:32)
Offline
Seems like mplayer would be the way to go for the reason you mentioned.
If you want to set the monitor to powersave mode, try something like
mplayer YourMovie.avi; xset dpms force off
Last edited by alexandrite (2010-08-12 03:50:11)
Offline
Hey,
first of all i second
xset dpms force off
but i also watch often movies to go to sleep, and for that, i've written a small python script:
#!/usr/bin/env python
import subprocess
import time
import sys
current_percent = 100
sleep_time = (int(sys.argv[1]) * 60) /100.0
while current_percent > 0:
vol_str = "%s%%" % current_percent
subprocess.Popen(['amixer','set', '"Master Front"', vol_str]).communicate()
print "set volume to %s" % vol_str
time.sleep(sleep_time)
current_percent -= 1
subprocess.Popen(['xset','dpms','force','off'])
It takes a time in minutes as parameter and it turns the volume down from 100% to 0% within this time and after that turns the monitor into powersave mode.
Maybe you have to adjust 'Master Front' to your main channel.
Offline
Hey,
first of all i second
xset dpms force off
but i also watch often movies to go to sleep, and for that, i've written a small python script:
#!/usr/bin/env python import subprocess import time import sys current_percent = 100 sleep_time = (int(sys.argv[1]) * 60) /100.0 while current_percent > 0: vol_str = "%s%%" % current_percent subprocess.Popen(['amixer','set', '"Master Front"', vol_str]).communicate() print "set volume to %s" % vol_str time.sleep(sleep_time) current_percent -= 1 subprocess.Popen(['xset','dpms','force','off'])
It takes a time in minutes as parameter and it turns the volume down from 100% to 0% within this time and after that turns the monitor into powersave mode.
Maybe you have to adjust 'Master Front' to your main channel.
Fancy
Last edited by alexandrite (2010-08-12 05:46:03)
Offline