Dual monitor setup: can't set a permanent primary monitor

Hi guys!
I have a strange issue…
I have two monitors attached to my PC and naturally I want to use the higher resolution one as my primary and the other as a secondary monitor.
Now, every time i shutdown or reboot my configuration disappears, leaving me with my small monitor as primary and the other as secondary (of course).
The funny thing is that, just after boot my xrandr output is

Screen 0: minimum 8 x 8, current 3360 x 1080, maximum 32767 x 32767
DP1 connected 1440x900+0+0 (normal left inverted right x axis y axis) 410mm x 260mm
   1440x900      59.89*+  74.98  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x800      74.93    59.81  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   640x480       75.00    72.81    66.67    59.94  
   720x400       70.08  
HDMI1 connected primary 1920x1080+1440+0 (normal left inverted right x axis y axis) 530mm x 300mm
   1920x1080     60.00 +  74.97*   50.00    59.94  
   1920x1080i    60.00    50.00    59.94  
   1680x1050     59.88  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x960      60.00  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08  
HDMI2 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

So plasma recognize which is my primary monitor correctly.
That’s confirmed by giving a look to system settings in display section, where right after boot I see:

Even though my actual primary monitor is still the small one.

Now, I read that it’s a bug in plasma and it’s been here with us for at least 10 years, so there are a lot of solution on the web, however none of them appllies to my case: for example, I wrote a simple bash script to launch at start:

#!/usr/bin/env bash

xrandr --output HDMI1 --primary --mode 1920x1080 --rate 74.97 --output DPI1 --mode 1440x900 --rate 74.98 --left-of HDMI1

but it doesn’t work because plasma applies the same settings at boot, even if for some reason it messes up my monitor selection.
What can I do?

  1. It’s a BIOS/UEFI Firmware thing: Whichever monitor shows your boot-up sequence before Linux starts is indeed your primary monitor and you need to change that in your firmware.

  2. If the xrandr command all by itself works, but your script doesn’t:

    try modifying the shebang of your script to #!/bin/bash and ensure the execution bit is set.

:thinking:

1 Like

Hi @Fabby!

So, I checked the mobo manual and BIOS settings and turns out I can’t set a primary monitor via firmware…
Strangely enough the ASUS logo shows up on both screens when I boot, so I don’t know which one is considered primary at that stage.
The only thing I tried that could help is to disconnect one of the two monitor, boot, then shutdown and connect it again to see if that could reset my settings but still nothing.

Regarding the script, no luck with that either… It works if I manually change display settings and then execute the script to test it out, but at boot it doesn’t really make a difference…

Thanks for the ideas though!
Al least we ruled a couple of things out :smile:

1 Like

I don’t understand what you’re trying to say here. Can you elaborate on all the exact steps you’re performing, please?

:thinking:

1 Like

Hi @Platonio14,

I don’t know where you put the script for your startup, but I recommend ~/.config/plasma-workspace/env as that’s where I’ve got mine and it works.

Note that I only wanted it for when I logged into the PC, so it’s not global and will only run after I’ve logged in.

So according to this page:

According to this link .xinitrc in your home directory will be read and executed, otherwise the default /etc/X11/xinit/xinitrc is used. So you should be able to create this file and have the shell script started.

My script it simple:

#!/bin/env bash
export RCLONE_CONFIG_PASS='<myPasswordImNotShaaring>' && echo 'rClone configuration password set!' || echo 'Problem setting rClone configuration password'

So from what I’m seeing yours is correct., but maybe uneccesary, so try the following:
Note: I have no idea if this’ll even work.

Assuming your xranr command is correct, append it to /etc/X11/xinit/xinitrc:

echo 'xrandr --output HDMI1 --primary --mode 1920x1080 --rate 74.97 --output DPI1 --mode 1440x900 --rate 74.98 --left-of HDMI1' | sudo tee -a /etc/X11/xinit/xinitrc

NOTE: Once again, I have o idea if this is correct, or wil work.

1 Like

What I meant to say is that I messed up my monitor settings on purpose and than executed the script to see if it worked and it does.
I did this to be sure I typed it out correctly and tested with the original shebang and the one you suggested.
The problem is that, after shutdown/reboot, my primary monitor is still the wrong one even if xrandr output and system settings say otherwise…

Hi @Mirdarthos!
I tried the command you suggested but still nothing :slightly_frowning_face:
Same problem I described in the other post

Well, now you know…if nothing else…because…now I’M the one that’s out of ideas…

1 Like

Thank you for the clarification.

Does this mean the script doesn’t correct anything after you log on and execute it manually?

:thinking:

1 Like

Exactly!
That’s why I’m having such a hard time with a somewhat trivial problem…

Are you using a converter or straight HDMI to HDMI or DVI to DVI or DP to DP cables?

:upside_down_face:

Straight cables, no converter!

Or we’re all going totally bonkers here, or your machine is just crazy.

Set the bloody low-res monitor as primary and the high-res as secondary and live with it…

Sorry!

:stuck_out_tongue_winking_eye: :crazy_face: :upside_down_face:

1 Like

Don’t worry man, maybe you’re right :joy:
It just doesn’t make sense, that’s what really bothers me, but I wasted too much time over this…
Let’s hope for a fix in the future, thank you!

1 Like

I’ve marked this answer as the solution to your question as it is by far the best answer you’ll get.

However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (If you disagree with my choice, just send me a personal message and explain why I shouldn’t have done this or :heart: or :+1: if you agree)

:innocent:
P.S. In the future, please don’t forget to come back and click the 3 dots below the answer to mark a solution like this below the answer that helped you most:
Solution
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.

1 Like

Little update:

I installed XFCE, it’s been a long time coming anyway…
Now everything works as it should!
So yeah… I love KDE from the bottom of my hearth but it was driving me nuts lately :frowning_face:

1 Like

I’ve never had any problems with KDE: it does everything I need and more!

:thinking:

1 Like

I’ve never had any problem on my laptop either and it’s still rockyng KDE :sunglasses:
It’s just that is a pain on my desktop, especially managing a dual monitor setup.
But hey, XFCE looks better than I remembered and the important thing to me is that my PCs are powered by Manjaro

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.