How about this:
.Code:xset s blank ; xset s 1 ; sleep 3 ; xset s 0
(Ubuntu 10.10 / Intel GMA graphics / i915 driver.)
How about this:
.Code:xset s blank ; xset s 1 ; sleep 3 ; xset s 0
(Ubuntu 10.10 / Intel GMA graphics / i915 driver.)
Stop Trusted Computing! http://www.cl.cam.ac.uk/~rja14/tcpa-faq.html
Asus Rampage 2 Extreme/2.66GHz i7 Quad/6GB DDR3 1600MHz 8-8-8-24/2x Nvidia 9800GTX+
2x150GB 10krpm HD/2x1TB 7200RPM HD/3ware RAID/
Xubuntu 11.04/Arch Linux/Gentoo Linux/Fedora
It uses the built-in X11 screen saver to blank the screen. This method appears to be immune to the gnome-screensaver bug causing problems with the dpms method for screen blanking discussed in this thread.
Here is a slight improvement to my original command line to blank the screen:
Of course, as shown by GSF1200S, you can put this command line in a shell script and bind it to a key via gnome's window manager.Code:xset s blank ; sleep 1 ; xset s activate
Or you can do it even without any script file, by binding a key directly to the command:
Note: The key-binding can be done directly (to avoid gnome key binding bugs) using the passive grab mechanism available in Xlib, which will make it independent of gnome or ubuntu. I can post code if any one is interested. Full active grab of the entire keyboard and pointer (as done in nxmehta's script) may work, but is not secure, and should be avoided.Code:/bin/sh -c 'xset s blank ; sleep 1 ; xset s activate'
Just to add a bit to this again, I recently ran across another interesting little display off script that I felt like sharing on here. Firstly, I still use nxmehta's script to turn the display off:
Code:#!/usr/bin/python import time import subprocess from Xlib import X from Xlib.display import Display display = Display(':0') root = display.screen().root root.grab_pointer(True, X.ButtonPressMask | X.ButtonReleaseMask | X.PointerMotionMask, X.GrabModeAsync, X.GrabModeAsync, 0, 0, X.CurrentTime) root.grab_keyboard(True, X.GrabModeAsync, X.GrabModeAsync, X.CurrentTime) subprocess.call('xset dpms force off'.split()) p = subprocess.Popen('gnome-screensaver-command -i'.split()) time.sleep(1) while True: print display.next_event() p.terminate() break
...it never fails me as a means to turn off the display just once. Once you hit something or press a button it will come back on.
Now, for a little different one, this one will turn the display off, and it will continue to stay off, or rather, will resume to turning the screen back off, it you happen to press a button or touch the touchpad. So far, it seems to work too, and is another good means to turn off the screen, particularly if you give a hardware shortcut to it, such as like this:
Anyway, here is the script:Code:gconftool-2 --set /apps/metacity/global_keybindings/run_command_5 --type string "<Control><Alt>Z" gconftool-2 --set /apps/metacity/keybinding_commands/command_5 --type string "/home/me/.gnome2/nautilus-scripts/My_Scripts/Display-Off/Display-Offed.sh"
Code:#!/bin/bash # Display-Offed.sh # turns off screen and it will stay off until this script is closed/finished # works well attached to a hardware button shortcut LF=/tmp/screen-lock; if [ -f $LF ]; then /bin/rm $LF; else touch $LF; sleep .5; while [ -f $LF ]; do xset dpms force off; sleep 2; done; fi
Hi guys, I just use
and it works! It actually does exactly the same (i.e. blanks the screen and turns off the backlight), but it doesn't get dropped. I'm using lucid lynx 10.04.3 x64 on my Acer z5710 monoblock.Code:xset dpms force suspend
UPDATE: that stopped working after some random update Butstill works fineCode:sleep 1 && xset dpms force off
Last edited by ScumCoder; November 6th, 2011 at 08:00 AM.
I wanted to throw my two cents in.
I ran the following in a script:
#!/bin/sh
perl -e 'select(undef,undef,undef,.1)' && xset dpms force off
It fixed the problem right away. No idea what that perl is doing, but it works.
AMD, lucid 32, etc.
Cheers
Please somebody explain to me how `gnome-screensaver-command -i` is supposed to "inhibit" the screen saver. "-i" seems to be an invalid argument.
Code:$ gnome-screensaver-command -i ** (gnome-screensaver-command:25672): WARNING **: Unknown option -i
Bookmarks