Edit xorg.conf file properly

hi i am trying to edit my xorg.conf file properly in arch to just set the primary display on my hdmi and not my laptop screen i use arandr but it always goes back to default as i am using openbox as a de now i edited the autostart with xrandr --output HDMI1 --mode 1920x1080 _60 & but doest work

Try adding the --primary option to the HDMI output.

Or use arandr to generate a script (LayoutSave As) and add the contents of the script to the autostart file.

i tried editing xrandr with --primary at he end but it wouldn’t work now with arandr i have to keep setting the HDMI as primary and disabling the laptop screen as it doesn’t save itself how do i make a script i mean is there a tutorial

Once you have arandr arranged how you like select “Layout” in the menu bar at the top of the program and then choose “Save As” and type in a name for the script — it will be saved in the ~/.screenlayout/ directory by default (with a .sh suffix), which is a bit obscure.

and then add that autostart?

so arandr ~/.screenlayout/thename &?

Add the contents of the script (except the #!/bin/sh line) to ~/.config/openbox/autostart.

Or if you want to call the script directly instead then add

1 Like

i will give it a try im surprised it didnt work with the previous command because it works on my other machine but that doesn’t have dual monitors

# /etc/X11/xorg.conf.d/10-monitor.conf

Section "Monitor"
    Identifier  "VGA1"
    Option      "Primary" "true"

Section "Monitor"
    Identifier  "HDMI1"
    Option      "LeftOf" "VGA1"

ref: https://wiki.archlinux.org/index.php/Multihead#Configuration_using_xorg.conf