Ok. Apparently how you call on the screensaver might matter. Could you test
I tested it twice up to 5 minutes and once up to 20 minutes this time. I hope it didn't just lengthen the wait time again since 20 mins is about at the edge of my patience =PCode:
gnome-screensaver-command -a && xset dpms force off
Same problem here. Something is defeating the screen auto-shut off... like sending mouse or keyboard events to the system. This is a worldwide energy disaster with millions of screens lit up when they should be off! How may megawatts of wasted energy is that?!
Never mind scripts and workarounds... this thread is old, so why haven't the devs fixed this????
My solution lcdonoff script - simple and elegant :popcorn:
replace OID by your deviceCode:
STATE=`xrandr | grep $OID | grep -c "ted ("`
case $STATE in
xrandr --output $OID --auto
xrandr --output $OID --off
posted also at
...and the best is - you can still control your music player, while your LCD is turned off
That works, but only if you have that script set on a button, not an icon. Though, I have only tested it on a laptop, so I do not know if it works on a desktop. I'm sure it can be adapted, though. Of course, you can usually turn those monitors off.
Nxmehta's script still is my choice, and hasn't failed me for several Ubuntu versions, including Natty.
A little bit of a thread revival (1 month ~), but I wanted to thank nxmehta for his script and also pass a little info on for those who might want screenlock at the same time.
I KNOW there is a more elegant way, so when one of you guys read this and think of that better way, be sure to post and make me feel stupid ;)
I created one script (simply called 'lock') that contained:
and then pasted nxmehta's python script into another script at that location. I then bound a key combination to execute 'lock', which enables screen lock and follows by executing nxmehta's script to turn off (and keep off!) the monitor.Code:
I did it this way in hopes I can use his script to figure out how to get the screensaver itself to shut off the monitor ( ](*,) )
Wow, it's been almost exactly 1 year since I posted that python script... and the bug still isn't fixed in Ubuntu. Glad that some people are getting use out of it though I guess.
I'll check in around June 2012... here's hoping that people don't have to keep using a python script to turn their screen off!
Running Gnome 3 on Arch with the same issue but I can't get the script to work, I get this error:
I've switched to xfce4-power-manager which doesn't integrate in the Gnome 3 top bar, but I'll make do for the meantime.Code:
File "./monitoroff.sh", line 21
SyntaxError: invalid syntax
It's a shame gnome-power-manager as yet to fix this conflict with xset dpms force off.