#996417 xset: handle absence of DPMS support in the X server more gracefully

Package:
x11-xserver-utils
Source:
x11-xserver-utils
Description:
X server utilities
Submitter:
Thorsten Glaser
Date:
2021-10-13 20:15:03 UTC
Severity:
normal
Tags:
#996417#5
Date:
2021-10-13 20:13:35 UTC
From:
To:
My ~/.xsessionrc has:

	xset dpms 0 0 0

With a regular X11 session, this works, but in an xrdp+xorgxrdp session,
it fails because the server lacks DPMS support. But then, once having
failed on the dpms keywords, it interprets the 0 as another argument,
instead of first parsing the "dpms [standby [suspend [off]]]" then exiting
as there are no further arguments:


server does not have extension for dpms option
xset:  unknown option 0

usage:  xset [-display host:dpy] option ...
    To turn bell off:
        -b                b off               b 0
[…]


This is, of course, both suboptimal and avoidable by moving the parsing
of the dpms-related options to before the check for its presence.