autorandr
autorandr copied to clipboard
Would you be open to make this tool capable of handling wayland?
I know this sounds crazy, but In the end, autorandr is about 3 things:
- Listening for changes in the physically plugged displays (something that we can do with dbus-monitor, as seen in #269)
- Detecting the EDIDs (something that is currently done with xrandr)
- Applying an xrandr command (and pre/post/predetect stuff)
I have been investigating porting this tool to wayland, but at this point I am thinking that it seems possible to just abstract the existing code from the display server (so basically, let the user choose if xrandr is used to rearrange the screen, or another wayland-specific command). I just found out that you can get the EDIDs from /sys/class/drm/*/edid
(run this through hexdump, it is the same output as xrandr). That makes the dependency to xrandr pretty small.
Since the tool would be very very similar in function, would it be better to write new code, or could we modify autorandr to handle wayland?
I'd say that depends on how that Wayland specific tool works. If there's one that conceptually is close enough then sure, let's go for it.
I'd refrain from trying to translate between the two worlds though, just make configurations either xrandr or whatever-else compatible.
There's https://sr.ht/~emersion/kanshi/ ?
Neat! Is that the established default tool? If yes, let's leave a comment in the readme.
Might be useful to exit and do nothing if attempted to run on wayland, i.e. if WAYLAND_DISPLAY
is set. As having autorandr installed with udev rules and stuff might interfere with a wayland session via xwayland compatibility.
Might be useful to exit and do nothing if attempted to run on wayland, i.e. if
WAYLAND_DISPLAY
is set. As having autorandr installed with udev rules and stuff might interfere with a wayland session via xwayland compatibility.
Created a PR to implement this check: https://github.com/phillipberndt/autorandr/pull/346