X output names were renamed from LVDS1 to LVDS-1
martin-ueding opened this issue · 4 comments
When I started my system today, I saw that my display scripts no longer work flawlessly. This is because LVDS1
is now called LVDS-1
on current Fedora 25.
This change might be trickling down to other distributions in the next months/years, Arch Linux perhaps already has the change.
Since people have configuration files and our default explicitly lists LVDS1
, there is something that needs to be done. In order to let most users ignore the issue, I think we should query XRandR and see how the outputs are named. Then one can to the conversion (\w+)(\d+)
to \1-\2
quite easily from the values the users have set.
I just noticed that on my AMD Radeon R9 380 with the amdgpu
open source driver on my other machine, the names have been DP-1
, DVI-D-1
, DVI-I-1
for quite a while now. Very interesting. Perhaps the names where unified now with a change in the Intel driver or so?
I haven't seen this yet (Arch Linux). I'd suggest that instead of reinterpreting existing configuration values, we make the following changes:
-
Replace the
screen.internal
config parameter with a new parameterscreen.internal_regex
. Then, the default could beLVDS-?1
, or evenLVDS-?1|eDP-?1
to accommodate Thinkpad Yoga users (#92). -
Get the actual name of the internal display from
xrandr
, as you suggest. (Search using the obsoletescreen.internal
config parameter if it's set, orscreen.internal_regex
otherwise.) If the configured internal display cannot be found in the output ofxrandr
, warn the user and suggest they update their configuration. This would also help new users whose internal displays are named differently from the default (such as if they have different hardware).
This is my reasoning:
-
I doubt many users have set the
screen.internal
configuration value themselves, so I would think simply changing the default would be sufficient for the vast majority of users. If users have setscreen.internal
and the name changes, then the warning would let them know to update their config. -
Reinterpreting the
screen.internal
config value two ways, such asLVDS1
being interpreted asLVDS1
orLVDS-1
, is confusing to me. I think using a regex is clearer (and more flexible).
Yes, making a clean cut is better than changing the meaning of a variable.
Reading through the Fedora devel
mailing list, I saw that changing the driver to the modesetting driver will change the names of the outputs. So Fedora 25 also has got the change to the modesetting driver. Therefore this change will also appear in Debian 9 and Ubuntu at some time. So this definitely is something that needs to be taken care of.
This feature is now implemented, together with a couple of unit tests for the new functions.
I have not pushed it yet because I have incorporated a snippet from Stack Overflow. Since all that is CC-BY-SA and I have linked it and we have a GPL project, is should be fine. However I have emailed the authors asking for permission. In the meantime one should just set screen.internal = LVDS-1
to get this working.