Sample Header Ad - 728x90

X11 not setting primary monitor according to config file

0 votes
2 answers
3718 views
^\_^ ### Synopsis I want to specify my primary monitor using system-wide X11 configuration files, but my present configuration files don't seem to do anything! 0_0 ### My situation I'm coming from the same place as this question here: https://unix.stackexchange.com/questions/565553/why-doesnt-x11-set-the-only-monitor-as-primary-by-default Namely, I need the only monitor I have connected to be recognized as my primary monitor so that my tray icons in i3 work. That said, I don't want to solve this using using xrandr, because I'm trying to use as much as possible the same dotfiles on two different machines which have different hardware configurations. Therefore, I would like to solve this using the system-wide X11 configuration files. However, it doesn't seem to work as expected. :o ### My present setup At present I have no xorg.conf file, and I do have a xorg.conf.d/10-monitor.conf, the contents of which (following [this Arch Linux wiki page](https://wiki.archlinux.org/index.php/Multihead#Configuration_using_xorg.conf)) are here:
Section "Monitor"
    Identifier  "HDMI2"
    Option      "Primary" "true"
EndSection
In light of this configuration file, here is my xrandr output for a fresh X session:
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP1 disconnected primary (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 480mm x 270mm
   1920x1080     60.00*+
   1600x1200     60.00  
   1680x1050     59.88  
   1400x1050     59.95  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x800      59.91  
   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  
HDMI3 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
As you can see, despite having specified HDMI2 in the configuration files as my primary monitor, DP1 is set as the primary. ### Stuff I've tried I've verified that my configuration file is being processed by X11 by introducing typos and observing that X11 fails to launch due to errors. I've tried placing the configuration file above in /etc/X11/xorg.conf instead of /etc/X11/xorg.conf.d/10-monitor.conf. I've tried including the following in an attempt to specify the default primary monitor as not primary:
Section "Monitor"
    Identifier  "DP1"
    Option      "Primary" "false"
EndSection
I've tried launching with the default xorg.conf generated by X -configure alongside my 10-monitor.conf. ### Miscellaneous information
$ uname -a
Linux cheesy-6600k 5.9.8-arch1-1 #1 SMP PREEMPT Tue, 10 Nov 2020 22:44:11 +0000 x86_64 GNU/Linux
$ lscpu | grep name
Model name:                      Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz
Asked by Aardbei (101 rep)
Nov 14, 2020, 06:15 PM
Last activity: Jun 13, 2025, 03:09 PM