Sunday, February 13, 2011

Generate Xorg.conf, Remove Screen Blackout and Force Resolutions

New versions of most GNU/Linux distributions do not include an xorg.conf file which defines all your hardware and especially your video driver and screen resolutions/refresh rate. I find that I still need an xorg.conf file to disable screen blacking out after a set period of time and to force resolutions and screen refresh rate. I hate that gdm by default starts at max resolution, if you define resolutions it will force gdm to use the highest one you define instead. Most people don't care about this because they are running on LCD monitors, but I still prefer a CRT on my main computer.

Generate a proper Xorg.conf in Debian 6.0 Squeeze (probablly works for most GNU/Linux distributions)
Log out and switch to console mode(Ctrl+Alt+F1) as root or sudo do:
/etc/init.d/gdm3 stop
Xorg -configure #generate a new xorg.conf file
X -config /root/xorg.conf.new #test that it works
mv /root/xorg.conf.new /etc/X11/xorg.conf #move xorg.conf
nano /etc/X11/xorg.conf #edit with nano or editor of your choice
once your done editing do CTRL+O to save and CTRL+X to quit nano. You can now restart.
Or try /etc/init.d/gdm3 start and then startx

To remove/modify screen blank/black out:
Edit your xorg.conf as root/sudo
Between Section "ServerLayout" & EndSection add:
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
Also make sure you have Option "DPMS" between Section "Monitor" & End Section.

To define custom resolutions/refresh rate:
In xorg.conf:
Edit between Section "Screen" SubSection "Display" and EndSubSection EndSection

Mine looks like this:
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection
I am not sure why but I find that Depth 24 limits my refresh rate to 85Hz, which is what I prefer. If I try Depth 32 it makes my max resolution 1600x1200 even when I define 1280x1024 as max. I can't explain it but for some reason this odd behavior occurs, so 24 is what I use and I remove all other depths to prevent lower refresh rates. Here is my full xorg.conf as reference/guideline. I hope this can help someone.

No comments:

Post a Comment