How to setup multiple monitor layout in KDE (Wayland, NVIDIA)?

Hi, I installed fresh NixOS with KDE Plasma 6 on wayland session. I also have Nvidia proprietary if that is somewhat relevant. First thing I wanted to do was modify my three monitor layout so I have it set after next installation. When I was using hyprland, I set it in hypr.conf, now I am using Gnome and I copy monitors.xml into .config, but I can’t find any way, how to do it in KDE. I tried xrandrHeads, but it had no effect with anything I tried to set there. When I rearrange the monitor layout in graphical interface in KDE, then the layout is persistent, but I have no idea where this setting is saved. There is some file xinputoutput.json (or something similar, I am not booted into KDE now so I dont remember exactly) in .config folder that seems to have some monitor configuration, but any change there is overwritten on next login, so it is obviously generated from somewhere else. Any help please? :pray:

Also Im using sddm on wayland, so maybe if there is a way to properly setup layout also for that, it would be great, but it is just a bonus

I tried KDE Plasma 6 on NixOS before switching to Sway.

My understanding is that KDE is not easy to configure via Nix, even using home-manager. The config files all seem to have a complex format which is specific to KDE.

There is a community project called plasma-manager which is attempting to provide better Nix support for KDE Plasma 5 and 6, but it’s still a work in progress and not fully reliable yet.

Out of the listed supported features on the project page, I can’t see any mention of configuring monitors. But the project might at least have some tools you can use to better configure KDE from Nix, maybe enough to build your own solution if it’s not fully supported currently?

Also, you haven’t mentioned home-manager in your question, but if you’re not using it I’d highly recommend it for managing config files. It has a lot of helpers for other software (not so much KDE unfortunately) which let you manage your config from one unified Nix repository.

If you do try plasma-manager, I believe home-manager is a dependency. You’ll need to add both as additional “channels” for your NixOS setup.

And as another aside: my understanding is that the proprietary Nvidia driver doesn’t support Wayland at all, so that’s not likely to help things unless you really want to switch back to X.

1 Like

Starting with the nvidia 555 series driver (which is stable now) it supports Wayland a lot better than it used to.
So it might be worth trying out Wayland after all.

1 Like

Yes, I am using home manager and I tried plasma-manager, but it seems it does not have option to configure monitor layout. At least when I changed layout, then used plasma-manager’s rc2nix tool, I haven’t found anything regarding to monitors.

Sway don’t support Nvidia driver at all, is that correct?

As for proprietary Nvidia and Wayland, it is not true. I have run hyprland in the past with Nvidia proprietary without any issues. Now I have Gnome on Wayland and it is working well. In fact it is working much better on Wayland than on X. I tried also Xfce, but I haven’t manage to find any configuration without conciderable screan tearing.

Yup, sorry, it seems I was completely wrong about the proprietary Nvidia driver thing!

Also xrandr output is really strange:

[rstasta@nixos:~]$ xrandr 
Screen 0: minimum 16 x 16, current 7520 x 1800, maximum 32767 x 32767
DP-3 connected 2400x1350+1920+0 (normal left inverted right x axis y axis) 531mm x 299mm
   2400x1350     59.93*+
   1600x1200     59.87  
   1440x1080     59.99  
   1400x1050     59.98  
   1280x1024     59.89  
   1280x960      59.94  
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   1920x1200     59.88  
   1680x1050     59.95  
   1440x900      59.89  
   1280x800      59.81  
   1152x720      59.97  
   960x600       59.63  
   928x580       59.88  
   800x500       59.50  
   768x480       59.90  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   2048x1152     59.90  
   1920x1080     59.96  
   1600x900      59.95  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77  
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   1920x1080    359.83*+
   1440x1080    359.81  
   1400x1050    359.99  
   1280x1024    359.88  
   1280x960     359.90  
   1152x864     359.59  
   1024x768     359.67  
   800x600      359.75  
   640x480      359.53  
   320x240      359.06  
   1680x1050    359.98  
   1440x900     359.92  
   1280x800     359.63  
   1152x720     359.66  
   960x600      359.90  
   928x580      359.80  
   800x500      359.35  
   768x480      359.29  
   720x480      359.48  
   640x400      359.21  
   320x200      357.70  
   1600x900     359.90  
   1368x768     359.75  
   1280x720     359.75  
   1024x576     359.88  
   864x486      359.63  
   720x400      359.24  
   640x350      358.82  
