Page 6 of 7 FirstFirst ... 4567 LastLast
Results 51 to 60 of 62

Thread: Problem with xset dpms force off

  1. #51
    Join Date
    Jul 2011
    Beans
    3

    Re: Problem with xset dpms force off

    How about this:

    Code:
     xset s blank ; xset s 1 ; sleep 3 ; xset s 0
    .

    (Ubuntu 10.10 / Intel GMA graphics / i915 driver.)

  2. #52
    Join Date
    Feb 2007
    Beans
    22

    Re: Problem with xset dpms force off

    Quote Originally Posted by adgmonk View Post
    How about this:

    Code:
     xset s blank ; xset s 1 ; sleep 3 ; xset s 0
    .

    (Ubuntu 10.10 / Intel GMA graphics / i915 driver.)
    This seems to work. What does it actully do?

    And how can I put this in Gnome's keyboard shortcut command option?

  3. #53
    Join Date
    Mar 2007
    Location
    Pensacola, Fl
    Beans
    1,055
    Distro
    Xubuntu 11.04 Natty Narwhal

    Re: Problem with xset dpms force off

    Quote Originally Posted by snoxu View Post
    This seems to work. What does it actully do?

    And how can I put this in Gnome's keyboard shortcut command option?
    Im not familiar with Gnome, but can you point its keyboard shortcuts to your own script? If so, just create a script:
    Code:
    #!/bin/sh
    xset s blank ; xset s 1 ; sleep 3 ; xset s 0
    then point Gnome at it in the keyboard shortcuts. Make sure to make the script executable..
    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

  4. #54
    Join Date
    Jul 2011
    Beans
    3

    Re: Problem with xset dpms force off

    Quote Originally Posted by snoxu View Post
    This seems to work. What does it actully do?
    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:

    Code:
    xset s blank ; sleep 1 ; xset s activate
    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.

    Or you can do it even without any script file, by binding a key directly to the command:

    Code:
    /bin/sh -c 'xset s blank ; sleep 1 ; xset s activate'
    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.

  5. #55
    Join Date
    Nov 2009
    Beans
    1,196

    Re: Problem with xset dpms force off

    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:

    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"
    Anyway, here is the script:

    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

  6. #56
    Join Date
    Sep 2011
    Beans
    4

    Re: Problem with xset dpms force off

    Hi guys, I just use
    Code:
    xset dpms force suspend
    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.

    UPDATE: that stopped working after some random update But
    Code:
    sleep 1 && xset dpms force off
    still works fine
    Last edited by ScumCoder; November 6th, 2011 at 08:00 AM.

  7. #57
    Join Date
    Nov 2007
    Beans
    29

    Re: Problem with xset dpms force off

    Quote Originally Posted by adgmonk View Post
    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:

    Code:
    xset s blank ; sleep 1 ; xset s activate
    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.

    Or you can do it even without any script file, by binding a key directly to the command:

    Code:
    /bin/sh -c 'xset s blank ; sleep 1 ; xset s activate'
    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.
    Thnx! I've been looking for a workaround for years (literally)!

  8. #58
    Join Date
    Jul 2009
    Beans
    18

    Re: Problem with xset dpms force off

    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

  9. #59
    Join Date
    Jan 2008
    Location
    Groningen, Netherlands
    Beans
    13
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Problem with xset dpms force off

    Quote Originally Posted by kwevej View Post
    My solution lcdonoff script - simple and elegant
    Code:
    #/bin/sh
    OID='LVDS1'
    STATE=`xrandr | grep $OID | grep -c "ted ("`
    case $STATE in
    '1')
    xrandr --output $OID --auto
    ;;
    '0')
    xrandr --output $OID --off
    ;;
    esac
    replace OID by your device

    posted also at
    http://paste2.org/p/1400104

    ...and the best is - you can still control your music player, while your LCD is turned off
    Well this works, but it does mess with my Compiz. On the other hand, compiz has been sensitive as hell since I upgraded tot 12.04 so it might not be caused by the script.

  10. #60

    Re: Problem with xset dpms force off

    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

Page 6 of 7 FirstFirst ... 4567 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •