From Distro-Hopping to Good Easy

Tagged as Linux, Pics

Written on 2008-07-07 17:47:20

Linux is a complicated beast. Unlike Windows and Mac there are literally hundreds of different competing versions or distributions vying for attention and often catering to a specific niche. Beginning Linux users are often all waved towards the two or three most popular and general-purpose distributions and with good reason. While three distributions in particular (Ubuntu, Fedora, Suse) seem to dominate and are good places to start, I have often experienced a desire to see what else exists with Linux since there is so much in the way of choice. Additionally, Linux distributions tend to have one release or more a year while Windows and Mac tend to see a new version only every few years. The three distributions I mentioned earlier all strive to issue a new release every six months and they all do so at roughly the same time often with no more than a month separating them.

While this may at first seem undesirable there is no pressure to upgrade but there is also no cost to upgrade (remember, they're free!). Some upgrades have a few more bugs or new features than others but upgrades tend to be relatively safe and easy. Moreover, because of the regular releases large changes happen gradually and there is little to no learning curve. It's also worth noting that upgrading does not require you to reinstall the operating system. It's usually just an hour or two of downloading and a reboot.

So, "Distro Release Season" comes twice a year if you use Ubuntu, Fedora, or Suse. That's even better than Christmas! However, this release cycle rather disappointed me. Ubuntu's Hardy Heron was a bit buggier than I'd like. Fedora 9 seems better and better every time but they still lack a few software packages I want. To be honest, I've never been interested in Suse much. I'd also been meaning to move to a more stripped-down version of Linux for a long time. Ubuntu and Fedora come with a lot of bells and whistles that I may not necessarily need and that slow my system down.

It was time to try something new and, this season, I decided to go with Arch Linux. I won't go too deeply into my decision to use Arch. There are a lot of very good things about it and though it's not easy the way Ubuntu is, it's simple and worth the effort you put into it. You can make it into whatever you want it to be and that's precisely what I've done. I've spent about a week setting it up to perform as I'd like and with the programs I'd like. I've documented the entire process and will post that here as my personal "Good Easy". A good easy, for those who haven't heard of one, is a detailed description of someone's computer configuration. One reason I'd like to do one is that it's handy in case I have to duplicate it at some point in the future. It might be nice to do a Good Easy for my server at some point as well. I detail a bit at the end how to turn your installed system into a Live CD. I plan to do a little bit more work and remove personal data to turn that Live CD into something I could distribute at some point though mostly just to a few nerd friends. I wouldn't expect, or want, to take users from the wonderful Arch Linux after all.

My Good Easy...


Install:
The installer may look a bit scary but it's not too bad. I would recommend partitioning your drive beforehand with Gparted or reusing existing partitions.

Set the mountpoints for ext3 partitions and the swap space. I'd hold off on NTFS partitions until later.
Install packages selecting base-devel packages and sudo, wireless-tools, ntfs-3g, netcfg and openssh. Go to configure system and allow automatic hardware detection and usb boot devices. In rc.conf, set hostname and timezone, then set eth0="dhcp". We'll be adjusting this later but that's enough for now. In locales make sure that the locales you want are uncommented, then write and exit. Set the root password and nearest pacman mirror then return to the main menu. Install grub to your boot drive once you've added any necessary boot entries. You're done with the base install! Reboot and login as root.

Some Basics (A new user, ssh, sound):
Add any partitions to /etc/fstab that you didn't initially and create mountpoints for them. Use ntfs-3g for NTFS partitions.
Insert 'sshd: ALL' rights for ssh to /etc/hosts.allow and add sshd to the daemons list in /etc/rc.conf, then run the adduser command and give wheel, storage, audio, video, optical groups to the new user. Edit /etc/sudoers and comment out the line for the wheel group. Logout by typing exit at the command prompt and try logging back in as the new user.

To get sound working, run sudo pacman -Sy alsa-lib alsa-utils, then run amixer set Master 90% unmute and amixer set PCM 85% unmute and sudo alsactl store.

Then add alsa to the /etc/rc.conf daemons list.

GUIs GUIs GUIs! ...and a login manager:
Install the xorg group with sudo pacman -Sy xorg then check drivers with sudo pacman -Ss xf86-video and install one appropriate for your video card. For a window manager, install xmonad, openbox, gmrun, xcompmgr, openbox-themes and obconf like so: sudo pacman -Sy xmonad openbox gmrun xcompmgr openbox-themes obconf. For a login manager, install slim, archlinux-themes-slim and slim-themes with pacman and add slim to the daemons
in /etc/rc.conf. Then edit /etc/slim.conf to set themes to archlinux-retro,subway,fingerprint and set sessions to openbox,xmonad.
I use Openbox as my Window Manager at this point but hope to experiment with Xmonad down the line.

To get menumaker installed from the AUR (Arch User Repository) follow these instructions (you probablya want this):
mkdir -p ~/.config/openbox and cp /etc/xdg/openbox/* ~/.config/openbox/
mkdir ~/builds
cd ~/builds
wget http://aur.archlinux.org/packages/menumaker/menumaker.tar.gz && tar -zxvf *.gz
cd menumaker && makepkg -s && sudo pacman -U *.pkg.tar.gz && mmaker -vf openbox


For a system tray, I recommend stalonetray. Install it like so:
cp /etc/stalonetrayrc ~/.stalonetrayrc
nano ~/.stalonetrayrc
and change fuzzy_edges to 1, transparent to true, and icon gravity to NE.

I use the following pack so that I have icons for things but you may prefer another.
mkdir ~/.icons && cd ~/.icons
wget http://download22.mediafire.com/bdtdcgm4y1bg/49yjtxmu0z4/Crashbit.tar.bz2 && tar -zxvf Crash*.bz2

nano ~/.gtkrc-2.0 and insert
# ~/.gtkrc-2.0
gtk-icon-theme-name = "Crashbit"


I add a run command to the Alt-F2 key by modifying the configuration files that come with Openbox.
nano ~/.config/openbox/rc.xml and add this to the keyboard section:

gmrun



xscreensaver-command -lock



It's nice to have good wallpaper but I get bored with backgrounds after a while. What I do is dump a ton of good wallpapers (try Desktopography, for example) into a Wallpapers folder and then have the script run each time I login (or if I suddenly want a new wallpaper). Start off by making the script.

nano ~/wallpaper.sh and add
#!/bin/bash
WALLPAPERS="/home/yourusername/path_to_your_wallpapers"
ALIST=( `ls -w1 /home/yourusername/path_to_your_wallpapers` )
RANGE=${#ALIST[@]}
let "number = $RANDOM"
let LASTNUM="`cat $WALLPAPERS/.last` + $number"
let "number = $LASTNUM % $RANGE"
echo $number > $WALLPAPERS/.last

feh --bg-scale $WALLPAPERS/${ALIST[$number]}


Note that those ` are backticks not single quotes('). I got a little tripped up by that. To make the script executable do the following.
chmod +x ~/wallpaper.sh && touch path_to_your_wallpapers/.last

I also like to run conky to monitor CPU usage, the current song playing, whether there are updates and other such things.
nano ~/.conkyrc and insert the following.

# Use Xft?
use_xft yes
xftfont Terminus 8

# Update interval in seconds
update_interval 1

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorate,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 512 16

maximum_width 1560

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders yes

# Stippled borders?
stippled_borders 0

# border margins
border_margin 6

# border width
border_width 1

# Default colors and also border colors
default_color 738A88
#default_shade_color white
#default_outline_color black
own_window_colour 3C4746

# Text alignment, other possible values are commented
#alignment top_left
#alignment top_right
alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 8
gap_y 8

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about? This only affects
certain objects.
use_spacer none

# Append this to TEXT on laptops...| ${color FCFCFC}${battery_percent}

TEXT
${time %H:%M} | ${exec date "+%A %e %B"} ${color} | cpu: ${color FCFCFC}${cpu}%${color} | mem: ${color FCFCFC}$memperc%${color} | down: ${color FCFCFC}${downspeed eth0}kb/s${color} | up: ${color FCFCFC}${upspeed eth0}kb/s${color} | uptime: ${color FCFCFC}${uptime}${color} | root drive: ${color FCFCFC}${fs_used /} / ${fs_size /}${color} | music: ${color FCFCFC}${mpd_title 32}${color} | updates: ${color FCFCFC}${texeci 3600 perl ~/scripts/arch-updates/conky-updates.pl}


I should also note that the all of the stuff under text should be on one line.

To check for software updates we need to do a little more work.
mkdir ~/scripts/arch-updates && nano ~/scripts/arch-updates/conky-updates.pl to insert:

#! /usr/bin/perl -w
use strict;
# November 15, 2006
# Daniel Vredenburg (Vredfreak)
# This is a program that checks for package updates for Arch Linux
users.

open (MYINPUTFILE, "/home/yourusername/scripts/arch-updates/updates.log") or die "No such file or directory: $!";

my $i = 0;
while()
{
if (/^(.*)\/(.*)(\..*\..*\.)/) {
#print " \n";
$i++;
}

}
if ($i == 0) {
print "up to date";
} else {
print "available ($i)";
}
close(MYINPUTFILE);


Thanks again to Daniel for this script. Make the script executable next.
chmod +x ~/scripts/arch-updates/conky-updates.pl

There's yet more to do for the update notifications.
nano ~/scripts/arch-updates/pacsync.sh and insert:

#!/bin/bash

# This issues a command to 1. Sync the package database,
# 2. Check for upgradable packages, 3. print the URL of any possible
upgrade.
# The output of our command gets written to updates.log, which we will
use
# conky_updates.sh to parse to see if there are any available updates.

pacman -Syup --noprogressbar > /home/yourusername/path/to/updates.log


touch /home/yourusername/path/to/updates.log && sudo cp ~/scripts/arch-updates/pacsync.sh /etc/cron.hourly/
Thanks again to Daniel Vredenburg (Vredfreak) for this great script.

To tie it all together, we'll now write the startup script that tells what window manager and programs to start on login.
nano ~/.xinitrc and add this:
#!/bin/sh
#xcompmgr -cC & ;;uncomment this if you want compositing enabled (for true transparency, drop shadows, etc.)
~/wallpaper.sh & ;;the wallpaper script
xscreensaver -no-splash & ;;a screensaver program
thunar --daemon & ;;to keep the file manager checking for flash drives, cds, etc, being plugged in
/usr/lib/wicd/tray.py & ;; a networking and wireless client

DEFAULT_SESSION=twm

case $1 in
openbox)
(sleep 1 && stalonetray) & ;; start the system tray
conky &
exec /usr/bin/openbox-session
;;
xmonad)
/home/redline/scripts/dzconky &
exec /usr/bin/xmonad
;;
*)
exec $DEFAULT_SESSION
;;
esac


This script will log you into the twm window manager unless you hit F1 at the login screen. If you do, it will toggle between Openbox and Xmonad as the window manager.

The Good Easy:
The following command will install most of the cool and useful programs in the known universe including a bunch of programming languages, a version control system, IM client, Movie and Music players, and of course Firefox. All we're down to now is fine tuning and (optionally) making a Live CD of the installed system.

sudo pacman -S mercurial xarchiver pidgin feh rxvt-unicode firefox flashplugin gforth ruby lua erlang ghc python sbcl drscheme emacs thunar mc xmonad xmonad-contrib openbox mplayer mplayer-plugin mpd ncmpc sonata codecs dzen2 transmission rtorrent conky epdfview libnotify libdvdread libdvdcss libdvdnav lynx dvd+rw-tools ttf-ms-fonts ttf-dejavu terminus-font zip unzip hicolor-icon-theme xchm scrot gqview stalonetray xscreensaver virtualbox thunar-volman qt3 sdl amule transset-df

Configure thunar-volman by opening thunar and going to edit->preferences->advanced, then enabling volume management and
clicking configure. This will finish enabling you to hotplug flash drives, cds, dvds, etc and have them automount properly.

Virtualbox was one of the programs installed and will enable you to try out or use other Operating Systems as VMs like VMWare or Parallels. Enable it for your account with the following:
Run sudo gpasswd -a yourusername vboxusers and then add vboxdrv to the modules section in /etc/rc.conf.

MPD and Sonata are the music players installed. You could write a book on all the different ways to use MPD (including as a home music server!) but for a lone workstation the following configuration works well for me.
sudo cp /etc/mpd.conf.example /etc/mpd.conf
sudo nano /etc/mpd.conf

Change the user from mpd to your username and change the music and playlists directories making sure they are uncommented, then run:
sudo chown -R yourusername:users /var/lib/mpd/*
sudo touch /var/run/mpd/mpd.pid
sudo chown -R yourusername:users /var/run/mpd/*
mkdir ~/Music/Playlists
mpd --create-db
sudo chown -R yourusername:users /var/log/mpd/*

Add mpd to the daemons list in /etc/rc.conf, then run nano .config/sonata/sonatarc and add your username and password to the audioscrobbler section and set use_audioscrobbler to True if you want to enable it to scrobble your tracks to Last.FM.

There are a few programs we'll have to build ourselves to use. Our CD Burner, Xfburn is a good example. The following commands should get the job done.
cd ~/builds
wget
http://aur.archlinux.org/packages/xfburn/xfburn.tar.gz && tar -zxvf xfburn.tar.gz && cd xfburn && makepkg -s && sudo pacman -U *.pkg*
.

I use MIT-Scheme because I like it's interaction mode in Emacs and it's good for the SICP exercises. This program takes a few HOURS to compile though even with a powerful system and it can't be compiled on a system with less than 512mb of RAM, maybe less than 1GB. At any rate, you may not need it. If you do, I advise doing this:
cd ~/builds
wget
http://ftp.gnu.org/gnu/mit-scheme/snapshot.pkg/20080130/mit-scheme-c-20080130.tar.gz
&& tar -zxvf mit*.tar.gz && cd mit-scheme-c-20080130/src && etc/make-liarc.sh && make install && sudo cp etc/xscheme.el
/usr/share/emacs/site-lisp/ && cd /usr/bin && sudo ln -s /usr/local/bin/mit-scheme scheme

Then nano .emacs to insert (require 'xscheme) and save and exit.

I don't have an iPod. If you do you can probably just sudo pacman -Sy gtkpod and be in good shape but I use gnomad2 to load my music player with songs. To get it:
cd ~/builds
wget http://aur.archlinux.org/packages/gnomad2/gnomad2.tar.gz && tar -zxvf gnomad2.tar.gz && cd gnomad2 && makepkg -s && sudo pacman -U *.pkg*

Then sudo nano /etc/sudoers and insert this below %wheel All=(ALL) ALL:
%wheel ALL=NOPASSWD: /usr/bin/gnomad2
%wheel ALL=NOPASSWD: /sbin/reboot

This will make it possible to add menu entries for gnomad2 and to reboot the system that don't require passwords to be entered.

To setup wireless install wicd with sudo pacman -S wicd.
Disable the network daemon and any network interfaces wicd should manage, then add hal and wicd to the daemons list in rc.conf and run sudo gpasswd -a yourusername network.

To create a mercurial repository so I can hack code and do a bit more work on the menu I run
cd ~ && hg clone http://redlinernotes.com/code
mmaker -vf openbox


Fiddly Stuff:
Now, we're done with most of the serious business. From here on out it's mostly fiddly stuff. Fixing application settings to my preferences and so on. You've come this far though, why not go all the way? :-)

I adjust some commands to menu.xml to make my life easier. This menu is the one that shows up when you right-click on the desktop, by the way.
nano ~/.config/openbox/menu.xml and change the execute command for emacs to urxvt -e emacs -nw and the execute command for gnomad2 to sudo gnomad2. I'd also suggest adding an item that executes sudo reboot.

Make urxvt windows borderless and enable mouse control of window transparency by editing rc.xml and inserting:

no

beneath and inserting


transset-df -p --inc 0.2




transset-df -p --min 0.2 --dec 0.2


beneath the frame context in mousebindings.

To get dzen to display something useful in Xmonad pipe our already finished conky script into it like so:
nano ~/scripts/dzconky and insert:
#!/bin/sh

FG='#aaaaaa'
BG='#1a1a1a'
FONT='-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*'
conky | dzen2 -e -h '16' -w '1560' -ta r -fg $FG -bg $BG -fn $FONT


And then make it executable...
chmod +x ~/scripts/dzconky

The Xmonad config file will still need to be modified to work with that properly. I may or may not address that in an upcoming post.

The last thing I do is set the Openbox theme to Onyx with Obconf and go crazy perfecting my ~/.config/openbox/menu.xml file.
It's a bit big to quote here so I'll link to it as a sample. Here it is.

LARCH IT!
The cool part of this is as least partly that after building your own version of Linux from the ground up (with some help from Arch's package system) that you can make a Live CD out of it and give it to your friends. Hopefully you won't leave personal information or data on it though. Then again, if you're using it as your own personal install CD there's no better way to go. Here's how to do it.

sudo nano /etc/pacman.conf and insert this:
[larch5]
Server = ftp://ftp.berlios.de/pub/larch/larch5.3/i686/

then sudo pacman -Syu && sudo pacman -S larch larchin larch-live larchify dosfstools.

Finally, sudo ./larchify / to generate a restore/live cd image and burn it with wodim -v dev=/dev/cdrw /.larch/mylivecd.iso. Done and Done! Here's how it looks for me with everything finished. Click on the title of each picture for the high resolution version.

(Editor's Note: These pictures actually show the not quite finished system sans-transparency and the conky updates script. Also, at present wired connection users might as well not setup wicd as it won't autoconnect on boot though you can connect through it. Just leave dhcp enabled for eth0 in rc.conf.)

Clean Desktop:
Clean Desktop 07/07/08

Slightly Dirty Desktop:
Slighty Dirty Desktop 07/07/08
comments powered by Disqus

Unless otherwise credited all material Creative Commons License by Brit Butler