HOWTO: Making a Xorg.conf

09Jun10

Screen resolution. Too large, and everything is too tiny. Too small, and nothing fits on the screen.

I was having a problem with my Openbox desktop on my main computer. For whatever reason, even if I set it with lxrandr or grandr, once I logout, the setting doesn’t seem to save. Everytime I logged in, I had to change it from 1024×768 back to 1280×1024. Irritating >.<

So I decided to set the resolution for good in the xorg.conf. But Ubuntu 9.10 (and above as far as I know) don’t have a xorg.conf by default. Xorg automatically configures itself at every boot. After a lot of searching, I couldn’t find where this autocreated xorg.conf is stored, so I decided to create my own. If Xorg finds a xorg.conf file in /etc/X11/ as it starts up, it’ll use that, rather than autoconfigure itself :)

In a nutshell, cutting out a lot of confusion, here’s what I did. I executed

 sudo Xorg -configure 

This generated a xorg.conf.new in my ~/user directory. And it looked rather like this [Pastebin].

I trimmed it down and made a few key changes. I changed;

Section "Monitor"
	#DisplaySize	  320   240	# mm
	Identifier   "Monitor0"
	VendorName   "HWP"
	ModelName    "hp v72"
	HorizSync    30.0 - 70.0
	VertRefresh  50.0 - 140.0
	Option	    "DPMS"
EndSection

To look like;

Section "Monitor"
 #DisplaySize      320   240    # mm
 Identifier   "Monitor0"
 VendorName   "HWP"
 ModelName    "hp v72"
 HorizSync    30.0 - 70.0
 VertRefresh  50.0 - 140.0
 Option "PreferredMode" "1280x1024"
 Option        "DPMS"
EndSection

Lastly, I changed the Screen section from;

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
EndSection

To;

Section "Screen"
 Identifier "Screen0"
 Device     "Card0"
 Monitor    "Monitor0"
 DefaultDepth 24
 SubSection "Display"
 Depth        24
 Modes      "1280x1024_50.00"
 EndSubSection
EndSection

Hopefully this is clear enough to follow. There’s a great thread over at Ubuntu Forums about the xorg.conf file, and it really helped me. Here’s my final xorg.conf [Pastebin] too, really just so I can find it again, I know I’ll be looking for it later ;)

About these ads


Follow

Get every new post delivered to your Inbox.

Join 69 other followers

%d bloggers like this: