https://wiki.archlinux.org/api.php?action=feedcontributions&user=Derelict&feedformat=atomArchWiki - User contributions [en]2024-03-29T15:32:49ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Syslinux&diff=177737Syslinux2012-01-10T21:38:32Z<p>Derelict: /* I have a Syslinux Prompt - Yikes! */</p>
<hr />
<div>[[Category:Boot loaders (English)]]<br />
{{i18n|Syslinux}}<br />
<br />
{{Article summary start}}<br />
{{Article summary text|Describes installing and configuring Syslinux, a collection of bootloaders.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Boot process overview}}}}<br />
{{Article summary end}}<br />
<br />
Syslinux is a collection of boot loaders capable of booting from hard drives, CDs and over the network via PXE. It supports the fat, ext2, ext3, ext4 and btrfs file systems.<br />
<br />
{{Note|Since Syslinux 4, Extlinux and Syslinux are the same thing.}} <br />
<br />
== Syslinux Boot Process ==<br />
At boot, the computer loads the [[MBR]] ({{Filename|/usr/lib/syslinux/mbr.bin}}). Then the MBR looks for the partition that is marked as active (boot flag). Once found, the volume boot record (VBR) will be executed. In the case of ext2/3/4 and fat12/16/32, the starting sector of {{Filename|ldlinux.sys}} is hard-coded into the VBR. The VBR will execute ({{Filename|ldlinux.sys}}). Therefore, if the location of {{Filename|ldlinux.sys}} changes, syslinux will no longer boot. In the case of btrfs, the above method will not work since files move around resulting in the sector location of {{Filename|ldlinux.sys}} changing. Therefore, the entire Syslinux code needs to be stored outside the filesystem. The code is stored in the sectors following the VBR. Once Syslinux is fully loaded, it looks for a configuration file, either {{Filename|extlinux.conf}} or {{Filename|syslinux.cfg}}. If one is found, the configuration file is loaded. If no configuration file is found you will be given a syslinux prompt.<br />
<br />
==Installation==<br />
===Automatic Install - syslinux===<br />
The syslinux-install_update script will install Syslinux, copy COM32 modules to {{Filename|/boot/syslinux}}, set the boot flag and install the MBR. It can handle MBR and GPT disks along with softraid.<br />
<br />
1. Install Syslinux<br />
pacman -S syslinux<br />
2. Make sure {{Filename|/boot}} is mounted<br/><br />
3. Run syslinux-install_update script -i (install) -a (set boot flag) -m (install mbr)<br />
/usr/sbin/syslinux-install_update -iam<br />
4. Edit {{Filename|/boot/syslinux/syslinux.cfg}}<br />
<br />
===Manual Install - syslinux===<br />
{{Note| If you are unsure of which partition table you are using (MBR or GPT), you are likely using the MBR partition table. Most of the time, GPT will create a special MBR-style partition (type 0xEE) using the whole disk which will be displayed with the following command:<br />
# fdisk -l /dev/sda<br />
or alternatively<br />
# sgdisk -l /dev/sda<br />
will show " GPT: not present" if it is not a GPT disk.<br />
}}<br />
<br />
{{Note| If you are trying to rescue an installed system with a live CD, be sure to [[Change_Root|chroot]] into it before executing these commands. If you do not chroot first, you must prepend all file paths (not /dev/ paths) with the mount point.}}<br />
<br />
Make sure you have the ''syslinux'' package installed. Then install Syslinux onto your boot partition, which must contain a fat, ext2, ext3, ext4, or btrfs file system.<br />
# mkdir /boot/syslinux<br />
# extlinux --install /boot/syslinux <br />
You should run it on a mounted directory, not a /dev/sdXY device. /boot/syslinux/ is device /dev/sda1.<br />
<br />
====MBR Partition Table====<br />
Next, you need mark your boot partition active in your partition table. Applications capable of doing this include fdisk, cfdisk, sfdisk, (g)parted. It should look like this:<br />
# fdisk -l /dev/sda<br />
[...]<br />
Device Boot Start End Blocks Id System<br />
/dev/sda1 * 2048 104447 51200 83 Linux<br />
/dev/sda2 104448 625142447 312519000 83 Linux<br />
<br />
Install the master boot record:<br />
# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/mbr.bin of=/dev/sda<br />
<!-- conv=notrunc helps if /dev/sda is actually a file not a block device --><br />
<br />
====GUID Partition Table aka GPT====<br />
Main article [[GUID Partition Table]].<br />
<br />
Bit 2 of the attributes for the {{Filename|/boot}} partition need to be set.<br />
<br />
# sgdisk /dev/sda --attributes=1:set:2<br />
<br />
This would toggle the attribute legacy BIOS bootable on partition 1 <br />
<br />
Verify:<br />
# sgdisk /dev/sda --attributes=1:show<br />
1:2:1 (legacy BIOS bootable)<br />
<br />
Install the master boot record:<br />
# dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda<br />
<br />
====Rebooting====<br />
When you reboot your system now, you will have a syslinux prompt. To automatically boot your system or get a boot menu, you still need to create a configuration file.<br />
<br />
== Configuring syslinux ==<br />
The syslinux configuration file, {{Filename|syslinux.cfg}} should be created in the same directory where you installed syslinux. In our case '/boot/syslinux/'<br />
<br />
The bootloader will look for either {{Filename|syslinux.cfg}} (preferred) or {{Filename| extlinux.conf}}<br />
<br />
'''Tips''':<br />
*Instead of LINUX, the keyword KERNEL can also be used. KERNEL tries to detect the type of the file, while LINUX always expects a Linux kernel.<br />
*TIMEOUT value is in units of 1/10 of a second.<br />
<br />
=== Examples ===<br />
==== Basic Syslinux Config ====<br />
This is a simple configuration file that will show a boot: prompt and automatically boot after 5 seconds.<br />
<br />
Config:<br />
PROMPT 1<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
If you want to boot directly without seeing a prompt, set PROMPT to 0.<br />
<br />
If you want to use [[UUID]] for persistent device naming instead of device names, change:<br />
APPEND root=/dev/sda2 ro<br />
<br />
to:<br />
APPEND root=UUID=<uuid here> ro<br />
<br />
==== Text Boot menu ====<br />
Syslinux also allows you to use a boot menu. To use it, copy the menu COM32 module to your syslinux folder:<br />
# cp /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
If /boot is in the same partition as /usr, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/menu.c32 /boot/syslinux/<br />
<br />
Config:<br />
UI menu.c32<br />
PROMPT 0<br />
<br />
MENU TITLE Boot Menu<br />
TIMEOUT 50<br />
DEFAULT arch<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX /vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD /initramfs-linux-fallback.img<br />
<br />
For more details about the menu system, see http://git.kernel.org/?p=boot/syslinux/syslinux.git;a=blob;f=doc/menu.txt.<br />
<br />
==== Graphical Boot menu ====<br />
Syslinux also allows you to use a graphical boot menu. To use it, copy the vesamenu COM32 module to your syslinux folder:<br />
# cp /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
If {{Filename|/boot}} is the same partition as {{Filename|/}}, a symlink will also work:<br />
# ln -s /usr/lib/syslinux/vesamenu.c32 /boot/syslinux/<br />
<br />
[http://projects.archlinux.org/archiso.git/tree/configs/releng/syslinux This config] uses the same menu design as the Arch Install CD. The background file can be found there too.<br />
<br />
Config:<br />
UI vesamenu.c32<br />
DEFAULT arch<br />
PROMPT 0<br />
MENU TITLE Boot Menu<br />
MENU BACKGROUND splash.png<br />
TIMEOUT 50<br />
<br />
MENU WIDTH 78<br />
MENU MARGIN 4<br />
MENU ROWS 5<br />
MENU VSHIFT 10<br />
MENU TIMEOUTROW 13<br />
MENU TABMSGROW 11<br />
MENU CMDLINEROW 11<br />
MENU HELPMSGROW 16<br />
MENU HELPMSGENDROW 29<br />
<br />
# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu<br />
<br />
MENU COLOR border 30;44 #40ffffff #a0000000 std<br />
MENU COLOR title 1;36;44 #9033ccff #a0000000 std<br />
MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all<br />
MENU COLOR unsel 37;44 #50ffffff #a0000000 std<br />
MENU COLOR help 37;40 #c0ffffff #a0000000 std<br />
MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std<br />
MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std<br />
MENU COLOR msg07 37;40 #90ffffff #a0000000 std<br />
MENU COLOR tabmsg 31;40 #30ffffff #00000000 std<br />
<br />
<br />
LABEL arch<br />
MENU LABEL Arch Linux<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux.img<br />
<br />
<br />
LABEL archfallback<br />
MENU LABEL Arch Linux Fallback<br />
LINUX ../vmlinuz-linux<br />
APPEND root=/dev/sda2 ro<br />
INITRD ../initramfs-linux-fallback.img<br />
<br />
<br />
Since Syslinux 3.84 vesamenu.c32 supports the "MENU RESOLUTION $WIDTH $HEIGHT" directive.<br />
To use it, insert "MENU RESOLUTION 1440 900" into your config for a 1440x900 resolution.<br />
The background picture has to have exactly the right resolution however as syslinux will otherwise refuse to load the menu.<br />
<br />
=== Chainloading ===<br />
If you want to chainload other operating systems (such as Windows) or boot loaders, copy (or symlink) the ''chain.c32'' module to the syslinux folder (for details, see the instructions in the previous section). Then, create a section in the configuration file:<br />
<br />
LABEL windows<br />
MENU LABEL Windows<br />
COM32 chain.c32<br />
APPEND hd0 3<br />
<br />
''hd0 3'' is the third partition on the first BIOS drive - drives are counted from zero, but partitions are counted from one. For more details about chainloading, see [http://syslinux.zytor.com/wiki/index.php/Comboot/chain.c32].<br />
<br />
If you have [[grub2]] installed in your boot partition, you can chainload it by using: <br />
<br />
LABEL grub2<br />
MENU LABEL Grub2<br />
COM32 chain.c32<br />
append file=../grub/boot.img<br />
<br />
This maybe required for booting from iso images.<br />
<br />
=== Using memtest ===<br />
Use this LABEL section to launch memtest (install the ''memtest86+'' package):<br />
<br />
LABEL memtest<br />
MENU LABEL Memtest86+<br />
LINUX ../memtest86+/memtest.bin<br />
<br />
=== HDT ===<br />
HDT (Hardware Detection Tool) displays hardware information. Like before, the .c32 file has to be copied or symlinked from /boot/syslinux/.<br />
For pci info either copy or symlink {{Filename|/usr/share/hwdata/pci.ids}} to {{Filename|/boot/syslinux/pci.ids}}<br />
<br />
LABEL hdt<br />
MENU LABEL Hardware Info<br />
COM32 hdt.c32<br />
<br />
=== Reboot and power off ===<br />
Use the following sections to reboot or power off your machine.<br />
<br />
LABEL reboot<br />
MENU LABEL Reboot<br />
COM32 reboot.c32<br />
<br />
LABEL poweroff<br />
MENU LABEL Power Off<br />
COMBOOT poweroff.com<br />
=== Clear Menu ===<br />
To clear the screen when exiting the menu, add the following line.<br />
MENU CLEAR<br />
<br />
==Troubleshooting==<br />
===I have a Syslinux Prompt - Yikes!===<br />
You can type in the LABEL name of the entry that you want to boot (as per your syslinux.cfg). If you used the example configs just type<br />
boot: arch<br />
<br />
If you get an error that the config file could not be loaded you can pass your needed boot parameters, e.g.:<br />
boot: ../vmlinuz-linux root=/dev/sda2 ro initrd=../initramfs-linux.img<br />
<br />
If you do not have access to 'boot:' in ramfs, and therefore temporarily unable to boot kernel again<br />
<br />
1) create temp directory, in order to mount your root partition (if it does not exist already)<br />
<br />
mkdir -p /new_root<br />
<br />
2) mount / under /new_root (in case /boot/ is on same partition, otherwise you will need to mount them both) '''Note: if /boot is on it's own ext2 partition then busybox cannot mount it.'''<br />
<br />
mount /dev/sd[a-z][1-9] /new_root<br />
<br />
3) use 'vi' and edit syslinux.cfg again to suit your needs and save file;<br />
<br />
4) reboot<br />
<br />
===No Default or UI found on some computers===<br />
Certain motherboard manufacturers have less compatibility for booting from USB devices than others. While an ext4 formatted usb drive may boot on a more recent computer, some computers may hang if the boot partition containing the kernel and initrd are not on a fat16 partition. to prevent an older machine from loading ldlinux and failing to read syslinux.cfg, use cfdisk to create a fat-16 partition (<=2GB) and format with <br />
# pacman -S dosfstools<br />
# mkfs.msdos -F 16 /dev/sda1<br />
then install and configure syslinux.<br />
<br />
===Windows boots up! No Syslinux!===<br />
'''Solution:''' Make sure the partition that contains /boot has the boot flag enabled. Also, make sure the boot flag is not enabled on the windows partition. See the installation section above.<br />
<br />
The MBR that comes with syslinux looks for the first active partition that has the boot flag set. The windows partition was likely found first and had the boot flag set. If you wanted you could use the MBR that windows or msdos fdisk provides.<br />
<br />
===Menu Entries do nothing===<br />
You select a menu entry and it does nothing. It "refreshes" the menu<br/><br />
This usually means that you have an error in your configuration. Hit {{Keypress| TAB }} to edit your boot parameters. Alternatively, press {{Keypress| ESC}} and type in the LABEL of your boot entry (Example: arch)<br />
<br />
===Cannot remove ldlinux.sys===<br />
ldlinux.sys has the immutable attribute set which prevents the file from being deleted or overwritten. This is because the sector location of the file must not change or else syslinux has to be reinstalled.<br />
To remove: <br />
chattr -i /boot/syslinux/ldlinux.sys<br />
rm /boot/syslinux/ldlinux.sys<br />
<br />
===A white block on the upper left corner appears when a kernel is loaded with modesetting on in early stage and when using vesamenu===<br />
'''Brain0''' said: ''As of linux-3.0, the modesetting driver tries to keep the current contents of the screen after changing the resolution (at least it does so with my intel, when having syslinux in text mode). It seems that this goes wrong when combined with the vesamenu module in syslinux (the white block is actually an attempt to keep the syslinux menu, but the driver fails to capture the picture from vesa graphics mode).''<br />
<br />
If you have a custom resolution and a vesamenu, with early modesetting try to append the following in the '''kernel line''' in syslinux.cfg to remove the white block and continue in graphics mode:<br />
<br />
APPEND root=/dev/sda6 ro 5 radeon.modeset=1 '''vga=current''' logo.nologo quiet splash<br />
<br />
== External link ==<br />
* [http://syslinux.zytor.com/ The Syslinux Project]'s website.</div>Derelicthttps://wiki.archlinux.org/index.php?title=Xorg&diff=117430Xorg2010-09-15T20:48:09Z<p>Derelict: /* Getting started */</p>
<hr />
<div>[[Category:X Server (English)]] [[Category:HOWTOs (English)]]<br />
{{i18n|Xorg}}<br />
{{Article summary start| Summary }}<br />
{{Article summary text|An all-inclusive overview about installing and managing Xorg}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|ATI}}<br />
{{Article summary wiki|Intel}}<br />
{{Article summary wiki|NVIDIA}}<br />
{{Article summary end}}<br />
'''Xorg''' is the public, open-source implementation of the X window system version 11. Since Xorg is the most popular choice among Linux users, its ubiquity has led to making it an ever-present requisite for GUI applications, resulting in massive adoption from most distributions. See the [[Wikipedia:X.Org Server|Xorg]] Wikipedia article or visit the [http://www.x.org/wiki/ Xorg website] for more details.<br />
<br />
==Installing==<br />
<br />
First, fully update your system<br />
# pacman -Syu<br />
<br />
Then you can install the Xorg group<br />
# pacman -S xorg<br />
<br />
Since v.1.8, Xorg-server '''doesn't need HAL for hardware access'''. Udev can detect your hardware itself.<br />
<br />
Don't forget to install [[evdev]].<br />
# pacman -S xf86-input-evdev<br />
<br />
You can remove HAL from your startup daemon in {{filename|/etc/rc.conf}} without problem, but '''only if you don't have any other app installed in your system that may need HAL as a dependency.'''<br />
Moreover, the settings that were located in the {{filename|/etc/X11/xorg.conf}} file, can be found now in the files located in the {{filename|/etc/X11/xorg.conf.d/}} directory. <br />
<br />
<br />
Udev should be capable of detecting your hardware without problems. Just in case there should be a problem, you could install the whole '''xorg-input-drivers''' group.<br />
<br />
Xorg-server can be initiated by the '''startx''' command. You should only use it in case you have properly edited the ~/.'''xinitrc''' file. <br />
<br />
{{Note|In case you are using a Desktop Environment (GNOME, KDE etc), you are encouraged to use a DM (KDM, GDM etc), which will manage the, possible, DE specific apps and libs which should be preloaded.}}<br />
<br />
==Configuring==<br />
<br />
Configuration files are located in {{filename|/etc/X11/xorg.conf.d/}}.<br />
<br />
You should have {{filename|10-evdev.conf}} which manages the keyboard, the mouse, the touchpad and the touchscreen.<br />
You are free to create new config files, but they must start with '''XX-''' (where XX is a number) and have a '''.conf''' suffix (10 read before 20 for example).<br />
<br />
===Touchpad/Synaptics===<br />
<br />
If you have a laptop, you need to install the touchpad driver.<br />
# pacman -S xf86-input-synaptics<br />
<br />
After installation, you can find {{filename|10-synaptics.conf}} in the {{filename|/etc/X11/xorg.conf.d}} directory. It is safe to comment out/delete the "InputClass" line regarding the touchpad in {{filename|10-evdev.conf}}.<br />
<br />
===Graphics card and driver===<br />
The default graphics driver is Vesa, which handles a large number of chipsets but does not include any 3d acceleration. To enable graphics acceleration, you will need to install and use the driver specific to your graphics card.<br />
<br />
First, identify your card:<br />
$ lspci | grep VGA<br />
<br />
Then, install an appropriate driver. You can ''search'' for these files with the following command:<br />
# pacman -Ss xf86-video<br />
<br />
====Proprietary drivers====<br />
<br />
Xorg should run smoothly without official drivers, which are typically needed only for advanced features such as 3D-accelerated rendering for games, dual-screen setups, and TV-out. See [[NVIDIA]] and [[ATI]].<br />
<br />
=====Nvidia=====<br />
<br />
During the installation of the proprietary [[NVIDIA]] driver, a config file ('''20-nvidia.conf''') will be installed in the {{filename|/etc/X11/xorg.conf.d}} directory. It allows Xorg to use nvidia's driver at Xorg start.<br />
<br />
===Monitor settings===<br />
<br />
==== Getting started ====<br />
<br />
{{Note|This step is OPTIONAL and shouldn't be done unless you know what you are doing.}}<br />
{{Note|This step is '''NOT OPTIONAL''' if using dual monitors or the nouveau driver. See [[Nouveau#Configuration]].}}<br />
<br />
First, create a new config file, for example, {{filename|/etc/X11/xorg.conf.d/10-monitor.conf}}.<br />
# nano /etc/X11/xorg.conf.d/10-monitor.conf<br />
Copy and paste the following code.<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "vesa" #Choose the driver used for this monitor<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0" #Collapse Monitor and Device section to Screen section<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 16 #Choose the depth (16||24)<br />
SubSection "Display"<br />
Depth 16<br />
Modes "1024x768_75.00" #Choose the resolution<br />
EndSubSection<br />
EndSection<br />
<br />
====Multiple monitors/Dual screen====<br />
<br />
=====Nvidia=====<br />
To activate dual screen support, you just need to edit the {{filename|10-monitor.conf}} file which you made before.<br />
<br />
Per each physical monitor, add one Monitor, Device, and Screen Section entry, and then a ServerLayout section to manage it. Be advised that when Xinerama is enabled, the Nvidia proprietary driver automatically disables compositing. If you desire compositing, you should comment the Xinerama line in "ServerLayout" out and use Twinview (see below) instead.<br />
<br />
Section "ServerLayout"<br />
Identifier "DualSreen"<br />
Screen 0 "Screen0"<br />
Screen 1 "Screen1" RightOf "Screen0" #Screen1 at the right of Screen0<br />
Option "Xinerama" "1" #To move windows between screens<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "Enable" "true" <br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Monitor1"<br />
Option "Enable" "true"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device0"<br />
Driver "nvidia"<br />
Screen 0<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Device1"<br />
Driver "nvidia"<br />
Screen 1<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Device0"<br />
Monitor "Monitor0"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1280x800_75.00"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen1"<br />
Device "Device1"<br />
Monitor "Monitor1"<br />
DefaultDepth 24<br />
Option "TwinView" "0"<br />
SubSection "Display"<br />
Depth 24<br />
EndSubSection<br />
EndSection<br />
<br />
======TwinView======<br />
You want only one big screen instead of two. Set the TwinView argument to 1. This option should be used instead of Xinerama (see above), if you desire compositing.<br />
Option "TwinView" "1"<br />
<br />
=====More than one graphic card=====<br />
You must define the good driver to use and put the ID bus of your graphic cards.<br />
Section "Device"<br />
Identifier "Screen0"<br />
Driver "nvidia"<br />
BusID "PCI:0:12:0"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Screen1"<br />
Driver "radeon"<br />
BusID "PCI:1:0:0"<br />
EndSection<br />
<br />
To get your ID bus :<br />
$ lspci | grep VGA<br />
01:00.0 VGA compatible controller: nVidia Corporation G96 [GeForce 9600M GT] (rev a1) <br />
<br />
The ID bus here is 1:0:0.<br />
<br />
====Display Size and DPI ====<br />
<br />
'''Q:''' How does the Xorg server calculate DPI? <br /><br />
'''A:''' The DPI of the X server is determined in the following manner:<br />
<br />
# The -dpi command line option has highest priority.<br />
# If this is not used, the DisplaySize setting in the X config file is used to derive the DPI, given the screen resolution.<br />
# If no DisplaySize is given, the monitor size values from DDC are used to derive the DPI, given the screen resolution.<br />
# If DDC does not specify a size, 75 DPI is used by default.<br />
<br />
In order to get correct dots per inch (DPI) set, the display size must be recognized or set. Having the correct DPI is especially necessary where fine detail is required (like font rendering). Previously, manufacturers tried to create a standard for 96 DPI (a 10.3" diagonal monitor would be 800x600, a 13.2" monitor 1024x768). These days, screen DPIs vary and may not be equal horizontally and vertically. For example, a 19" widescreen LCD at 1440x900 may have a DPI of 89x87. To be able to set the DPI, the Xorg server attempts to auto-detect your monitor's physical screen size through the graphic card with [http://en.wikipedia.org/wiki/Display_Data_Channel DDC]. When the Xorg server knows the physical screen size, it will be able to set the correct DPI depending on resolution size.<br />
<br />
To see if your display size and DPI are detected/calculated correctly:<br />
<br />
$ xdpyinfo | grep dimensions<br />
$ xdpyinfo | grep "dots per inch"<br />
<br />
Check that the dimensions match your display size. If the Xorg server is not able to correctly calculate the screen size, it will default to 75x75 DPI and you will have to calculate it yourself.<br />
<br />
If you have specifications on the physical size of the screen, they can be entered in the Xorg configuration file so that the proper DPI is calculated:<br />
<br />
<pre><br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
DisplaySize 286 179 # In millimeters<br />
EndSection<br />
</pre><br />
<br />
If you do not have specifications for physical screen width and height (most specifications these days only list by diagonal size), you can use the monitor's native resolution (or aspect ratio) and diagonal length to calculate the horizontal and vertical physical dimensions. Using the Pythagorean theorem on a 13.3" diagonal length screen with a 1280x800 native resolution (or 16:10 aspect ratio):<br />
<br />
echo 'scale=5;sqrt(1280^2+800^2)' | bc # 1509.43698<br />
<br />
This will give the pixel diagonal length and with this value you can discover the physical horizontal and vertical lengths (and convert them to millimeters):<br />
<br />
<pre><br />
echo 'scale=5;(13.3/1509)*1280*25.4' | bc # 286.43072<br />
echo 'scale=5;(13.3/1509)*800*25.4' | bc # 179.01920<br />
</pre><br />
<br />
{{Note|This calculation works for most monitor sizes; however, there is the seldom monitor that may compress aspect ratio (e.g 16:10 aspect resolution to a 16:9 monitor). If this is the case, you should measure your screen size manually.}}<br />
<br />
DPI can be set manually if you only plan to use one resolution:<br />
<br />
<pre><br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
Option "DPI" "96 x 96"<br />
EndSection<br />
</pre><br />
<br />
If, for some odd reason, the nvidia drivers don't set the correct DPI, you can turn off auto-detection:<br />
<br />
Option "UseEdidDpi" "false"<br />
<br />
For RandR compliant drivers, you can set it by: <br />
<br />
xrandr --dpi 96<br />
<br />
See [[Execute commands after X start]] to make it permanent.<br />
<br />
====DPMS====<br />
<br />
DPMS (Display Power Management Signaling) is a technology that allows power saving behaviour of monitors when the computer is not in use. This will allow you to have your monitors automatically go into standby after a predefined period of time. See: [[DPMS]]<br />
<br />
===Disabling Input Hot-plugging===<br />
Since version''' 1.8''' Xorg-server uses udev for device detection. The following will disable udev.<br />
<br />
Section "ServerFlags"<br />
Option "AutoAddDevices" "False"<br />
EndSection<br />
{{Note|This will disable Xorg hot-plugging for '''all''' input devices and revert to the same behavior as xorg-server 1.4. It is much more convenient to let udev configure your devices. '''Therefore, disabling hot-plugging is not recommended!''' See: [[Xorg Input Hotplugging]]}}<br />
<br />
===InputClasses ===<br />
'''Taken from: https://fedoraproject.org/wiki/Input_device_configuration'''<br />
<br />
InputClasses are a new type of configuration section that does not apply to a single device but rather to a class of devices, including hotplugged devices. An InputClass section's scope is limited by the ''matches'' specified &ndash; to apply to an input device, all matches must apply to a device. An example InputClass section is provided below:<br />
<br />
<pre><br />
Section "InputClass"<br />
Identifier "touchpad catchall"<br />
MatchIsTouchpad "on"<br />
Driver "synaptics"<br />
EndSection<br />
</pre><br />
<br />
The next snippet might also be helpful:<br />
<pre><br />
Section "InputClass" <br />
Identifier "evdev touchpad catchall" <br />
MatchIsTouchpad "on" <br />
MatchDevicePath "/dev/input/event*" <br />
Driver "evdev" <br />
EndSection<br />
</pre><br />
<br />
If this snippet is present in the {{Filename|xorg.conf}} or xorg.conf.d, any touchpad present in the system is assigned the synaptics driver. Note that due to precedence order (alphanumeric sorting of xorg.conf.d snippets) the Driver setting overwrites previously set driver options &ndash; the more generic the class, the earlier it should be listed. The default snippet shipped with the xorg-x11-drv-Xorg package is {{Filename|00-evdev.conf}} and applies the evdev driver to all input devices.<br />
<br />
The match options specify which devices a section may apply to. To match a device, all match lines must apply. The following match lines are supported (with examples):<br />
* {{Codeline|MatchIsPointer}}, {{Codeline|MatchIsKeyboard}}, {{Codeline|MatchIsTouchpad}}, {{Codeline|MatchIsTouchscreen}}, {{Codeline|MatchIsJoystick}} &ndash; boolean options to apply to a group of devices.<br />
* {{Codeline|MatchProduct "foo&#124;bar"}}: match any device with a product name containing either "foo" or "bar"<br />
* {{Codeline|MatchVendor "foo&#124;bar&#124;baz"}}: match any device with a vendor string containing either "foo", "bar", or "baz"<br />
* {{Codeline|MatchDevicePath "/dev/input/event*"}}: match any device with a device path matching the given patch (see fnmatch(3) for the allowed pattern)<br />
* {{Codeline|MatchTag "foo&#124;bar"}}: match any device with a tag of either "foo" or "bar". Tags may be assigned by the config backend &ndash; udev in our case &ndash; to label devices that need quirks or special configuration.<br />
<br />
An example section for user-specific configuration is:<br />
<br />
<pre><br />
Section "InputClass"<br />
Identifier "lasermouse slowdown"<br />
MatchIsPointer "on"<br />
MatchProduct "Lasermouse"<br />
MatchVendor "LaserMouse Inc."<br />
Option "ConstantDeceleration" 20<br />
EndSection<br />
</pre><br />
<br />
This section would match a pointer device containing "Lasermouse" from "Lasermouse Inc." and apply a constant deceleration of 20 on this device &ndash; slowing it down by factor 20.<br />
<br />
Some devices may get picked up by the X server when they really shouldn't be. These devices can be configured to be ignored:<br />
<br />
<pre><br />
Section "InputClass"<br />
Identifier "no need for accelerometers in X"<br />
MatchProduct "accelerometer"<br />
Option "Ignore" "on"<br />
EndSection<br />
</pre><br />
<br />
====Example configurations====<br />
<br />
The following subsections describe example configurations for commonly used configuration options. Note that if you use a desktop environment such as GNOME or KDE, options you set in the xorg.conf ''may'' get overwritten with user-specific options upon login.<br />
<br />
=====Example: Wheel Emulation (for a Trackpoint)=====<br />
<br />
If you own a computer with a Trackpoint (a Thinkpad for example) you can add the following to the {{Filename|xorg.conf}} to use the middle Button to emulate a mouse wheel:<br />
<br />
<pre><br />
Section "InputClass"<br />
Identifier "Wheel Emulation"<br />
MatchIsPointer "on"<br />
MatchProduct "TrackPoint"<br />
Option "EmulateWheelButton" "2"<br />
Option "EmulateWheel" "on"<br />
EndSection<br />
</pre><br />
<br />
For full support of TrackPoints (including horizontal scrolling) you can use the following:<br />
<pre><br />
Section "InputClass"<br />
Identifier "Trackpoint Wheel Emulation"<br />
MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device"<br />
MatchDevicePath "/dev/input/event*"<br />
Option "EmulateWheel" "true"<br />
Option "EmulateWheelButton" "2"<br />
Option "Emulate3Buttons" "false"<br />
Option "XAxisMapping" "6 7"<br />
Option "YAxisMapping" "4 5"<br />
EndSection<br />
</pre><br />
<br />
=====Example: Tap-to-click=====<br />
Tap-to-click can be enabled in the mouse configuration dialog (in the touchpad tab) but if you need tapping enabled at gdm already, the following snippet does it for you:<br />
<pre><br />
Section "InputClass"<br />
Identifier "tap-by-default"<br />
MatchIsTouchpad "on"<br />
Option "TapButton1" "1"<br />
EndSection<br />
</pre><br />
<br />
=====Example: Keyboard layout and model on Acer 5920G Laptop=====<br />
<br />
Keyboard model and layout may be set in the file {{filename|/etc/X11/xorg.conf.d/keyboard.conf}} or any other .conf file in the same directory.<br />
* {{Codeline|MatchIsKeyboard "yes"}}: set the input device to a keyboard<br />
* {{Codeline|Option "XkbLayout" "be"}}: set the keyboard layout to belgian. You may replace {{Codeline|be}} with whatever layout you have.<br />
* {{Codeline|Option "XkbModel" "acer_laptop"}}: set the keyboard model to an Acer laptop keyboard. You may replace {{Codeline|acer_laptop}} with your actual keyboard layout.<br />
<br />
Note that a list of keyboard layouts and models can be found in {{filename|/usr/share/X11/xkb/rules/base.lst}}<br />
<br />
<pre><br />
Section "InputClass"<br />
Identifier "Keyboard Defaults"<br />
MatchIsKeyboard "yes"<br />
Option "XkbLayout" "be"<br />
Option "XkbModel" "acer_laptop"<br />
EndSection<br />
</pre><br />
<br />
===Keyboard settings===<br />
<br />
Xorg may fail to detect your keyboard correctly. This might give problems with your keyboard layout or keyboard model not being set correctly.<br />
<br />
To see a full list of keyboard models, layouts, variants and options, open:<br />
<br />
/usr/share/X11/xkb/rules/xorg.lst<br />
<br />
To set the keymap for the current Xorg session:<br />
# setxkbmap dvorak<br />
<br />
====Key repeat delay and rate====<br />
<br />
Use {{Codeline|xset r rate DELAY RATE}} to change them, then use [[xprofile]] to make it permanent.<br />
<br />
====Viewing Keyboard Settings====<br />
$ setxkbmap -print -verbose 10 <br />
<pre><br />
Setting verbose level to 10 <br />
locale is C <br />
Applied rules from evdev: <br />
model: evdev <br />
layout: us <br />
options: terminate:ctrl_alt_bksp <br />
Trying to build keymap using the following components: <br />
keycodes: evdev+aliases(qwerty) <br />
types: complete <br />
compat: complete <br />
symbols: pc+us+inet(evdev)+terminate(ctrl_alt_bksp) <br />
geometry: pc(pc104) <br />
xkb_keymap { <br />
xkb_keycodes { include "evdev+aliases(qwerty)" }; <br />
xkb_types { include "complete" }; <br />
xkb_compat { include "complete" }; <br />
xkb_symbols { include "pc+us+inet(evdev)+terminate(ctrl_alt_bksp)" }; <br />
xkb_geometry { include "pc(pc104)" }; <br />
}; <br />
</pre><br />
<br />
<br />
====Setting Keyboard Layout With Hot-Plugging====<br />
To permanently change your keyboard layout, add the following to xorg.conf:<br />
<pre><br />
Section "InputClass"<br />
Identifier "Keyboard Defaults"<br />
MatchIsKeyboard "yes"<br />
Option "XkbLayout" "dvorak"<br />
EndSection<br />
</pre><br />
<br />
Note that this is in an InputClass Section and not the InputDevice section for the keyboard.<br />
<br />
====Setting Keyboard Layout Without Hot-Plugging (deprecated)====<br />
{{Note|Changing the keyboard layout through this method requires disabling input hot-plugging.}}<br />
<br />
To change the keyboard layout, use the XkbLayout option in the keyboard InputDevice section. For example, if you have a keyboard with English (Great Britain) layout, your keyboard InputDevice section might look similar to this:<br />
<br />
<pre><br />
Section "InputDevice"<br />
Identifier "Keyboard0"<br />
Driver "kbd"<br />
Option "XkbLayout" "gb"<br />
EndSection<br />
</pre><br />
<br />
To change the keyboard model, use the XkbModel option in the keyboard InputDevice section. For example, if you have a Microsoft Wireless Multimedia Keyboard:<br />
<br />
Option "XkbModel" "microsoftmult"<br />
<br />
====Switching Between Keyboard Layouts====<br />
To be able to easily switch keyboard layouts, modify the Options used in either of the above two methods. For example, to switch between a US and a Swedish layout using the Caps Lock key, use:<br />
<br />
Option "XkbLayout" "us, se"<br />
Option "XkbOptions" "grp:caps_toggle"<br />
<br />
This is mainly useful if you run a Desktop Environment which does not take care of keyboard layouts for you.<br />
<br />
====Disable mousekeys Permanently====<br />
To disable the mousekeys permanently and prevent Shift+NumLock or Shift+Alt+NumLock to enable, edit:<br />
/usr/share/X11/xkb/compat/complete<br />
and comment out:<br />
augment "mousekeys"<br />
augment "accessx(full)"<br />
<br />
===Fonts===<br />
<br />
There some tips for setting up fonts in [[Font Configuration]].<br />
<br />
===Sample xorg.conf Files===<br />
Anyone who has an Xorg.conf file written up that works, go ahead and post a link to it here for others to look at. Please do not in-line the entire configuration file; upload it somewhere else and link.<br /><br />
'''Please post input hotplugging configurations only, otherwise note that your config is not using input hotplugging.''' (Xorg 1.8 = udev)<br />
<br />
===== - Sample One: xorg.conf & xorg.conf.d/10-evdev.conf =====<br />
This is a sample configuration file using xorg.conf.d/10-evdev.conf for the keyboard layouts:<br /><br />
''Note: The "InputDevice" sections are commented out, because 10-evdev.conf is taking care of them.''<br />
xorg.conf: http://pastebin.com/raw.php?i=EuSKahkn<br />
xorg.conf.d/10-evdev.conf: http://pastebin.com/raw.php?i=4mPY35Mw><br />
xorg.conf.d/10-monitor.conf (VMWare): http://pastebin.com/raw.php?i=fJv8EXGb<br />
<br />
==Running Xorg==<br />
<br />
HAL starts dbus automatically. But if you have removed HAL from your DAEMONS array, you should add dbus instead:<br />
<br />
DAEMONS=(syslog-ng '''dbus''' network netfs crond)<br />
<br />
If you need to start dbus manually, run<br />
<br />
# /etc/rc.d/dbus start<br />
<br />
Finally, start Xorg:<br />
$ startx<br />
or<br />
$ xinit<br />
<br />
{{Note|If you just installed Xorg, there is an empty .xinitrc file in your $HOME that you need to either delete or edit in order for X to start properly. If you do not do this X will show a blank screen with what appears to be no errors in your Xorg.0.log. Simply deleting it will get it running with a default X environment.}}<br />
<br />
The default X environment is rather bare, and you will typically seek to install window managers or desktop environments to supplement X. A list of suitable options is present in [[Common Applications#Window Managers (WM)]].<br />
<br />
If a problem occurs, then view the log at {{Filename|/var/log/Xorg.0.log}}. Be on the lookout for any lines beginning with {{Codeline|(EE)}} which represent errors, and also {{Codeline|(WW)}} which are warnings that could indicate other issues.<br />
<br />
==Tips and tricks==<br />
<br />
===X startup (/usr/bin/startx) tweaking===<br />
For X's option reference see:<br />
$ man Xserver<br />
<br />
The following options have to be appended to the variable {{Codeline|"defaultserverargs"}} in the {{Filename|/usr/bin/startx}} file:<br />
<br />
* Enable deferred glyph loading for 16 bit fonts:<br />
-deferglyphs 16<br />
<br />
Note: If you start X with kdm, the startx script does not seem to be executed. X options must be appended to the variable {{Codeline|"ServerArgsLocal"}} or {{Codeline|"ServerCmd"}} in the {{Filename|/usr/share/config/kdm/kdmrc}} file. By default kdm options are:<br />
ServerArgsLocal=-nolisten tcp<br />
ServerCmd=/usr/bin/X<br />
<br />
===Virtual X session===<br />
To start another X session in, for example, CTRL + ALT + F8, you need to type this on a console:<br />
xinit /path/to/wm -- :1<br />
<br />
Change "/path/to/wm" to your window manager start file or to your login manager like gdm, kdm, or slim.<br />
<br />
===Nested X session===<br />
To run a nested session of another desktop environment:<br />
$ /usr/bin/Xnest :1 -geometry 1024x768+0+0 -ac -name Windowmaker & wmaker -display :1<br />
<br />
This will launch a Window Maker session in a 1024 by 768 window within your current X session.<br />
<br />
==Troubleshooting==<br />
===Common problems===<br />
If Xorg will not start, the screen is completely black, the keyboard and mouse are not working, etc., first take these simple steps:<br />
*Check the log file: {{codeline|cat /var/log/Xorg.0.log}}<br />
*Install input driver (keyboard, mouse, joystick, tablet, etc...):<br />
# pacman -S xf86-input-evdev<br />
*Finally, search for common problems in [[ATI]], [[Intel]] and [[NVIDIA]] articles.<br />
<br />
===Ctrl-Alt-Backspace doesn't work===<br />
There are two ways of restoring {{keypress|Ctrl}}+{{keypress|Alt}}+{{keypress|Backspace}}; with and without input-hotplugging. Using hot-plugging is recommended.<br />
<br />
====With input hot-plugging====<br />
In most situations, using user-specific configuration might be preferred over system-wide.<br />
<br />
{{Note|On GNOME, this system-wide setting has no effect. Every user must go to System -> Preferences -> Keyboard -> Layouts -> Options [button] -> Key sequence to kill the X server [expand with triangle on left]. Then check Ctrl + Alt + Backspace option.}}<br />
<br />
=====System-wide=====<br />
Add<br />
Option "XkbOptions" "terminate:ctrl_alt_bksp"<br />
to InputClass as so:<br />
<br />
<pre><br />
Section "InputClass"<br />
Identifier "Keyboard Defaults"<br />
MatchIsKeyboard "yes"<br />
Option "XkbOptions" "terminate:ctrl_alt_bksp"<br />
EndSection<br />
</pre><br />
<br />
=====User-specific=====<br />
Another way is to put this line in [[Execute commands after X start|the right file]]:<br />
setxkbmap -option terminate:ctrl_alt_bksp<br />
<br />
====Without input hot-plugging====<br />
New Xorg disables zapping with {{Keypress|Ctrl}}+{{Keypress|Alt}}+{{Keypress|Backspace}} by default. You can enable it by adding the following line to {{Filename|/etc/X11/xorg.conf}},<br />
Option "XkbOptions" "terminate:ctrl_alt_bksp" <br />
to {{codeline|InputDevice}} section for keyboard.<br />
<br />
===Apple keyboard issues===<br />
:''See: [[Apple Keyboard]]''<br />
<br />
===Touchpad tap-click issues===<br />
:''See: [[Synaptics]]''<br />
<br />
===Extra mouse buttons not recognized===<br />
:''See: [[Get All Mouse Buttons Working]]''<br />
<br />
===X clients started with "su" fail===<br />
If you are getting "Client is not authorized to connect to server", try adding the line:<br />
session optional pam_xauth.so<br />
to {{filename|/etc/pam.d/su}}. {{codeline|pam_xauth}} will then properly set environment variables and handle {{codeline|xauth}} keys.<br />
<br />
===Missing libraries===<br />
*Error message: "''libX... does not exist''"<br />
In most cases, all you need to do is take the name of the library (e.g., {{filename|libXau.so.1}}), convert it all to lowercase, remove the extension, and install it:<br />
# pacman -S libxau<br />
<br />
===Packages fail to build; missing X11 includes===<br />
Reinstall the packages xproto and libx11:<br />
# pacman -S xproto libx11<br />
<br />
===Program requests "font '(null)'"===<br />
*Error message: "''unable to load font `(null)'.''"<br />
Some programs only work with bitmap fonts. Two major packages with bitmap fonts are available, xorg-fonts-75dpi and xorg-fonts-100dpi. You do not need both; one should be enough. To find out which one would be better in your case, try this:<br />
$ xdpyinfo | grep resolution<br />
and use what is closer to you (75 or 100 instead of XX)<br />
# pacman -S xorg-fonts-XXdpi<br />
<br />
===Frame-buffer mode problems===<br />
If X fails to start with the following log messages,<br />
(WW) Falling back to old probe method for fbdev<br />
(II) Loading sub module "fbdevhw"<br />
(II) LoadModule: "fbdevhw"<br />
(II) Loading /usr/lib/xorg/modules/linux//libfbdevhw.so<br />
(II) Module fbdevhw: vendor="X.Org Foundation"<br />
compiled for 1.6.1, module version=0.0.2<br />
ABI class: X.Org Video Driver, version 5.0<br />
(II) FBDEV(1): using default device<br />
<br />
Fatal server error:<br />
Cannot run in framebuffer mode. Please specify busIDs for all framebuffer devices<br />
uninstall fbdev:<br />
# pacman -R xf86-video-fbdev<br />
<br />
===DRI with Matrox cards stops working===<br />
If you use a Matrox card and DRI stops working after upgrading to Xorg, try adding the line:<br />
Option "OldDmaInit" "On"<br />
to the Device section that references the video card in xorg.conf.<br />
<br />
===Recovery: disabling Xorg before GUI login===<br />
If Xorg is set to boot up automatically and for some reason you need to prevent it from starting up before the login/display manager appears (if {{filename|rc.conf}} is wrongly configured and Xorg does not recognize your mouse or keyboard input, for instance), you can accomplish this task with two methods.<br />
<br />
*From the grub menu, you can specify the runlevel in the kernel line by adding a number to the end of the kernel line specifying the run level you want. The following example sets the run level to 3:<br />
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/..ro 3<br />
<br />
*If you have not only a faulty {{filename|rc.conf}} to make Xorg unusable, but you have also set the grub menu wait time to zero, or cannot otherwise use grub to prevent Xorg from booting, you can use the Arch live CD. Boot up the live CD and login as root. You need a mount point, such as {{filename|/mnt}}, and you need to know the name of the partition you want to mount.<br />
<br />
:You can use the command,<br />
# fdisk -l<br />
:to see your partitions. Usually, the one you want will be resembling {{filename|/dev/sda1}}. Then, to mount this to {{filename|/mnt}}, use <br />
# mount /dev/sda1 /mnt<br />
<br />
:Then your file-system will show up under {{filename|/mnt}}. So your {{filename|rc.conf}} file, for example, would be in {{filename|/mnt/etc/rc.conf}}. From here you can delete the {{codeline|gdm}} module to prevent Xorg from booting up normally, or make any other necessary changes.<br />
<br />
==See also==<br />
* [[Display Manager]]<br />
* [[Execute commands after X start]]<br />
* [[Start X at boot]]<br />
* [[Font Configuration]]<br />
* Proprietary Video Drivers<br />
** [[ATI Catalyst]]<br />
** [[NVIDIA]]<br />
* [[Desktop Environment]]s<br />
** [[KDE]]<br />
** [[GNOME]]<br />
** [[Xfce]]<br />
** [[Enlightenment]]<br />
** [[LXDE]]<br />
* Window managers<br />
** [[Awesome3]]<br />
** [[Fluxbox]]<br />
** [[Openbox]]<br />
* [[Get All Mouse Buttons Working]]<br />
* [[Compiz]]</div>Derelicthttps://wiki.archlinux.org/index.php?title=Nouveau&diff=117429Nouveau2010-09-15T20:38:52Z<p>Derelict: /* Configuration */</p>
<hr />
<div>[[Category: Graphics (English)]]<br />
[[Category: X Server (English)]]<br />
[[Category: HOWTOs (English)]]<br />
{{i18n|Nouveau}}<br />
{{Article summary start}}<br />
{{Article summary text|This article details the installation of the Nouveau Open Source 3D acceleration graphics driver for NVIDIA cards. The name of the project refers to the fact that "nouveau" means "new" in French.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|KMS}}<br />
{{Article summary wiki|NVIDIA}}<br />
{{Article summary wiki|Xorg}}<br />
{{Article summary end}}<br />
<br />
[http://nouveau.freedesktop.org/wiki/ Nouveau] is an open source graphic driver for NVIDIA cards.<br />
Do not forget to check out the [http://nouveau.freedesktop.org/wiki/FAQ FAQ] if you have any questions, as there is a lot of valuable information there.<br />
<br />
==Installation==<br />
Before proceeding, have a look at the [http://nouveau.freedesktop.org/wiki/FeatureMatrix FeatureMatrix] to see what features are supported for a given architecture, and the list of [http://nouveau.freedesktop.org/wiki/CodeNames codenames] to determine the card's category.<br />
<br />
You could also consult [[Wikipedia:Comparison_of_Nvidia_Graphics_Processing_Units|wikipedia]] for a even more detailed list.<br />
<br />
Install the following package:<br />
# pacman -S xf86-video-nouveau<br />
<br />
In addition to {{Package Official|xf86-video-nouveau}}, install the package below for the highly experimental Mesa Gallium3D DRI drivers for Nouveau:<br />
# pacman -S nouveau-dri<br />
<br />
As of [http://cgit.freedesktop.org/nouveau/linux-2.6/commit/?id=d5f3c90d4f3ad6b054f9855b7b69137b97bda131 2010-02-25], nouveau automatically generates the firmware for nv50. Thus nouveau-firmware is no longer needed for any cards with nouveau-drm 0.0.15_20100313-1.<br />
<br />
==Loading==<br />
<br />
If you kept the proprietary nvidia driver installed, nouveau is probably not going to work.<br />
Either uninstall nvidia or blacklist it by adding the following line to /etc/modprobe.d/modprobe.conf<br />
blacklist nvidia<br />
<br />
Then nouveau should load fine automatically on next reboot. To test it now, first make sure nvidia is no longer loaded<br />
rmmod nvidia<br />
The load nouveau<br />
modprobe nouveau<br />
And check that it loaded fine by looking at kernel messages<br />
dmesg<br />
<br />
==Configuration==<br />
Create the file {{Filename|/etc/X11/xorg.conf.d/20-nouveau.conf}}, and input the following contents:<br />
Section "Device"<br />
Identifier "n"<br />
Driver "nouveau"<br />
EndSection<br />
This is required to ensure that nouveau driver is loaded. Udev is not yet smart enough to do this by itself. (The '''xf86-video-nouveau''' package maintainers should consider including this file.)<br />
<br />
==KMS==<br />
Kernel Mode-Setting ([[KMS]]) is supported by the Nouveau driver and upstream actually recommends testing it as it is the future implementation for all graphics chipsets. See the [http://nouveau.freedesktop.org/wiki/KernelModeSetting KernelModeSetting] page for more information.<br />
<br />
As of [http://cgit.freedesktop.org/nouveau/linux-2.6/commit/?id=8fb5c3ada2678defb0351e8b155c564471da05a7 2009-12-11], KMS is the default with the kernel module (with nouveau-drm 0.0.15_20091220-1 and higher). You can still disable it with nouveau.modeset=0 , however non KMS support was removed from xorg driver on [http://cgit.freedesktop.org/nouveau/xf86-video-nouveau/commit/?id=17485c234ff191cee3dd19e3dd693a80b024e189 2010-01-10] (xf86-video-nouveau 0.0.15_git20100117-1 and higher).<br />
<br />
===Late start===<br />
With this choice, KMS will be enabled when the boot process says, "Loading modules." This may cause an undesirable screen flicker as the mode changes.<br />
<br />
Remove all "vga=" and "video=" options from your kernel commandline in {{Filename|/boot/grub/menu.lst}}. Using other framebuffer drivers (such as uvesafb) will conflict with KMS.<br />
<br />
===Early start===<br />
{{Warning|If you have troubles with nouveau, and are led to rebuild nouveau-drm several times for testing purpose, do not add nouveau to the initramfs. It is too easy to forget to rebuild the initramfs and it will just make any testing harder. Just use ''late start''. There might be additional problems with initramfs if you need a firmware for the nv50 family}}<br />
<br />
This method will start KMS as early as possible in the boot process, when the [[initramfs]] is loaded. Here is how to do this with the official packages:<br />
<br />
1) Add "nouveau" to the ''MODULES'' array in {{Filename|/etc/mkinitcpio.conf}}:<br />
MODULES="'''nouveau''' ..."<br />
<br />
2) Add "/etc/modprobe.d/modprobe.conf" to the FILES section in {{Filename|/etc/mkinitcpio.conf}}:<br />
FILES="/etc/modprobe.d/modprobe.conf"<br />
<br />
3) Re-generate your initcpio:<br />
# mkinitcpio -p <''your kernel preset (kernel26, etc.)''><br />
<br />
<small>You can also look at the [[Intel]] instructions for an early start: [[Intel#KMS_.28Kernel_Mode_Setting.29|Intel Graphics:KMS (Kernel Mode Setting)]]</small><br />
<br />
==Alternative installation==<br />
If the official Arch Linux packages do not work, you can try a more current video driver from the [[AUR]]: {{Package AUR|xf86-video-nouveau-git}}. A more up-to-date DRM module can be built by using the {{Package Official|nouveau-drm}} PKGBUILD from [[Arch Build System|ABS]]. Simply update {{Codeline|_snapdate}} to the current date, and modify the {{Codeline|sources}} array to read:<br />
source=(# ftp://ftp.archlinux.org/other/$pkgname/master-${_snapdate}.tar.gz<br />
http://people.freedesktop.org/~pq/nouveau-drm/master.tar.gz<br />
# get the Makefile from http://cgit.freedesktop.org/nouveau/linux-2.6/plain/nouveau/Makefile?h=master-compat<br />
Makefile)<br />
<br />
You can use {{Package AUR|kernel26-nouveau-git}} to compile the nouveau project's kernel tree, which already includes the necessary modules. This is the method recommended by upstream.<br />
<br />
==3D==<br />
3D is ''unsupported''.<br />
<br />
That means:<br />
* Do not ask for instructions to try it.<br />
* What ever you do, do not install the 3D driver system-wide.<br />
* If you want to try 3D acceleration or you have problems with it, you are on your own, unless you are looking to contribute patches.<br />
<br />
References: [http://nouveau.freedesktop.org/wiki/FrontPage Nouveau frontpage] and [http://nouveau.freedesktop.org/wiki/FAQ#head-ae99a8e6a3f57b76ae2589d4c0d2a5fa7ebf9f5d Nouveau FAQ]<br />
<br />
==DualHead==<br />
Nouveau supports the xrandr extension for modesetting and multiple monitors. See the [[RandR12]] page for tutorials.<br />
<br />
Here is a full sample {{Filename|/etc/X11/xorg.conf}} above for running 2 monitors in dual head mode. You may prefer to use a graphical tool to configure monitors like gnome-display-properties (System -> Preferences -> Display).<br />
<pre><br />
# the right one<br />
Section "Monitor"<br />
Identifier "NEC"<br />
Option "PreferredMode" "1280x1024_60.00"<br />
EndSection<br />
<br />
# the left one<br />
Section "Monitor"<br />
Identifier "FUS"<br />
Option "PreferredMode" "1280x1024_60.00"<br />
Option "LeftOf" "NEC"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia card"<br />
Driver "nouveau"<br />
Option "Monitor-DVI-I-0" "NEC"<br />
Option "Monitor-DVI-I-1" "FUS"<br />
#Option "AccelMethod" "XAA"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "screen1"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
Virtual 2560 1024<br />
EndSubSection<br />
Device "nvidia card"<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "layout1"<br />
Screen "screen1"<br />
# will be replaced by gallium 3D<br />
Option "AIGLX" "false"<br />
EndSection<br />
</pre><br />
<br />
==Troubleshooting==<br />
<br />
===Console virtual resolution does not correspond to real one===<br />
Use the {{Package Official|fbset}} tool to adjust console resolution.</div>Derelicthttps://wiki.archlinux.org/index.php?title=Talk:Zsh&diff=37037Talk:Zsh2008-02-12T23:27:35Z<p>Derelict: eval `dircolors -z` generates an error</p>
<hr />
<div>My most recent Archlinux installation somehow has a conflict between Eterm and zsh, I found that some applications like mc, vim and mp3blaster do not pick up the arrow keys, even when using zkbd. They send an ABCD and some escape sequence garbage.<br><br />
By setting the TERM variable to xterm-color the problem was fixed. To not mess up the TERM variable in the console one could put this code in .zshrc:<br><br />
<nowiki>if [[ $TERM == "Eterm" ]]; then</nowiki><br><br />
<nowiki>TERM=xterm-color</nowiki><br><br />
<nowiki>fi</nowiki><br><br />
--Gilneas, 2006 Aug 11<br />
<br />
== /etc/zprofile and advanced .zshrc ==<br />
<br />
I've added a /etc/zprofile section and moved some of the bits from the advanced .zshrc section to it. I'm going on what I've read of the docs, but if this is wrong, please change it. [[User:AlexW|AlexW]] 08:38, 10 December 2007 (EST)<br />
<br />
== eval `dircolors -z` generates an error ==<br />
<br />
I have not been able to find a solution to this, so I have commented the Advanced .zshrc in the wiki here:<br />
http://wiki.archlinux.org/index.php/Zsh#Advanced_.zshrc<br />
The -z does not appear to be a valid option for dircolors. Perhaps the original wiki author has a solution?</div>Derelicthttps://wiki.archlinux.org/index.php?title=Zsh&diff=37036Zsh2008-02-12T23:18:23Z<p>Derelict: /* Advanced <code>.zshrc</code> */</p>
<hr />
<div>[[Category:Command shells (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
== Introduction ==<br />
[http://www.zsh.org Zsh] is a powerful shell that operates as both as an interactive shell and as a scripting language interpreter. While being compatible with BASH, it offers many advantages such as:<br />
*Faster<br />
*Improved tab completion<br />
*Improved globbing<br />
*Improved array handling<br />
*Fully customisable<br />
<br />
The zsh FAQ offers [http://zsh.sunsite.dk/FAQ/zshfaq01.html#l4 more reasons] to use zsh as your shell.<br />
<br />
== Installation instructions ==<br />
To install the package for zsh using pacman run<br />
pacman -S zsh<br />
Before proceeding with the next step to make zsh your default shell, you should ensure that it has been installed correctly by running <code>zsh</code> in an xterm. If the installation has gone smoothly you should now find yourself staring at a rather unfamiliar prompt, for now just type <code>exit</code>.<br />
<br />
To change a user's shell without root access, the <code>chsh</code> command is used. The commmand <code>chsh</code> can only be used to change a user's shell without root access if the shell is listed in <code>/etc/shells</code>. If you installed zsh using pacman, zsh should already have an entry in <code>/etc/shells</code>. To proceed you need to know the full path to the zsh executable, so run<br />
which zsh<br />
Shown here as an example is the command I used to change my shell; substitue my values for your own.<br />
chsh -s /bin/zsh paul<br />
An alternative way to change a user's loging shell is with the command <code>usermod</code>. The disadvantage of this method is that you must have root access to run <code>usermod</code>. The syntax for this command is<br />
usermod -s /bin/zsh paul<br />
<br />
You will now need to logout and log back in, and you should find yourself in zsh instead of bash.<br />
<br />
If you do not have root access, and zsh is not listed in <code>/etc/shells</code> but you would still like to use zsh as your default shell, see [http://zsh.sunsite.dk/FAQ/zshfaq01.html#l8 this entry] in the zsh FAQ.<br />
<br />
== Configuration ==<br />
Although zsh is usable out of the box, it is almost certainly not set up the way you would like to use it, but due to the sheer amount of customisation available in zsh, creating a zsh config can be a daunting and time-consuming experience.<br />
<br />
Included below is a sample configuration file, it provides a decent set of default options as well as giving examples of many ways that zsh can be customised. In order to use this configuration save it as a file named <code>.zshrc</code>. You can then apply the changes without needing to logout and then back in by running<br />
source ~/.zshrc<br />
<br />
=== Simple <code>.zshrc</code> ===<br />
Here is a simple <code>.zshrc</code>, that should be sufficient to get you started:<br />
autoload -U compinit promptinit<br />
compinit<br />
promptinit<br />
<br />
# This will set the default prompt to the walters theme<br />
prompt walters<br />
<br />
<br />
=== /etc/zprofile ===<br />
Much like the /etc/profile used for bash, this file is for global zsh settings & is a good place from which to run scripts from /etc/profile.d/ and set up environment variables such as $PATH. <br />
When setting up $PATH etc. in .zshrc and using a login-manager such as kdm, you may find those settings not being taken up by the window-manager, whereas they are when using /etc/zprofile. <br />
<br />
Generally speaking, you can copy /etc/profile to /etc zprofile, but here's an example /etc/zprofile :<br />
<br />
###############<br />
# Zsh profile #<br />
###############<br />
<br />
export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/opt/bin"<br />
<br />
export MANPATH="/usr/man:/usr/X11R6/man"<br />
export LESSCHARSET="latin1"<br />
export INPUTRC="/etc/inputrc"<br />
export LESS="-R"<br />
<br />
# load profiles from /etc/profile.d<br />
# (to disable a profile, just remove execute permission on it)<br />
if [ `ls -A1 /etc/profile.d/ | wc -l` -gt 0 ]; then<br />
for profile in /etc/profile.d/*.sh; do<br />
if [ -x $profile ]; then<br />
. $profile<br />
fi<br />
done<br />
unset profile<br />
fi<br />
<br />
<br />
# Locale settings (find your locale with 'locale -a')<br />
export LANG="en_GB.utf8"<br />
export LC_COLLATE="C"<br />
umask 022<br />
<br />
<br />
<br />
=== Command Completion ===<br />
Perhaps the most compelling feature of zsh is its advanced autocompletion abilities. At the very least, you will want to enable autocompletion in your <code>.zshrc</code>. To enable autocompletion, add the following to your <code>.zshrc</code><br />
autoload -U compinit<br />
compinit<br />
<br />
<br />
=== Key Bindings ===<br />
Zsh doesn't read /etc/inputrc, which tells the shell what commands sent by the terminal emulator mean. To have some standard key bindings working on zsh, add something like this to <code>.zshrc</code>:<br />
# key bindings<br />
bindkey "\e[1~" beginning-of-line<br />
bindkey "\e[4~" end-of-line<br />
bindkey "\e[5~" beginning-of-history<br />
bindkey "\e[6~" end-of-history<br />
bindkey "\e[3~" delete-char<br />
bindkey "\e[2~" quoted-insert<br />
bindkey "\e[5C" forward-word<br />
bindkey "\eOc" emacs-forward-word<br />
bindkey "\e[5D" backward-word<br />
bindkey "\eOd" emacs-backward-word<br />
bindkey "\e\e[C" forward-word<br />
bindkey "\e\e[D" backward-word<br />
bindkey "^H" backward-delete-word<br />
# for rxvt<br />
bindkey "\e[8~" end-of-line<br />
bindkey "\e[7~" beginning-of-line<br />
# for non RH/Debian xterm, can't hurt for RH/DEbian xterm<br />
bindkey "\eOH" beginning-of-line<br />
bindkey "\eOF" end-of-line<br />
# for freebsd console<br />
bindkey "\e[H" beginning-of-line<br />
bindkey "\e[F" end-of-line<br />
# completion in the middle of a line<br />
bindkey '^i' expand-or-complete-prefix<br />
<br />
=== Prompts ===<br />
There is a quick and easy way to set up a colored prompt in zsh. Make sure that <code>prompt</code> is set to autload in your <code>.zshrc</code>. This can be done by adding the lines:<br />
autoload -U promptinit<br />
promptinit<br />
to your <code>.zshrc</code>. You can now see available prompts by running the command<br />
prompt -l<br />
To try one of the commands that is listed, use the command <code>prompt</code> followed by the name of the prompt you like. For example, to use the "walters" prompt, you would enter<br />
prompt walters<br />
<br />
<br />
=== Advanced <code>.zshrc</code> ===<br />
This is an example of a more advanced <code>.zshrc</code><br />
<br />
########################################################### <br />
# Options for zsh<br />
<br />
export HISTFILE=~/.zsh_history<br />
export HISTSIZE=50000<br />
export SAVEHIST=50000<br />
eval `dircolors -z` # This generates an error. Please see the discussion above.<br />
<br />
autoload -U compinit compinit<br />
setopt autopushd pushdminus pushdsilent pushdtohome<br />
setopt autocd<br />
setopt cdablevars<br />
setopt ignoreeof<br />
setopt interactivecomments<br />
setopt nobanghist<br />
setopt noclobber<br />
setopt HIST_REDUCE_BLANKS<br />
setopt HIST_IGNORE_SPACE<br />
setopt SH_WORD_SPLIT<br />
setopt nohup<br />
<br />
# PS1 and PS2<br />
export PS1="$(print '%{\e[1;34m%}%n%{\e[0m%}'):$(print '%{\e[0;34m%}%~%{\e[0m%}')$ "<br />
export PS2="$(print '%{\e[0;34m%}>%{\e[0m%}')"<br />
<br />
# Vars used later on by zsh<br />
export EDITOR="gvim -geom 82x35"<br />
export BROWSER=links<br />
export XTERM="aterm +sb -geometry 80x29 -fg black -bg lightgoldenrodyellow -fn -xos4-terminus-medium-*-normal-*-14-*-*-*-*-*-iso8859-15"<br />
<br />
##################################################################<br />
# Stuff to make my life easier<br />
<br />
# allow approximate<br />
zstyle ':completion:*' completer _complete _match _approximate<br />
zstyle ':completion:*:match:*' original only<br />
zstyle ':completion:*:approximate:*' max-errors 1 numeric<br />
<br />
# tab completion for PID :D<br />
zstyle ':completion:*:*:kill:*' menu yes select<br />
zstyle ':completion:*:kill:*' force-list always<br />
<br />
# cd not select parent dir. <br />
zstyle ':completion:*:cd:*' ignore-parents parent pwd<br />
<br />
##################################################################<br />
# Key bindings<br />
# http://mundy.yazzy.org/unix/zsh.php<br />
# http://www.zsh.org/mla/users/2000/msg00727.html<br />
<br />
typeset -g -A key<br />
bindkey '^?' backward-delete-char<br />
bindkey '^[[1~' beginning-of-line<br />
bindkey '^[[5~' up-line-or-history<br />
bindkey '^[[3~' delete-char<br />
bindkey '^[[4~' end-of-line<br />
bindkey '^[[6~' down-line-or-history<br />
bindkey '^[[A' up-line-or-search<br />
bindkey '^[[D' backward-char<br />
bindkey '^[[B' down-line-or-search<br />
bindkey '^[[C' forward-char <br />
<br />
##################################################################<br />
# My aliases<br />
<br />
# Set up auto extension stuff<br />
alias -s html=$BROWSER<br />
alias -s org=$BROWSER<br />
alias -s php=$BROWSER<br />
alias -s com=$BROWSER<br />
alias -s net=$BROWSER<br />
alias -s png=feh<br />
alias -s jpg=feh<br />
alias -s gif=feg<br />
alias -s sxw=soffice<br />
alias -s doc=soffice<br />
alias -s gz=tar -xzvf<br />
alias -s bz2=tar -xjvf<br />
alias -s java=$EDITOR<br />
alias -s txt=$EDITOR<br />
alias -s PKGBUILD=$EDITOR<br />
<br />
# Normal aliases<br />
alias ls='ls --color=auto -F'<br />
alias lsd='ls -ld *(-/DN)'<br />
alias lsa='ls -ld .*'<br />
alias f='find |grep'<br />
alias c="clear"<br />
alias dir='ls -1'<br />
alias gvim='gvim -geom 82x35'<br />
alias ..='cd ..'<br />
alias nicotine='/home/paul/downloads/nicotine-1.0.8rc1/nicotine'<br />
alias ppp-on='sudo /usr/sbin/ppp-on'<br />
alias ppp-off='sudo /usr/sbin/ppp-off'<br />
alias firestarter='sudo su -c firestarter'<br />
alias mpg123='mpg123 -o oss'<br />
alias mpg321='mpg123 -o oss'<br />
alias vba='/home/paul/downloads/VisualBoyAdvance -f 4'<br />
alias hist="grep '$1' /home/paul/.zsh_history"<br />
alias irssi="irssi -c irc.freenode.net -n yyz"<br />
alias mem="free -m"<br />
alias msn="tmsnc -l hutchy@subdimension.com"<br />
<br />
# command L equivalent to command |less<br />
alias -g L='|less' <br />
<br />
# command S equivalent to command &> /dev/null &<br />
alias -g S='&> /dev/null &'<br />
<br />
# type a directory's name to cd to it.<br />
compctl -/ cd<br />
<br />
There are many more ways that you can customise zsh, obviously far too many to list here, see the [http://zsh.sunsite.dk/Doc/ zsh manual] for more information.<br />
<br />
== Enable Unicode ==<br />
<br />
The latest versions of zsh support unicode characters. To enable it, just rebuild the package with abs. First you have to update the abs tree.<br />
$ su root<br />
$ abs<br />
<br />
Then go to /var/abs/extra/system/zsh and add the option ''--enable-multibyte'' to the PKGBUILD:<br />
...<br />
build() {<br />
cd $startdir/src/$pkgname-$pkgver<br />
./configure --prefix=/usr --bindir=/bin \<br />
--enable-etcdir=/etc/zsh \<br />
--enable-zshenv=/etc/zsh/zshenv \<br />
--enable-zlogin=/etc/zsh/zlogin \<br />
--enable-zlogout=/etc/zsh/zlogout \<br />
--enable-zprofile=/etc/profile \<br />
--enable-zshrc=/etc/zsh/zshrc \<br />
--enable-maildir-support \<br />
--with-curses-terminfo \<br />
--enable-zsh-secure-free \<br />
'''--enable-multibyte'''<br />
...<br />
<br />
Now you can rebuild the package and update it.<br />
$ makepkg<br />
$ pacman -U 'new zsh package'<br />
<br />
== Uninstallation ==<br />
If you decide that zsh is not the shell for you and you want to return to BASH you must first change your default shell before removing the package. '''Failure to do so will result in all kinds of problems.'''<br />
<br />
First you need to find out the path to sh, do this by running<br />
which sh<br />
<br />
Then, as with the install, use the usermod program to modify your default shell<br />
usermod -s /bin/sh paul<br />
<br />
You are then free to remove the zsh package using pacman<br />
pacman -R zsh<br />
<br />
== External Resources ==<br />
*[http://zsh.sunsite.dk/Intro/intro_toc.html zsh Introduction] <br />
*[http://zsh.sourceforge.net/Guide/zshguide.html Users Guide]<br />
*[http://zsh.sunsite.dk/Doc/ zsh Docs] <br />
*[http://zsh.sunsite.dk/FAQ/ zsh FAQ] <br />
*[http://zshwiki.org/home/ zsh Wiki]<br />
*[http://grml.org/zsh/zsh-lovers.html zsh-lovers]<br />
*[http://www.bash2zsh.com/zsh_refcard/refcard.pdf Bash2Zsh Reference Card]<br />
<br><br />
*<b>IRC channel:</b> #zsh at irc.freenode.org</div>Derelicthttps://wiki.archlinux.org/index.php?title=Zsh&diff=37035Zsh2008-02-12T23:12:49Z<p>Derelict: /* Advanced <code>.zshrc</code> */</p>
<hr />
<div>[[Category:Command shells (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
== Introduction ==<br />
[http://www.zsh.org Zsh] is a powerful shell that operates as both as an interactive shell and as a scripting language interpreter. While being compatible with BASH, it offers many advantages such as:<br />
*Faster<br />
*Improved tab completion<br />
*Improved globbing<br />
*Improved array handling<br />
*Fully customisable<br />
<br />
The zsh FAQ offers [http://zsh.sunsite.dk/FAQ/zshfaq01.html#l4 more reasons] to use zsh as your shell.<br />
<br />
== Installation instructions ==<br />
To install the package for zsh using pacman run<br />
pacman -S zsh<br />
Before proceeding with the next step to make zsh your default shell, you should ensure that it has been installed correctly by running <code>zsh</code> in an xterm. If the installation has gone smoothly you should now find yourself staring at a rather unfamiliar prompt, for now just type <code>exit</code>.<br />
<br />
To change a user's shell without root access, the <code>chsh</code> command is used. The commmand <code>chsh</code> can only be used to change a user's shell without root access if the shell is listed in <code>/etc/shells</code>. If you installed zsh using pacman, zsh should already have an entry in <code>/etc/shells</code>. To proceed you need to know the full path to the zsh executable, so run<br />
which zsh<br />
Shown here as an example is the command I used to change my shell; substitue my values for your own.<br />
chsh -s /bin/zsh paul<br />
An alternative way to change a user's loging shell is with the command <code>usermod</code>. The disadvantage of this method is that you must have root access to run <code>usermod</code>. The syntax for this command is<br />
usermod -s /bin/zsh paul<br />
<br />
You will now need to logout and log back in, and you should find yourself in zsh instead of bash.<br />
<br />
If you do not have root access, and zsh is not listed in <code>/etc/shells</code> but you would still like to use zsh as your default shell, see [http://zsh.sunsite.dk/FAQ/zshfaq01.html#l8 this entry] in the zsh FAQ.<br />
<br />
== Configuration ==<br />
Although zsh is usable out of the box, it is almost certainly not set up the way you would like to use it, but due to the sheer amount of customisation available in zsh, creating a zsh config can be a daunting and time-consuming experience.<br />
<br />
Included below is a sample configuration file, it provides a decent set of default options as well as giving examples of many ways that zsh can be customised. In order to use this configuration save it as a file named <code>.zshrc</code>. You can then apply the changes without needing to logout and then back in by running<br />
source ~/.zshrc<br />
<br />
=== Simple <code>.zshrc</code> ===<br />
Here is a simple <code>.zshrc</code>, that should be sufficient to get you started:<br />
autoload -U compinit promptinit<br />
compinit<br />
promptinit<br />
<br />
# This will set the default prompt to the walters theme<br />
prompt walters<br />
<br />
<br />
=== /etc/zprofile ===<br />
Much like the /etc/profile used for bash, this file is for global zsh settings & is a good place from which to run scripts from /etc/profile.d/ and set up environment variables such as $PATH. <br />
When setting up $PATH etc. in .zshrc and using a login-manager such as kdm, you may find those settings not being taken up by the window-manager, whereas they are when using /etc/zprofile. <br />
<br />
Generally speaking, you can copy /etc/profile to /etc zprofile, but here's an example /etc/zprofile :<br />
<br />
###############<br />
# Zsh profile #<br />
###############<br />
<br />
export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/opt/bin"<br />
<br />
export MANPATH="/usr/man:/usr/X11R6/man"<br />
export LESSCHARSET="latin1"<br />
export INPUTRC="/etc/inputrc"<br />
export LESS="-R"<br />
<br />
# load profiles from /etc/profile.d<br />
# (to disable a profile, just remove execute permission on it)<br />
if [ `ls -A1 /etc/profile.d/ | wc -l` -gt 0 ]; then<br />
for profile in /etc/profile.d/*.sh; do<br />
if [ -x $profile ]; then<br />
. $profile<br />
fi<br />
done<br />
unset profile<br />
fi<br />
<br />
<br />
# Locale settings (find your locale with 'locale -a')<br />
export LANG="en_GB.utf8"<br />
export LC_COLLATE="C"<br />
umask 022<br />
<br />
<br />
<br />
=== Command Completion ===<br />
Perhaps the most compelling feature of zsh is its advanced autocompletion abilities. At the very least, you will want to enable autocompletion in your <code>.zshrc</code>. To enable autocompletion, add the following to your <code>.zshrc</code><br />
autoload -U compinit<br />
compinit<br />
<br />
<br />
=== Key Bindings ===<br />
Zsh doesn't read /etc/inputrc, which tells the shell what commands sent by the terminal emulator mean. To have some standard key bindings working on zsh, add something like this to <code>.zshrc</code>:<br />
# key bindings<br />
bindkey "\e[1~" beginning-of-line<br />
bindkey "\e[4~" end-of-line<br />
bindkey "\e[5~" beginning-of-history<br />
bindkey "\e[6~" end-of-history<br />
bindkey "\e[3~" delete-char<br />
bindkey "\e[2~" quoted-insert<br />
bindkey "\e[5C" forward-word<br />
bindkey "\eOc" emacs-forward-word<br />
bindkey "\e[5D" backward-word<br />
bindkey "\eOd" emacs-backward-word<br />
bindkey "\e\e[C" forward-word<br />
bindkey "\e\e[D" backward-word<br />
bindkey "^H" backward-delete-word<br />
# for rxvt<br />
bindkey "\e[8~" end-of-line<br />
bindkey "\e[7~" beginning-of-line<br />
# for non RH/Debian xterm, can't hurt for RH/DEbian xterm<br />
bindkey "\eOH" beginning-of-line<br />
bindkey "\eOF" end-of-line<br />
# for freebsd console<br />
bindkey "\e[H" beginning-of-line<br />
bindkey "\e[F" end-of-line<br />
# completion in the middle of a line<br />
bindkey '^i' expand-or-complete-prefix<br />
<br />
=== Prompts ===<br />
There is a quick and easy way to set up a colored prompt in zsh. Make sure that <code>prompt</code> is set to autload in your <code>.zshrc</code>. This can be done by adding the lines:<br />
autoload -U promptinit<br />
promptinit<br />
to your <code>.zshrc</code>. You can now see available prompts by running the command<br />
prompt -l<br />
To try one of the commands that is listed, use the command <code>prompt</code> followed by the name of the prompt you like. For example, to use the "walters" prompt, you would enter<br />
prompt walters<br />
<br />
<br />
=== Advanced <code>.zshrc</code> ===<br />
This is an example of a more advanced <code>.zshrc</code><br />
<br />
########################################################### <br />
# Options for zsh<br />
<br />
export HISTFILE=~/.zsh_history<br />
export HISTSIZE=50000<br />
export SAVEHIST=50000<br />
eval `dircolors -z` # This generates an error<br />
<br />
autoload -U compinit compinit<br />
setopt autopushd pushdminus pushdsilent pushdtohome<br />
setopt autocd<br />
setopt cdablevars<br />
setopt ignoreeof<br />
setopt interactivecomments<br />
setopt nobanghist<br />
setopt noclobber<br />
setopt HIST_REDUCE_BLANKS<br />
setopt HIST_IGNORE_SPACE<br />
setopt SH_WORD_SPLIT<br />
setopt nohup<br />
<br />
# PS1 and PS2<br />
export PS1="$(print '%{\e[1;34m%}%n%{\e[0m%}'):$(print '%{\e[0;34m%}%~%{\e[0m%}')$ "<br />
export PS2="$(print '%{\e[0;34m%}>%{\e[0m%}')"<br />
<br />
# Vars used later on by zsh<br />
export EDITOR="gvim -geom 82x35"<br />
export BROWSER=links<br />
export XTERM="aterm +sb -geometry 80x29 -fg black -bg lightgoldenrodyellow -fn -xos4-terminus-medium-*-normal-*-14-*-*-*-*-*-iso8859-15"<br />
<br />
##################################################################<br />
# Stuff to make my life easier<br />
<br />
# allow approximate<br />
zstyle ':completion:*' completer _complete _match _approximate<br />
zstyle ':completion:*:match:*' original only<br />
zstyle ':completion:*:approximate:*' max-errors 1 numeric<br />
<br />
# tab completion for PID :D<br />
zstyle ':completion:*:*:kill:*' menu yes select<br />
zstyle ':completion:*:kill:*' force-list always<br />
<br />
# cd not select parent dir. <br />
zstyle ':completion:*:cd:*' ignore-parents parent pwd<br />
<br />
##################################################################<br />
# Key bindings<br />
# http://mundy.yazzy.org/unix/zsh.php<br />
# http://www.zsh.org/mla/users/2000/msg00727.html<br />
<br />
typeset -g -A key<br />
bindkey '^?' backward-delete-char<br />
bindkey '^[[1~' beginning-of-line<br />
bindkey '^[[5~' up-line-or-history<br />
bindkey '^[[3~' delete-char<br />
bindkey '^[[4~' end-of-line<br />
bindkey '^[[6~' down-line-or-history<br />
bindkey '^[[A' up-line-or-search<br />
bindkey '^[[D' backward-char<br />
bindkey '^[[B' down-line-or-search<br />
bindkey '^[[C' forward-char <br />
<br />
##################################################################<br />
# My aliases<br />
<br />
# Set up auto extension stuff<br />
alias -s html=$BROWSER<br />
alias -s org=$BROWSER<br />
alias -s php=$BROWSER<br />
alias -s com=$BROWSER<br />
alias -s net=$BROWSER<br />
alias -s png=feh<br />
alias -s jpg=feh<br />
alias -s gif=feg<br />
alias -s sxw=soffice<br />
alias -s doc=soffice<br />
alias -s gz=tar -xzvf<br />
alias -s bz2=tar -xjvf<br />
alias -s java=$EDITOR<br />
alias -s txt=$EDITOR<br />
alias -s PKGBUILD=$EDITOR<br />
<br />
# Normal aliases<br />
alias ls='ls --color=auto -F'<br />
alias lsd='ls -ld *(-/DN)'<br />
alias lsa='ls -ld .*'<br />
alias f='find |grep'<br />
alias c="clear"<br />
alias dir='ls -1'<br />
alias gvim='gvim -geom 82x35'<br />
alias ..='cd ..'<br />
alias nicotine='/home/paul/downloads/nicotine-1.0.8rc1/nicotine'<br />
alias ppp-on='sudo /usr/sbin/ppp-on'<br />
alias ppp-off='sudo /usr/sbin/ppp-off'<br />
alias firestarter='sudo su -c firestarter'<br />
alias mpg123='mpg123 -o oss'<br />
alias mpg321='mpg123 -o oss'<br />
alias vba='/home/paul/downloads/VisualBoyAdvance -f 4'<br />
alias hist="grep '$1' /home/paul/.zsh_history"<br />
alias irssi="irssi -c irc.freenode.net -n yyz"<br />
alias mem="free -m"<br />
alias msn="tmsnc -l hutchy@subdimension.com"<br />
<br />
# command L equivalent to command |less<br />
alias -g L='|less' <br />
<br />
# command S equivalent to command &> /dev/null &<br />
alias -g S='&> /dev/null &'<br />
<br />
# type a directory's name to cd to it.<br />
compctl -/ cd<br />
<br />
There are many more ways that you can customise zsh, obviously far too many to list here, see the [http://zsh.sunsite.dk/Doc/ zsh manual] for more information.<br />
<br />
== Enable Unicode ==<br />
<br />
The latest versions of zsh support unicode characters. To enable it, just rebuild the package with abs. First you have to update the abs tree.<br />
$ su root<br />
$ abs<br />
<br />
Then go to /var/abs/extra/system/zsh and add the option ''--enable-multibyte'' to the PKGBUILD:<br />
...<br />
build() {<br />
cd $startdir/src/$pkgname-$pkgver<br />
./configure --prefix=/usr --bindir=/bin \<br />
--enable-etcdir=/etc/zsh \<br />
--enable-zshenv=/etc/zsh/zshenv \<br />
--enable-zlogin=/etc/zsh/zlogin \<br />
--enable-zlogout=/etc/zsh/zlogout \<br />
--enable-zprofile=/etc/profile \<br />
--enable-zshrc=/etc/zsh/zshrc \<br />
--enable-maildir-support \<br />
--with-curses-terminfo \<br />
--enable-zsh-secure-free \<br />
'''--enable-multibyte'''<br />
...<br />
<br />
Now you can rebuild the package and update it.<br />
$ makepkg<br />
$ pacman -U 'new zsh package'<br />
<br />
== Uninstallation ==<br />
If you decide that zsh is not the shell for you and you want to return to BASH you must first change your default shell before removing the package. '''Failure to do so will result in all kinds of problems.'''<br />
<br />
First you need to find out the path to sh, do this by running<br />
which sh<br />
<br />
Then, as with the install, use the usermod program to modify your default shell<br />
usermod -s /bin/sh paul<br />
<br />
You are then free to remove the zsh package using pacman<br />
pacman -R zsh<br />
<br />
== External Resources ==<br />
*[http://zsh.sunsite.dk/Intro/intro_toc.html zsh Introduction] <br />
*[http://zsh.sourceforge.net/Guide/zshguide.html Users Guide]<br />
*[http://zsh.sunsite.dk/Doc/ zsh Docs] <br />
*[http://zsh.sunsite.dk/FAQ/ zsh FAQ] <br />
*[http://zshwiki.org/home/ zsh Wiki]<br />
*[http://grml.org/zsh/zsh-lovers.html zsh-lovers]<br />
*[http://www.bash2zsh.com/zsh_refcard/refcard.pdf Bash2Zsh Reference Card]<br />
<br><br />
*<b>IRC channel:</b> #zsh at irc.freenode.org</div>Derelicthttps://wiki.archlinux.org/index.php?title=PyPanel&diff=14429PyPanel2006-07-26T18:51:39Z<p>Derelict: </p>
<hr />
<div>==Download and Install==<br />
The latest version of pypanel currently resides in the AUR under community. Be sure to make it accessible in /etc/pacman.conf then download it with:<br />
pacman -S pypanel<br />
==Pre-Configuration Fixes==<br />
There is a small issue with python Xlib. To avoid attribute errors edit the file /usr/lib/python2.4/site-packages/Xlib/protocol/display.py and change line <br />
530 to this:<br />
recv = self.socket.recv(4096)<br />
This was addressed in the forum. A link to that thread is here: <br />
[http://bbs.archlinux.org/viewtopic.php?t=5081&postdays=0&postorder=asc&start=0] <br />
==Basic Customization==<br />
Although pypanel is lightweight, it still has a lot of eyecandy that can be accessed and manipulated through the .pypanelrc file. This file is created in our home directory the first time pypanel is run.<br />
<br />
To start pypanel simply type:<br />
pypanel<br />
To start pypanel every time you start an Xwindows session, add the following to ~/.xinitrc '''''before''''' you start the window manager:<br />
pypanel &<br />
For example, my .xinitrc file looks like this:<br />
#!/bin/sh<br />
# ~/.xinitrc<br />
eval `cat $HOME/.fehbg`<br />
pypanel &<br />
exec openbox<br />
<br />
Now that we have a default configuration file in our home directory we can edit the behavior of pypanel. The ~/.pypanelrc file is actually a python script, and therefore requires correct python syntax and formatting. The file is well commented, so rather than duplicating it, I'll offer some suggestions:<br />
<br />
BG_COLOR = "0xfaebd7" # Panel background and tint (Antique White)<br />
TASK_COLOR = "0xffffff" # Normal task name color<br />
DESKTOP_COLOR = "0xffffff" # Desktop name color<br />
CLOCK_COLOR = "0xffffff" # Clock text color<br />
<br />
TASK_SHADOW_COLOR = "0x000000"<br />
FOCUSED_SHADOW_COLOR = "0x000000"<br />
SHADED_SHADOW_COLOR = "0x000000"<br />
MINIMIZED_SHADOW_COLOR = "0x000000" <br />
DESKTOP_SHADOW_COLOR = "0x000000"<br />
CLOCK_SHADOW_COLOR = "0x000000"<br />
<br />
SHADE = 64<br />
<br />
ABOVE = 1 # Panel is always above other apps<br />
APPICONS = 1 # Show application icons<br />
AUTOHIDE = 0 # Autohide uses the CLOCK_DELAY timer above<br />
SHADOWS = 1 # Show text shadows<br />
SHOWLINES = 0 # Show object separation lines<br />
SHOWBORDER = 1 # Show a border around the panel<br />
<br />
Many other settings can be changed. These examples only illustrate some of the visual options available. Mouse clicks and other behavior can be also adjusted according preference. Read the comments and experiment.</div>Derelict