# Xrandr --primary not working for some weeks (X not Wayland)

**URL:** <https://forum.endeavouros.com/t/xrandr-primary-not-working-for-some-weeks-x-not-wayland/41205>\
**Category:** Plasma\
**Created:** [May 25, 2023, 1:02pm UTC](https://forum.endeavouros.com/t/xrandr-primary-not-working-for-some-weeks-x-not-wayland/41205 "2023-05-25T13:02:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeterRies](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/peterries/32/119956_2.png) [@PeterRies](https://forum.endeavouros.com/u/PeterRies)\
**Post date:** [May 25, 2023, 1:02pm UTC](https://forum.endeavouros.com/t/xrandr-primary-not-working-for-some-weeks-x-not-wayland/41205/1 "2023-05-25T13:02:35Z")

</div>

Hi folks,

I have a little script to set my motniros just in case detection does not work and I can’t see anything. Set it to a keyboard shortcut to e. g. switch to internal right as main with big external left.

It used to work properly until (?) may be beginning of the year. Since detection in plasma is more reliable now I haven’t been using the script for a long while…

Problem now is that xrandr does not switch the Main Screen Flag anymore in Plasma.

Scenario.  
internal Laptop screen “eDP”  
external Dell screen “Display-Port-0”

I set e. g. main screen to Dell via dialog. Works.

If I want to set the main screen to Laptop later on (showing Taskbar etc.) I submit sth like  
xrandr --output eDP --primary  
No errors, but no effect also.

Has there been a change in xrandr or in Plasma that Plasma always superseeds xrandr setting with it’s own? Is there now acli command I can submit to switch the main screen?

Thanks for any ideas.

---

<div class="post-metadata">

**Author:** ![PeterRies](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/peterries/32/119956_2.png) [@PeterRies](https://forum.endeavouros.com/u/PeterRies)\
**Post date:** [May 25, 2023, 7:25pm UTC](https://forum.endeavouros.com/t/xrandr-primary-not-working-for-some-weeks-x-not-wayland/41205/2 "2023-05-25T19:25:17Z")

</div>

Found it.

I added the following after the xrandr command in my switch script (removed `--primary` option from xrandr as not working)

`kscreen-doctor config output.DisplayPort-0.primary`

or  
`kscreen-doctor config output.eDP.primary`

when needed on my laptop.

`kscreen-doctor --outputs` gives you the proper Display names.

---

<div class="post-metadata">

**Author:** ![system](https://forum.endeavouros.com/uploads/default/original/2X/9/9ea52f9fd5ef8e609e593c362d61a36295f48be8.png) [@system](https://forum.endeavouros.com/u/system)\
**Post date:** [May 27, 2023, 7:25pm UTC](https://forum.endeavouros.com/t/xrandr-primary-not-working-for-some-weeks-x-not-wayland/41205/3 "2023-05-27T19:25:32Z")

</div>

Closed on May 27, 2023, 7:25pm UTC

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