Screen turns on automatically (xset dpms force off)
Solution 1
This seems to be a known bug and you can read more detail on launchpad as well as on ubuntuforums. The issue is that somehow gnome-power-manager
and the xset
commands conflict with each other.
The solution is to run xset dpms force off
in a loop, a python script pretty much works for most of us.
Give it a try, and see how it goes.
Solution 2
Try adding a sleep
:
$ sleep 1; xset dpms force off
Solution 3
Had this problem on AMD/HP laptop. Also running 10.04.3/32, same problem. Got this solution from another forum:
#!/bin/sh
perl -e 'select(undef,undef,undef,.1)' && xset dpms force off
I put that in a sh file, set it executable, and linked that to the panel shortcut. Worked like a charm, monitor stays off. I've got no idea what the hell that weird perl script does.
Solution 4
For me, i was playing a video in the background, causing screen to always re-turn on after 5 seconds ... I added sleep before command and stopped video and it worked.
Solution 5
I've had that problem before, basically my mouse was causing it, flip the side on it's back when you aren't using it.
Related videos on Youtube
crodjer
B. Tech 4th Year Student, Indian Institute of Technology, Kharagpur. Python Programmer, Web and Software Developer Open Source Enthusiast
Updated on September 17, 2022Comments
-
crodjer over 1 year
I am using
xset dpms force off
to manually turn my screen off to save power. However, it turns back on after some time (20 - 40 seconds).Distro: Ubuntu-Lucid
Graphics: Intel 4500 MHD
Trying steps in this solution (Turning off screensaver or wireless) did not work. Can it be due to any other reasons like network (magic packet) or usb devices?
Result of
xset -q
:Keyboard Control: auto repeat: on key click percent: 0 LED mask: 00000000 XKB indicators: 00: Caps Lock: off 01: Num Lock: off 02: Scroll Lock: off 03: Compose: off 04: Kana: off 05: Sleep: off 06: Suspend: off 07: Mute: off 08: Misc: off 09: Mail: off 10: Charging: off 11: Shift Lock: off 12: Group 2: off 13: Mouse Keys: off auto repeat delay: 500 repeat rate: 30 auto repeating keys: 00ffffffdffffbbf fadfffefffedffff 9fffffffffffffff fff7ffffffffffff bell percent: 50 bell pitch: 400 bell duration: 100 Pointer Control: acceleration: 2/1 threshold: 4 Screen Saver: prefer blanking: yes allow exposures: yes timeout: 0 cycle: 0 Colors: default colormap: 0x20 BlackPixel: 0 WhitePixel: 16777215 Font Path: /usr/share/fonts/X11/misc,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,built-ins DPMS (Energy Star): Standby: 0 Suspend: 0 Off: 0 DPMS is Enabled Monitor is On
-
pbm over 13 yearsYou're using it manually from command line or
xset
is binded to some keyboard shortcut? On my brother laptop this command was binded to some keys and after that monitor was turned off and on again, because when he was releasing key next event was emitted. Turning it off after quick sleep solved problem:perl -e 'select(undef,undef,undef,.1)' && xset dpms force off
- this perl expression do sleep for 0.1 sec. -
crodjer over 13 yearsI used to have the shortcut key problem too thats why created an icon. Your
perl -e 'select(undef,undef,undef,.1)' && xset dpms force off
command when typed in terminal did the work. Now trying this with the shortcut icon. -
crodjer over 13 yearsThe command does not work with the shortcut icon.
-
kasterma over 13 yearsMaybe increase the sleep (also I would use the command "sleep n" to sleep n seconds); it might be that your clicking the icon and moving the mouse(sliding your fingers over the touchpad) sends later events.
-
crodjer over 13 yearsno, I cant execute two commands directly frm a shortcut, will try creating a script.
-
-
crodjer over 13 years@oneofone...This can't be the problem in mycase. I have a laptop, hence no mouse.
-
sr_ about 12 years
select
atperldoc.perl.org
reveals it's a way to sleep 100ms. Depending on your/bin/sleep
,sleep 0.1
could achieve the same. (Not that I understand why this sleep is there at all.) -
Jakob Bennemann over 9 yearsOne-line answers are often not the most helpful since they offer little explanation. Consider expanding your answer to elaborate on why your solution works or with documentation that supports your suggestion.
-
crodjer over 9 years+1 to neutralize the down vote. Though this answer wasn't applicable to my problem, still needn't be negatively voted.