Instalando e configurando o xorg

From ArchWiki

Jump to: navigation, search
Image:Tango-preferences-desktop-locale.png This page was marked to be translated.
If you understand both "original" and "target" languages of this page, please help complete the translation.
i18n
English
Français
Русский
繁體中文

This page should be merged with Xorg into one perfect article.


O xorg é a implementação de código aberto do sistem X11 X Windows (consultar o artigo na Wikipedia sobre o X.org ou X.org para mais detalhes). Basicamente, se quiseres uma GUI no Arch, vais querer o xorg.


Important: You may also want to see this newer article about installing and configuring Xorg.

Contents

Instalando o xorg

Antes de começares, certifica-te que fazes o seguinte:

  1. Certifica-te que o pacman está configurado e actualizado.
  2. Se estiveres a correr outro servidor de X, podes fechá-lo agora. ctrl+alt+backspace
  3. Anota drivers de terceiros que possas necessitar (ex.:, drivers nVidia ou ATI).

Instalar o xorg é fácil:

# pacman -S xorg

Se a instalação do xorg decorreu sem problemas, é altura de criar o xorg.conf com o xorgconfig.

Configurando o xorg

Antes que possas correr o xorg, precisas de o configurar, de modo a que ele saiba sobre a tua placa gráfica, monitor, rato e teclado. Há vários métodos.

xorgconfig

To start up xorgconfig:

xorgconfig

Isto irá gerar um novo xorg.conf.

Answer the questions and the program makes the file for you. NB watch out for the question about your mouse device. The default device according to xorgconfig is /dev/mouse. However, you should change this to /dev/input/mice. Otherwise, you may encounter the common problem of X freezing on when executed.

This program is not really good but it's a start and you can fill in special stuff manually afterwards.

hwd

hwd is a tool written by users in the Arch Linux community. It's basically a hardware detection tool that has multiple uses, one of which is setting up an X server. Fortunately, hwd is much more streamlined than xorgconf and doesn't require any input at all.

First, you need to install it:

pacman -S hwd


Then you need to run it (as root) with the -x argument that tells it to generate an xorg.conf

hwd -x

This will not overwrite any existing xorg configuration file and instead creates a new file /etc/X11/xorg.conf.hwd (Alternatively, you could have used -xa flag which would have overwritten straight to xorg.conf). To use this, you must manually rename it:

mv xorg.conf.hwd xorg.conf

NB If you have an existing xorg.conf, you may wish to back up prior to running this command.

Xorg -configure

Podes usar também

Xorg -configure

ou

X -configure

nvidia-xconfig

nVidia users can also use

nvidia-xconfig

when they have official nvidia drivers installed.

Editando o xorg.conf

You may wish to edit the config after it's been generated. To open in your favourite text-editor, such as Vim (you need root privileges):

vim /etc/X11/xorg.conf

If you want to set up mouse wheel support, see Get All Mouse Buttons Working.

Configuração do Monitor

Dependendo do teu hardware, o Xorg pode falhar na detecção correcta das capacidades do teu monitor ou podes simplesmente desejar utilizar uma resolução menor da que o teu monitor é capaz. As seguintes definições são definidas na secção Monitor:

Horizontal Sync

HorizSync 28-64

Taxa de Actualização

VertRefresh 60

As seguintes definições estão na secção Screen:

Profundidade de Cor

Depth 24

Resolução

Modes "1280x1024" "1024x768" "800x600"

Tamanho do monitor/DPI

Deves definir o tamanho real visível do teu monitor. Isto é importante para que o Xorg selecione o DPI correcto de acordo com a resolução utilizada. Na secção "Monitor" insere o tamanho do teu monitor em mm:

Section "Monitor"
 Identifier     "Monitor0"
   ...
 DisplaySize 336 252 # 96 DPI @ 1280x960
   ...
EndSection

The formula for calculating the DisplaySize values is (screen width)*25.4/dpi and (screen height)*25.4/dpi. As an example, if you're running X with a resolution of 1024x768 and want a dpi of 96, use 1024*25.4/96 and 768*25.4/96.

# calc: (x|y)pixels * 25.4 / dpi
# DisplaySize 168 126 # 96 DPI @ 640x480
# DisplaySize 210 157 # 96 DPI @ 800x600
# DisplaySize 269 201 # 96 DPI @ 1024x768
# DisplaySize 302 227 # 96 DPI @ 1152x864
# DisplaySize 336 252 # 96 DPI @ 1280x960
# DisplaySize 336 269 # 96 DPI @ 1280x1024 (non 4:3 aspect)
# DisplaySize 420 315 # 96 DPI @ 1600x1200

Results can be checked by issuing following command which should return 96x96 dots per inch

xdpyinfo | grep resolution

Keyboard Layout

To change the keyboard layout from the American default, use the XkbLayout option in the keyboard InputDevice section. For example:

Option "XkbLayout" "gb"


Autogenerated xorg.conf files may cause you problems. If you cannot get to tty1 by holding CTRL ALT and pressing F1 or cannot get the £ sign for gb people, check to see if the following entries are in your /etc/X11/xorg.conf:

Option "XkbLayout"  "uk"         #"uk" is not a real layout, look in /usr/share/X11/xkb/symbols/ for a list of real ones.
Option "XkbRules"   "xfree86"    #this should be "xorg"
Option "XkbVariant" "nodeadkeys" #This line is also known to cause the problems described, try commenting it out.

To switch between layouts with Alt+Shift:

Option "XkbOptions" "grp:Alt_shift_toggle,grp_led:scroll"

Drivers Proprietários

If you wish to use 3rd party graphics drivers, do check first that the X server runs ok first. Xorg should run smoothly without official drivers, they are typically only needed for advanced features such as 3D accelerated rendering for games, dual-screen setups, and TV-out. See NVIDIA for help with the nVidia drivers or ATI for ATI drivers.

Fontes

Consulta Xorg Font Configuration para algumas dicas na configuração das fontes.

Correndo o Xorg

This is done simply by typing:

startx

The default X environment is rather bare, and you will typically seek to install window managers or desktop environments to supplement X.

If a problem occurs, then view the log at /var/log/Xorg.0.log. Be on the lookout for any lines beginning with (EE) which represent errors, and also (WW) which are warnings that could indicate other issues.

*Please Note* Using startx requires a ~/.xinitrc file, so that X knows what to run when it starts. Your best option is to copy /etc/skel/.xinitrc to your home directory and edit it. Comment out the 'exec' lines you don't want, and add or uncomment one for the WM you want to use.

In addition, you can also install twm and xterm (via pacman) which will be used as a fallback if ~/.xinitrc does not exist.

X startup (/usr/X11R6/bin/startx) tweaking

for X's option reference see

man Xserver

The following options have to be appended to the variable "defaultserverargs" in the /usr/X11R6/bin/startx file.

prevent X from listening on tcp:

-nolisten tcp

getting rid of the gray weave pattern while X is starting and let X set a black root window:

-br

enable deferred glyph loading for 16 bit fonts:

-deferglyphs 16

Note : If you start X with kdm, the startx script seems not executed. These options must be appended to the variable "ServerCmd" in the /opt/kde/share/config/kdm/kdmrc file.

Ligações

Consultar também:

Ligações Externas:

Personal tools