Bug 447305 - feature-request: add support of wlr-randr for wayland sessions
Summary: feature-request: add support of wlr-randr for wayland sessions
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 5.23.4
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-20 19:51 UTC by Lars Bischoff
Modified: 2022-01-11 09:43 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Bischoff 2021-12-20 19:51:13 UTC
Please add support for wlr-randr (or any other replacement for xrandr) for wayland sessions that allows for script controlled switching of monitors.

My use-case:
I'm using a script that makes use of xrandr and pactl to switch monitor and audio output to one out of several pre-defined configurations.
This currently does not work when using a wayland session due to the lack of a xrandr replacement (at least I could not find any - sorry if there is one).
Comment 1 Nicolas Fella 2021-12-20 21:10:29 UTC
wlr-randr support would require implementing https://github.com/swaywm/wlr-protocols/blob/master/unstable/wlr-output-management-unstable-v1.xml

You can use kscreen-doctor as a replacement for xrandr
Comment 2 Lars Bischoff 2021-12-21 21:08:54 UTC
Ah, thanks! I was searching for a native kde command-line tool to manage screens  when I wrote my little screen switching script years ago, but couldn't find any.

Now, if it only would work when using wayland...
First problem I encountered was that the output names are not the same as when using X11.
On X11 I have: "DisplayPort-0" and "HDMI-A-0"
On wayland I just have outputs "1" and "2".
So it's not possible to use exactly the same commands on both X11 and wayland.
And then the  first time I used that to switch the output from one output to the other, my whole system froze... had to hard reset...
Guess I better let wayland mature for another 5 years before trying again, huh? ;)

Anyway: Even if kscreen-doctor would work properly, having a DE (or wayland-compositor) independent command-line tool for managing display outputs (similar to xrandr), is IMHO still preferable. So would be great if something like wlr-randr is considered at some point.
Comment 3 Vlad Zahorodnii 2022-01-11 09:43:49 UTC
Supporting multiple output management protocols in kwin is not an option. While our and wlroots' protocols are similar, the kde protocol contains extra plasma-specific stuff, e.g. VRR policy (in plasma it's not a simply on and off switch), it also allows us to align protocol changes with plasma releases.