SammysHP/i3lockmore

Previous DPMS timeout value broken

Closed this issue · 4 comments

Using --dpms sets xset -dpms s [seconds], and restores the prior value after unlocking; however, if xset -dpms s off is active before locking, this is not properly restored after unlocking.

It will call xset dpms 0 0 $DPMS_TIMEOUT which means "set DPMS mode off after DPMS_TIMEOUT seconds of inactivity". Right before exit it will be reset to the previous values via xset dpms $DPMS_OLD. The range of these parameters is 0..n.

You commands xset -dpms s [seconds] or xset -dpms s off are not called by this script. That means (if it is even a valid syntax) "disable DPMS" and "activate screensaver after n seconds" or "disable screensaver".

Can you please explain which settings are changed in your case? Please post the output of xset q before and after running this tool.

I use xset -dpms s off to disable dpms altogether, since I do not want a screen timeout. I think xset dpms 0 0 $DPMS_TIMEOUT does the same thing as set -dpms s $DPMS_TIMEOUT, in this case. It is at least what I meant by it.

xset q before running the lock script:

» xset q             
Keyboard Control:
  auto repeat:  on    key click percent:  0    LED mask:  00000002
  XKB indicators:
    00: Caps Lock:   off    01: Num Lock:    on     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:  660    repeat rate:  25
  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:  600
Colors:
  default colormap:  0x20    BlackPixel:  0x0    WhitePixel:  0xffffff
Font Path:
  /usr/share/fonts/misc,/usr/share/fonts/TTF,/usr/share/fonts/OTF,/usr/share/fonts/Type1,built-ins
DPMS (Energy Star):
  Standby: 600    Suspend: 600    Off: 600
  DPMS is Disabled

Interestingly, there is no difference in xset q after locking and unlocking, even though I do observe dpms being active. In that case, I guess this issue is not caused by this script.

There is indeed a difference. I haven't considered the case that DPMS was switched off previously and only restore the timeout values.

DPMS (Energy Star):
  Standby: 600    Suspend: 600    Off: 600
  DPMS is Disabled
DPMS (Energy Star):
  Standby: 600    Suspend: 600    Off: 600
  DPMS is Enabled
  Monitor is On

Oh duh, you're right. I forgot I added setting dpms to off in my locking script.