How to setup external monitor with majaro i3?[Solved]

I have created a layout with arandr:
xrandr --output eDP1 --primary --mode 1920x1080 --pos 1920x0 --rotate normal --output HDMI1 --mode 1920x1080 --pos 0x0 --rotate normal --output VIRTUAL1 --off
How to make it persistent after every login ?
I tried appending it to the .xinitrc didnt wokred.

Find the solution just now:
First got to arandr customize your preferred layout.
Now your laptop and external display should be working fine but this layout is not saved upon the reboot.

For saving the external monitor and laptop layout do the following steps

  1. Install autorandr
    pip install autorandr

  2. Save your current current docked layout using autorandr
    autorandr --save docked

  3. Now you can execute the command autorandr --layout for choosing specific layout:
    for example:
    autorandr --mobile

  4. Now running this layout on every boot add the autorandr command to i3 config:

exec autorandr mobile

1 Like