autorandr icon indicating copy to clipboard operation
autorandr copied to clipboard

Would you be open to make this tool capable of handling wayland?

Open chmduquesne opened this issue 3 years ago • 5 comments

I know this sounds crazy, but In the end, autorandr is about 3 things:

  1. Listening for changes in the physically plugged displays (something that we can do with dbus-monitor, as seen in #269)
  2. Detecting the EDIDs (something that is currently done with xrandr)
  3. 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?

chmduquesne avatar Nov 16 '21 17:11 chmduquesne

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.

phillipberndt avatar Nov 16 '21 18:11 phillipberndt

There's https://sr.ht/~emersion/kanshi/ ?

ekini avatar Nov 19 '21 01:11 ekini

Neat! Is that the established default tool? If yes, let's leave a comment in the readme.

phillipberndt avatar Dec 16 '21 09:12 phillipberndt

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.

Vladimir-csp avatar Dec 08 '22 16:12 Vladimir-csp

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

thiagokokada avatar May 04 '23 20:05 thiagokokada