8 September 2010
Setting up my Arch-Linux-based production environment
The Arch Way, the devotion to KISS, a good memory of the BSD-style configuration system, the extensive technical (rather than merely philosophical or evangelistic) documentation, and the rolling release model with bleeding-edge packages are what initially drive me to try the Arch Linux distribution. So far, I like it.
The Beginners' Guide provides a solid ground for setting up a general desktop environment. Nevertheless, the rest of my needs are met only through other sources of information (e.g., the fine ArchWiki) and experimenting.
This page is a memorandum for setting up a production desktop environment on Arch Linux. The choices of packages and configurations are purely based on personal taste and experience.
Arguably, good writers write for no one but themselves; yet, in doing this, they produce pieces of writing that serve others better than if they had started with too many other things in mind. In the same spirit, I write this memorandum for myself. Nevertheless, I hope you will also find it useful.
Here is an index of the topics.
Installation
In homage to the comprehensive Beginner's Guide, I only highlight the choices I have made throughout the installation procedure here.
Installation Media
Many modern personal computers are capable of booting from USB drive. This page describes how to make a USB installation media. I took a free 512M USB pen from the UITS and burned the 2010.05 dual-arch netinstall image on it.
Try Arch64 if your computer is capable of hosting it. Enable [multilib]
in /etc/pacman.conf
. Do not forget to pacman -Syy
after this.
Partition and Filesystem
As regard to disk space allocation for filesystem, I allocate 20G for /
as ext4
, 15G for /var
as reiserfs
, 1G on top of physical memory size for swap
, and the rest of the space for /home
as ext4
. Please see here for an explanation for the rationale behind these choices.
Post-installation Configuration
Initial Setup
First, as root
, update and upgrade the system with pacman -Syu
. This should not be an issue for netinstall.
Next, install sudo
pacman -S sudoand set up a user account
wei
with
useradd -m -g users -G audio,lp,optical,storage,video,wheel,games,power -s /bin/bash wei
passwd wei
With visudo
, edit /etc/sudoers
to enable
%wheel ALL=(ALL) ALLand now we should login and work as the regular user
wei
, and use sudo
for privileged operations. For the sake of clarity, we omit sudo
in the following command snippet; the context should make it clear if a sudo
is warranted.
Install and configure Advanced Linux Sound Architecture (ALSA) has been detailedly described here. Basically, after pacman -S alsa-utils
, run alsamixer
as wei
(rather than root
) and store the setting with sudo alsactl store
. Of course, do not forget to add alsa
to the DAEMONS
array in /etc/rc.conf
.
If you find the system beeping annoying as I do, you may disable it by adding !snd_pcsp !pcspkr
to the MODULES
array in /etc/rc.conf
as
# Scan hardware and load required modules at bootand unload it with
MOD_AUTOLOAD="yes"
# Load the following modules (do not load with the ! prefix)
MODULES=(... !snd_pcsp !pcspkr ...)
lsmod | grep -i spkrif you already have loaded it.
rmmod pcspkr
Setup a Desktop Environment
The instructions are here. Basically, we need to do
pacman -S xorg mesa
lspci | grep -i vga
pacman -S xf86-video-<chip>
We do not need to configure Xorg at this point because we are going to install the GNOME desktop environment in a moment.
Install fonts with
pacman -S ttf-ms-fonts ttf-dejavu ttf-bitstream-vera
After this, install GNOME with
pacman -S gnome gnome-extra gnome-system-toolsand enable GDM with
/etc/rc.d/hal start
and edit the DAEMONS
array in /etc/rc.conf
into something like DAEMONS=(syslog-ng dbus hal gdm network crond alsa)Restart the computer, and we will land right into GDM.
I prefer to disable CapsLock key by the desktop menu
System>Preferences>Keyboard>Layout>Options
.
Set the mouse focus policy at (somewhat counter-intuitive)
System>Preferences>Windows
.
Set the single-click-select mouse behavior at Nautilus's menu
Edit>Preferences>Behavior>
.
Install Utilities
Basic Utilities
To make the rest of the procedure goes smoothly,
pacman -S bash-completion
echo 'set show-all-if-ambiguous on' >> ~/.inputrc
The following packages are basics for everyday use (for me)
pacman -S openssh putty gksu gvim firefox thunderbird gitUse the Vim's configuration for a quick start. We can set the following keyboard shortcuts (
pacman -S chromium screen irssi
pacman -S emacs racket sbcl
pacman -S graphviz gnuplot xfig octave
pacman -S ntfs-3g gstreamer0.10-plugins gstreamer0.10-pulse
Mod4
usually maps to the Win
key) Mod4+O -> gnome-terminal --working-directory=$HOME
Mod4+B -> firefox
Mod4+R -> gksu gnome-terminal
Mod4+. -> thunderbird
Mod4+I -> gvim
Mod4+P -> putty
Mod4+L -> nautilus /home/wei/documents
Use Firefox's Add-On manager to add the following extensions:
Vimperator
(the reason to stay with Firefox; a recommended try for any Vim user),
Forecastfox Weather
,
Adblock Plus
,
mozplugger
.
A few quickmarks are handy for Vimperator
(use M<char>
to add a quickmark <char>
; then we can use go<char>
or gn<char>
to quickly access the page)
g -> www.google.comand so on.
s -> scholar.google.com
d -> docs.google.com
c -> www.google.com/calendar/render
m -> www.gmail.com
M -> maps.google.com
u -> umail.iu.edu
o -> onestart.iu.edu
e -> edas.info
f -> www.facebook.com
r -> www.renren.com
h -> www.cs.iupui.edu/~pengw/
k -> slickdeals.net
y -> www.youtube.com
S -> mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#%_toc_start
Finally, install yaourt
for ease of accessing AUR. First, add to /etc/pacman.conf
the following lines
[archlinuxfr]Then, install it by
Server = http://repo.archlinux.fr/$arch
pacman -Syu yaourt
[multilib] Tools
In our Arch64 setup, since we have enabled[multilib]
in /etc/pacman.conf
, pacman -S mplayer gecko-mediaplayer xine-lib xine-ui \
libdvdread libdvdcss alsa-oss flashplugin jre skype
Networking Utilities
pacman -S networkmanager network-manager-applet gnome-keyringand edit the
DAEMONS
array in /etc/rc.conf
as DAEMONS=( ...hal networkmanager... )
Do not forget to allow others to use your SSH service by adding to the file /etc/hosts.allow
sshd: ALL
Enable SSH's X11 forwarding by editing /etc/ssh/sshd_config
with
X11Forwarding yesbut be aware of the hazard of doing so (forewarned is forearmed). Add
sshd
to the DAEMONS
array in /etc/rc.conf
and start it with /etc/rc.d/sshd start
.
Install optional dependencies for Empathy (pacman -Qi empathy
) to make it work correctly
pacman -S telepathy-butterfly telepathy-farsight telepathy-gabble telepathy-glib \
telepathy-haze telepathy-idle telepathy-salut telepathy-sofiasip
As regard to Skype microphone or voice problem, first check ALSA's configurations
alsamixerIn particular, press
sudo alsactl store
[F4]
and press [SPACE]
on Capture
to enable it (press [F1]
for usage). See here for more information.
Desktop
Crispy Look
One thing I like about Ubuntu is its crispy look out of the box. Fortunately, it is easy to get the look by using the LCD filter patched packages
pacman -Rd cairo libxft freetype2 fontconfigDo not panic if you find the look turns worse, because this is the caterpillar about to transform into butterfly
yaourt -S freetype2-ubuntu fontconfig-ubuntu libxft-ubuntu cairo-ubuntuLogout and login again. Enjoy the new look. :-)
Compiz
With a dose of restraint and proper configurations, Compiz can greatly enhance your productivity and desktop experience.
Install it with
pacman -S compiz-fusion-gtkBefore activating it, use
ccsm
to enable a few basic plug-ins
Move WindowThen, we can test it with (thanks for the help from a few kind souls on irc.freenode.net#archlinux:
Resize Window
Wallpaper
Gnome Compatibility
Window Decoration
Dbus
Inotify
GLib
Regex Matching
Workarounds
icarus-c
, oskude
, and rabbitear
)
compiz --replace --indirect-rendering ccp &Somehow, the
--indirect-rendering
option is vital for the proper function of Compiz on my setup. As noted here and here, Intel GMA user (e.g., Thinkpad X61s user as me) should start Compiz with
LIBGL_ALWAYS_INDIRECT=1 INTEL_BATCH=1 compiz --replace --indirect-rendering --sm-disable ccpand add a file
20-intelgma.conf
to /etc/X11/xorg.conf.d/
with this content
Section "Device"And we can always fall back to GNOME's window manager
Identifier "Intel video card"
Driver "intel"
Option "AccelMethod" "exa"
Option "MigrationHeuristic" "greedy"
Option "ExaNoComposite" "false"
EndSection
Metacity
with
metacity --replace --sm-disable &Make them into bash scripts
my-compiz.sh
and my-metacity.sh
for quick access; a good place would be $HOME/bin
and add a line PATH=$HOME/bin;$PATHto
$HOME/.bashrc
.
If you want to automatically start with Compiz enabled, see this tip: create the file (if it does not exist) /usr/share/applications/compiz.desktop
containing the following
[Desktop Entry]and set GConf parameters with
Type=Application
Encoding=UTF-8
Name=Compiz
Exec=bash -c 'compiz --replace --indirect-rendering --loose-binding\
--sm-client-id $DESKTOP_AUTOSTART_ID ccp decoration move resize'
NoDisplay=true
# name of loadable control center module
X-GNOME-WMSettingsModule=compiz
# autostart phase
X-GNOME-Autostart-Phase=WindowManager
X-GNOME-Provides=windowmanager
# name we put on the WM spec check window
X-GNOME-WMName=Compiz
# back compat only
X-GnomeWMSettingsLibrary=compiz
gconftool-2
by
gconftool-2 --set -t string /desktop/gnome/session/required_components/windowmanager compiz
A list of plug-ins can be found at /usr/share/compiz/*.xml
, which you can add to the Exec
above.
A few Compiz plug-ins comes very handy
-
General Options>Desktop Size
: set desktop's virtual size to 2 (vertical) by 3 (horizontal); -
Negative
: we can use<Mod4>N
to toggle color negation of a window; -
Opacify
: make a window transparent if it blocks the view of the window with focus; -
Expo
: try<Mod4>E
; -
Desktop Wall
together withViewport Switcher
: so you can move among virtual desktops; setDesktop Wall>Wall Sliding Duration
to 0 for instant change of virtual desktop; setViewport Switcher>Switch to Viewport [num]
with<Super>[num]
to move between them with the combo-key<Mod4>[num]
. -
Trailfocus
: more fun with transparency; -
Wobbly Windows
: if you like something fun while moving the window; :-) -
Application Switcher
: poll window with<Alt>Tab
. -
Extra WM Actions
:Toggle Fullscreen
with<Alt>F11
-
Grid
: see the settings for key bindings with KeyPad (KP); -
Maximumize
: very handy for non-overlapping maximize (maximumize) with<Super>m
; very useful for achieving the tiling window manager effect; -
Scale
: I love theInitiate Window Picker
effect and bind it with<Mod4>m
; optionally bindInitiate Window Picker For All Windows
to<Shift><Mod4>m
.
Documentation Utilities
Install TeXLive, OpenOffice.org, JabRef, gnochm with
pacman -S texlive-most jabref gnochmSee here for a few LaTeX styles (e.g., IEEEtran). Simply extract the package into
pacman -S openjdk6
pacman -S ttf-dejavu artwiz-fonts ttf-ms-fonts
pacman -S openoffice-base
pacman -S openoffice-base-beta openoffice-base-devel
$HOME
should work, i.e., tar xvf texmf.tgz
.
Chinese Language Environment
Install Chinese fonts with
pacman -S ttf-arphic-ukai ttf-arphic-uming ttf-fireflysung
A Chinese input method is essential for everyday use. For this purpose, I find ibus-pinyin
a good choice.
pacman -S ibus-pinyinand configure it via
System > Preferences > IBus Preferences
desktop menu.
Remember to install OpenOffice.Org's Chinese language support
pacman -S openoffice-zh-CN
... and Remember to Update the System
Do update and upgrade your system from time to time with
pacman -SyuThis is the beauty of a rolling release distro like Arch.