HDMI-A-1 connected 3200x1800+4320+0 (normal left inverted right x axis y axis) 697mm x 392mm
   3200x1800    143.90*+
   2048x1536    143.83  
   1920x1440    143.78  
   1600x1200    143.80  
   1440x1080    143.80  
   1400x1050    143.78  
   1280x1024    143.79  
   1280x960     143.86  
   1152x864     143.75  
   1024x768     143.66  
   800x600      143.83  
   640x480      143.30  
   320x240      142.05  
   2560x1600    143.88  
   1920x1200    143.82  
   1680x1050    143.79  
   1440x900     143.73  
   1280x800     143.67  
   1152x720     143.57  
   960x600      143.72  
   928x580      143.50  
   800x500      143.68  
   768x480      143.69  
   720x480      143.35  
   640x400      143.37  
   320x200      141.40  
   2880x1620    143.84  
   2560x1440    143.78  
   2048x1152    143.81  
   1920x1080    143.72  
   1600x900     143.81  
   1368x768     143.77  
   1280x720     143.67  
   1024x576     143.62  
   864x486      143.63  
   720x400      143.29  
   640x350      143.57

HDMI monitor is native 2560x1440, other two 1920x1080. And if I want to manually change resolution, I get:

[rstasta@nixos:~]$ xrandr --output HDMI-A-1 --mode 2560x1440 
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  7 (RRSetScreenSize)
  Serial number of failed request:  36
  Current serial number in output stream:  37

If I disable intel card by boot.kernelParams = [ "module_blacklist=i915" ], I got the best graphical results, also xrandr is correct:

[rstasta@nixos:~]$ xrandr
Screen 0: minimum 16 x 16, current 4480 x 1440, maximum 32767 x 32767
HDMI-A-1 connected 2560x1440+1920+0 (normal left inverted right x axis y axis) 697mm x 392mm
   2560x1440    143.78*+
   1920x1440    143.78  
   1600x1200    143.80  
   1440x1080    143.80  
   1400x1050    143.78  
   1280x1024    143.79  
   1280x960     143.86  
   1152x864     143.75  
   1024x768     143.66  
   800x600      143.83  
   640x480      143.30  
   320x240      142.05  
   1920x1200    143.82  
   1680x1050    143.79  
   1440x900     143.73  
   1280x800     143.67  
   1152x720     143.57  
   960x600      143.72  
   928x580      143.50  
   800x500      143.68  
   768x480      143.69  
   720x480      143.35  
   640x400      143.37  
   320x200      141.40  
   2048x1152    143.81  
   1920x1080    143.72  
   1600x900     143.81  
   1368x768     143.77  
   1280x720     143.67  
   1024x576     143.62  
   864x486      143.63  
   720x400      143.29  
   640x350      143.57  
DP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 531mm x 299mm
   1920x1080     59.96*+
   1440x1080     59.99  
   1400x1050     59.98  
   1280x1024     59.89  
   1280x960      59.94  
   1152x864      59.96  
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   1680x1050     59.95  
   1440x900      59.89  
   1280x800      59.81  
   1152x720      59.97  
   960x600       59.63  
   928x580       59.88  
   800x500       59.50  
   768x480       59.90  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   1600x900      59.95  
   1368x768      59.88  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77  

But Laptop integrated display is not working (as seen in xrandr), not recognised, showing tty from system boot. Any help there?

So I suspect, that those xrandrHeads from original questions are not working, because of those strange xrandr values and errors (that seem to come form intel driver somehow messing with those values, because when I disable it, values are okay).