External monitor is being chosen as primary on boot


I have an external monitor connected to my laptop.
That external monitor (HDMI-0) is being chosen as my primary screen every time I boot into the system.
I have configured my i3 config file. I have created my monitor.sh file.

The issue is that every time I log in, both of my screens are on workspace 6, and when I look at arandr it shows a setup like this:

Where HDMI-0 is chosen as primary, even though I have not specified that anywhere.

Running xrandr in the terminal shows this:

I can change it when I am logged in, but I would like to just be able to log in to my setup chosen in the monitor.sh file.


Hello wiktor, welcome to :enos:
I use the openbox edition and for me to have my dual screen set up saved I added the following line into my autostart file


I am not sure how the i-3 autostart works but I saved my dual screen set up as dual.sh and told my computer to load it when I start. If I am not on my dual screen set up and just turn on my laptop it naturally defaults to the other file single.sh so I didn’t need to do anything to tell it to do that


Hi, thanks for the quick reply.

I have done the equivalent of this on my i3wm installation. The issue is that it doesn’t work as intended. I should probably add that I have an Nvidia card.

This is the section from the i3wm config file:

I have added the xrandr command there myself when trying to fix the issue.

Hmm, maybe try something like this
xrandr --output eDP-1-1 --auto --primary --output HDMI-0 --auto --right-of eDP-1-1
in your config file. This may put your eDP as primary and put your HDMI to the right of it

1 Like

This worked like a charm. Thank you so much for the help. Now my system starts with an xrandr setup for a single screen if my external monitor is disconnected and it starts with the dual monitor setup if my external monitor is connected.

1 Like

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