14

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 -p:

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
  • 1
    You'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. – pbm Dec 1 '10 at 20:40
  • I 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 Dec 1 '10 at 21:07
  • The command does not work with the shortcut icon. – crodjer Dec 1 '10 at 21:24
  • Maybe 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. – kasterma Dec 2 '10 at 16:54
  • no, I cant execute two commands directly frm a shortcut, will try creating a script. – crodjer Dec 2 '10 at 19:21
8

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.

4

Try adding a sleep:

$ sleep 1; xset dpms force off
  • 1
    One-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. – HalosGhost Aug 3 '14 at 23:36
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.

  • 2
    select at perldoc.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.) – sr_ Apr 13 '12 at 11:13
1

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.

  • 1
    @oneofone...This can't be the problem in mycase. I have a laptop, hence no mouse. – crodjer Dec 2 '10 at 4:04
  • 1
    +1 to neutralize the down vote. Though this answer wasn't applicable to my problem, still needn't be negatively voted. – crodjer Nov 12 '14 at 7:32
1

If non of the above worked for you. I had the same problem on a 64bit linux mint machine. The only thing that worked for me was this python script :

import sys, select, subprocess
while True:
    p = subprocess.Popen(['xset', 'dpms', 'force', 'off'], 
        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    if sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
        break
1

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.

0

I assume that loop has a sleep otherwise I wouldn't use it. I used cron with this set to run every 5 mins (enter crontab -e from the command-line as your X11 logged in user):

*/5 * * * * /usr/bin/env DISPLAY=:0.0 xset -dpms

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.