Re: Problem with xset dpms force off
Quote:
Originally Posted by
nxmehta
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!
Re: Problem with xset dpms force off
Quote:
Originally Posted by
lunatico
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...
Re: Problem with xset dpms force off
Quote:
Originally Posted by
lunatico
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!
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?
Re: Problem with xset dpms force off
Quote:
Originally Posted by
adamlogan
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! :D
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!
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.
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:
Quote:
#!/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
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.
Re: Problem with xset dpms force off
Quote:
Originally Posted by
dstein
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."
Re: Problem with xset dpms force off
Quote:
Originally Posted by
sehyoun
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.