Not sure if this is the right section to ask this question but here it goes:
I have a two monitor setup that I use with Manjaro KDE. My main display is the right monitor and the secondary is on the left. If I switch the input on the secondary display, it becomes disabled in the display settings and when I switch the input back it appears but set on the right of the primary display.
I need to switch the display input because I have a qemu/kvm windows VM that I turn on and use with the secondary monitor.
The question is: is it possible to force the second monitor to always appear on the left of the primary display?
Have you tried setting them up in system settings? Run the command systemsetting5 and navigate to the section “Screen and Monitor” (or something similar. There you can position your monitors and select which one is the primary.
the monitor has a button and you can switch inputs from Displayport to DVID for example.
of course I looked in the display settings. I position the monitors and the trouble is that when I switch inputs, the secondary monitor becomes disabled. when I switch back, and it is enabled again, it appears to the right! not.where I positioned initially to the left. should I upload some pictures?
No, I perfectly understood now. It should remember the layout. I remember having a similar problem in the past, but plasma has been remembering layouts for long time now.
EDIT: Try to delete everything in ~/.local/share/kscreen/ and reboot with both monitors on. Then set it up again and test. The idea cam from here.
The “Anzeige und Monitor” page (I really need to switch to english…, I mean the page for setting up the displays) in plasma system settings has a checkbox to flag a screen as primary.
But I am not sure if that will solve the problem as I often use my desktop without the primary display.
But you should set your right monitor as primary, because that determines where the panel goes. I have no idea it that impacts where the monitors are placed though.
Yes, the monitor that is the primary display I never switch its inputs. I will try xrandr in a script somehow to enable and rearrange the monitors when switching back inputs.
I did what you suggested. Inside that dir there are two more dirs called control and outputs and two files with weird names: 3bee671caf0cc5dd68b718393d0ac55d and 47473548d3cda02cbcf2fd25e1d3ad45.
The one file I found interesting is the second one because it contains this:
As I change inputs the primary monitor position is moved from "x": 2560 back to zero. What appears to happen is that when I change inputs on the secondary monitor kde will disable that monitor and this file changes to only include info about the primary monitor (the one I don’t change inputs on), switching the x position to 0. When I chang back the inputs on the secondary monitor, it appears as disabled at first in the display settings and when I enable it, it appers to the right on the primary. But that I think it is because the file above gets generated again, but leaving the x position to 0 on the main display.
I was thinking that maybe this can be corrected using a script (or hooks?) at the start of the VM (to switch inputs) and then at the end to place the released monitor at its correct position.
The script to setup the layout is very simple to write. I’m just not sure how to check if a new monitor as been added. The best way might be to write a systemd timer.
Below is the script I wrote for my work computer. It has two screens and occasionally I need to run one of them off (the left one - the right is the primary). I run it manually, but I had intentions of automating it when I wrote it.