Setting up X.org screen resolution

ENGLISH: Ok guys. Today’s post is about when you can’t use Ubuntu’s graphical user interface to get that screen resolution right. We’ll have to manually edit the file /etc/X11/xorg.conf

Add the lines marked in bold. Here’s the resolution I needed for my notebook. You can change it to your prefered resolution. Remember to use root permissions (sudo) and save the file after changes have been made. Oh.. and BACKUP the original xorg.conf file! Duh!

# xorg.conf (X.Org X Window System server configuration file)

Section “Device”
Identifier    “Configured Video Device”
EndSection

Section “Monitor”
Identifier    “Configured Monitor”
EndSection

Section “Screen”
Identifier    “Default Screen”
Monitor        “Configured Monitor”
Device        “Configured Video Device”
SubSection “Display”
Depth     24
Modes    “1280×768” “1024×768”
EndSubSection

EndSection

Now let’s go on to a little bit of explanation. As you may have noticed, there are 2 resolutions there (1280×786 and 1024×768). Ok, the first resolution is the one you want X.org to use, and the second one is kind of like a fallback resolution in case things go wrong with the first option. You may add as many resolutions as you want. There’s even a keyboard shortcut to switch between them but I can’t really remember it right now. Sorry about that.

You can do the following command so to restart X.org and hopefully see your screen at the size you want it to be: sudo /etc/init.d/gdm restart

Alternatively, you may log out and log in back again, in case you still get to use GNOME, otherwise you’ll have to deal with the text interface. Using the text interface ain’t that big deal anyway… Wish you all luck 😉

PORTUGUÊS: Para ajustar a resolução do X.org manualmente quando o Ubuntu não detectar corretamente as configurações da placa de vídeo, adicione as linhas acima, marcadas em negrito, no arquivo /etc/X11/xorg.conf. Lembre-se de fazer uma cópia de segurança do arquivo antes de realizar qualquer alteração ao arquivo original.

Há duas resoluções que eu escolhi para meu notebook. Você poderá adicionar quantas quiser, sendo que a resolução a ser utilizada primariamente pelo X.org será a primeira listada na linha, no meu caso seria 1280×768. As resoluções seguintes serão utilizadas quando a resolução primária não funcionar.

Com o arquivo devidamente ajustado, reinicia-se o servidor X com o comando: sudo /etc/init.d/gdm restart

Boa sorte 🙂

2 thoughts on “Setting up X.org screen resolution

Leave a comment