Archlinug gdm xorg config¶
I needed to add a custom resolution to my graphical desktop to match my monitor.
xrandr¶
As i am running xorg (not wayland) i first figured out my modelines with xrandr.
The monitor has a resolution of 2560x1440
cvt 2560 1440 60
# 2560x1440 59.96 Hz (CVT 3.69M9) hsync: 89.52 kHz; pclk: 312.25 MHz
Modeline "2560x1440_60.00" 312.25 2560 2752 3024 3488 1440 1443 1448 1493 -hsync +vsync
Using this mode failed. Guess my graphics card (gtx 560ti) couldn’t handle the 300 Mhz output. But as the monitor is an lcd we can reduce the blank timings
cvt -r 2560 1440 60
# 2560x1440 59.95 Hz (CVT 3.69M9-R) hsync: 88.79 kHz; pclk: 241.50 MHz
Modeline "2560x1440R" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
So add the modeline to the running X-Server, add it to the output, and switch the output to this mode
xrandr --newmode "2560x1440R" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
xrandr --addmode HDMI-1 "2560x1440R"
xrandr --output HDMI-1 --mode "2560x1440R"
perfect. That was the easy part.
gdm¶
i want the login screen to show in the new custom resolution.
So i needed to figure out, how to run custom xrandr
within the displaymanager.
Nothing could be simpler. Drop a script in /etc/X11/xinit/xinitrc.d
.
Wrong. Gdm won’t use xinitrc.
Ok, add it to gdm itself. Documentation says i could do this via /etc/gdm
.
Wrong again. The official gdm documentation is out of date.
see https://bugzilla.gnome.org/show_bug.cgi?id=751602#c2 These init scripts are
no longer in use.
Well then, i need to add it the old way using xorg.conf. Drop a file in /etc/X11/xorg.conf.d/10-montitor.conf
Section "Monitor"
Identifier "Monitor0"
# the modeline cvt calculated
Modeline "2560x1440" 241.50 2560 2608 2640 2720 1440 1443 1448 1481 +hsync -vsync
# and also switch the monitor to this resolution
Option "PreferredMode" "2560x1440"
EndSection
Section "Device"
Identifier "Device0"
Driver "nouveau"
# graphics card as multiple outputs. Assign monitor to the right one
Option "Monitor-HDMI-1" "Monitor0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "2560x1440"
EndSubSection
EndSection