Page 4 of 7 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 62

Thread: Problem with xset dpms force off

  1. #31
    Join Date
    Dec 2007
    Location
    Galway, Ireland
    Beans
    316
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Problem with xset dpms force off

    Quote Originally Posted by nxmehta View Post
    Hopefully this will work. I'll post back if I ever notice the backlight turning back on. Then we'll have to go back to the drawing board...
    Nice script! Unfortunately it's still not working for me... it does stay off for longer I have to say... but if I run your script from the terminal, after a few seconds the screen comes one again and the script is still there waiting from input.

    Any idea how I can troubleshoot this to try to determine what's turning my screen on?

    Thanks!

  2. #32
    Join Date
    Dec 2007
    Location
    Galway, Ireland
    Beans
    316
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Problem with xset dpms force off

    Quote Originally Posted by lunatico View Post
    Any idea how I can troubleshoot this to try to determine what's turning my screen on?
    Sorry! My bad!
    I use blueproximity and it had a proximity command set to 'gnome-screensaver-command -p' to run every 60 seconds. Removed that command and now my screen stays off forever! Yei!

    The weird thing is that a simple command like:
    Code:
    #!/bin/bash
    sleep 2
    xset dpms force off
    does the trick...

  3. #33
    Join Date
    Dec 2007
    Location
    Galway, Ireland
    Beans
    316
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Problem with xset dpms force off

    Quote Originally Posted by lunatico View Post
    The weird thing is that a simple command like:
    Code:
    #!/bin/bash
    sleep 2
    xset dpms force off
    does the trick...
    Nope... me getting ahead of myself again. I had to use your script, which is perfect! Thanks!

  4. #34
    Join Date
    Jan 2007
    Location
    Melbourne, Australia
    Beans
    20
    Distro
    Ubuntu 6.06 Dapper

    Re: Problem with xset dpms force off

    Thanks for the script!
    I use this running from irexec with lirc so I can turn the monitor off by remote.

    I was wondering perhaps if there was a way to edit the script so that it running it would effectively toggle the display on and off?
    Or any way I could turn the display back on by way of remote?

  5. #35
    Join Date
    Sep 2007
    Beans
    31
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Problem with xset dpms force off

    Quote Originally Posted by adamlogan View Post
    Thank you very much for your script nxmehta. I am only recently using Ubuntu as my full time OS at home. Fortunately I had started getting into CLI on my personal mac which is currently being used at work but I am still very green to the *NIX like OS's.

    I'm executing this script via an alias. How can I make the script run silently with nothing appearing on std output? The output to std out is somewhat undesirable. I tried using

    alias sd='nohup path/to/script &'

    and once more without the nohup. Didn't get the effect I wanted. In the script itself I see the text "print display.next_event()" Is that writing to std out?

    Other than that I'm very pleased with the script.
    i've done
    alias so="script>/dev/null"
    /dev/null discards all data that you redirect to it!
    just learnt it!


    p.s the script is just perfect! i've stopped the screen saver services, but i guess its the power managers' preference to dim the backlight when not in use which is causing the screen to lit back!

  6. #36
    Join Date
    Aug 2006
    Beans
    3

    Re: Problem with xset dpms force off

    I think I've found a simple workaround for this problem.

    Create a script which first calls sleep and then xset.

    The key here is the amount of secs to sleep. If this doesn't work in your case, simply try increasing the amount of secs to sleep.

    You can see how to achieve this here: http://usemoslinux.blogspot.com/2010...-desde-un.html

    Greetings from Argentina! Pablo.

  7. #37
    Join Date
    Nov 2009
    Beans
    1,203

    Re: Problem with xset dpms force off

    As shown in previous posts, this script, by nxmehta, solves this problem for most of us. Lunatico is the only person I've found who is still having issues. Not sure what to offer as advice for him, though:


    #!/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
    Last edited by inameiname; December 15th, 2010 at 11:22 PM.

  8. #38
    Join Date
    Jun 2006
    Location
    San Francisco
    Beans
    171
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Problem with xset dpms force off

    Using nxmehta's script, my monitor turns off, but the computer no longer goes into sleep mode after 2 hours, which I have it set to do. Has anyone had any success with powering off the monitor with a program, and also having the computer being able to go into sleep mode after whatever the configured time is has elapsed.

  9. #39
    Join Date
    Mar 2011
    Beans
    3

    Re: Problem with xset dpms force off

    Quote Originally Posted by dstein View Post
    Using nxmehta's script, my monitor turns off, but the computer no longer goes into sleep mode after 2 hours, which I have it set to do. Has anyone had any success with powering off the monitor with a program, and also having the computer being able to go into sleep mode after whatever the configured time is has elapsed.
    I believe you can run
    Code:
    xdg-screensaver activate && xset dpms force off
    In this case, you are turning the screen saver on and then forcing the backlight off. You might have to type in your password when you return to your computer depending on your screen saver setting. If you want to lock your computer(independent of your screen saver setting), then just replace "activate" with "lock."

  10. #40
    Join Date
    Jun 2006
    Location
    San Francisco
    Beans
    171
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Problem with xset dpms force off

    Quote Originally Posted by sehyoun View Post
    I believe you can run
    Code:
    xdg-screensaver activate && xset dpms force off
    In this case, you are turning the screen saver on and then forcing the backlight off. You might have to type in your password when you return to your computer depending on your screen saver setting. If you want to lock your computer(independent of your screen saver setting), then just replace "activate" with "lock."
    This will have the problem that the monitor turns on after a few seconds, as described in El Raspa's original post.

Page 4 of 7 FirstFirst ... 23456 ... 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
  •