June 30, 2007

Archlinux - First Impressions

After having been faithful to Ubuntu for about 3 years, I decided a month back to try another distro on my Thinkpad X 40. Debian or Suse did not seem to be different enough to be of interest. So I decided to try out something that is more 'hands on' than Ubuntu. After trying out a couple of distros on Virtualbox (by the way - another use for virtual machines), I decided to give Archlinux a try.
Now I have Arch running for a week and am actually typing this from Arch - so it is time to give my first impressions. The main things that stand out in comparison to Ubuntu are -

System configuration

The Arch philosophy is to avoid using GUIs for configuration. Most of the configuration is done in /etc/rc.conf. The configuration files are well organized and nicely commented so that just a few days of using them and you begin to wonder why on earth you need a GUI for this.

Lean System

The recommended way to install Arch is to install the base only first and then add the packages you want. It is amazing how lean and fast the system feels when you do this. Ubuntu is very scaleable so that you can again do a server only install and then install the required packages, but I have never installed it that way and dont know if that would give a system as lean and fast as this.
I have installed the packages I want and overall the system is significantly faster than when I use Ubuntu - I think it is the combination of having only required packages and these being i686 optimized. Suspend works beautifully and suspend and resume are much faster too.

Rolling updates

Arch has a system of rolling updates so that the different 'releases' are little more than arbitrary snapshots. Each day is a new release! I did the base install from an older release, but it is a breeze from there to update the base packages and then proceed. The rolling release means that the packages are often newer than those in Ubuntu (where I have had problems with older versions for quite a few apps).

Package Manager

Pacman is an awesome package manager. While aptitude (or apt-get) has been good in Ubuntu, I think pacman is faster and more advanced. In Ubuntu, there is also some confusion with many ways of installing packages (Synaptic, Add/Remove, apt-get, aptitude, etc). Having one way to do it is simpler.

Summary

Archlinux is a splendid choice for an intermediate to advanced linux user who wants to try a leaner, faster and more flexible system. It is more demanding and takes more time to install than Ubuntu, but it is not as bad as Gentoo while still resulting in a very fast system and I think the extra time and effort is well spent.
Looking at Ubuntu a little critically, I think it has become a gateway for newcomers emigrating from Windows. So most of the development seems to be going into easier installs, newbie-friendly single click configuration, GUIs for everything, etc. Arch, with almost opposite philosophy has been a refreshing change.

June 2, 2007

10 tips to customise you new Ubuntu install

One of the best things about linux is that you can customise every aspect of it so that your computer really feel like yours. Here are a list of 10 things I do with a fresh install. These only reflect my preferences, but they should serve to let a newcomer know what tweaks are possible.
The first three are related to the terminal - so those resolved not to touch the terminal can safely skip them.

1. Terminal - looks

(i) Open the terminal, go to Edit -> Profiles and make a new profile with your name. In the 'General' tab, change the font and the font size to something you like.
(ii) In the 'Title and Command' tab, you can choose to keep a fixed title (maybe just your name or a favorite quote) or if you enable dynamically-set title, you can have the title show dynamic information like the current directory.
(iii) In the next tab 'Colors' you can choose the background and foreground colours for your terminal and then you can set some degree of transparency in the next tab if you like it.
(iv) Finally, in the scrolling tab, you can disable the scrollbar if you prefer. In addition, if you right click in the terminal and uncheck 'Show Menubar', you have a pristine looking terminal without a distracting menubar or scrollbar and in colours and fonts that you like !

2. Terminal - prompt

The default prompt in ubuntu is usually in the form 'user@hostname:directory'. No worries, you can change it to your heart's desire. Again open ~/.bashrc. 'PS1' represents you command prompt and is defined in this file. Below the line defining your default prompt, you will find a commented out section defining a color prompt. You can uncomment this to get a prompt which is of a different color from the rest of the text. In addition, you can change the format of the font. Just remember that '\u' stands for username, '\h' for hostname and '\w' for the present working directory.

3. Terminal - aliases

Setting up aliases for commands that you use commonly makes life a lot easier. You can define these in the .bashrc file again. Towards the end of the file you will notice that there are some aliases already defined and commented out - you can use them if you want to. In addition you can define your own aliases. My favorite is to set up an alias for installing programs so that I dont have to type 'sudo aptitude install' or 'sudo apt-get install' everytime. So at the end of my bashrc I have these lines -

#My aliases
alias getme='sudo aptitude install $1'
alias batt='acpi -V | grep Battery'

Now I can just type 'getme abiword', for example, when I want to instal abiword ! The other alias allows me to check the battery status on my laptop from the terminal by just typing 'batt'. Very useful when I have all the panels hidden and therefore cannot see the battery status applet.

4. Desktop - themes

Changing the wallpaper and windows themes to suit your taste is of course the most common way of customizing the looks. http://www.gnome-look.org/ is an excellent resource for wallpapers and themes if you want to go beyond the choices in the default install. A good idea is to choose the wallpaper first and then select a theme that matches the wallpaper in color and look. The themes are usually downloaded as 'xyz.tar.gz'. Dont uncompress them - just go to System -> Preferences -> Theme and drag the file you downloaded to install it.

5. Desktop - panels

Once you have the wallpapers and the theme set up, you can turn to the panels. You can add more panels or remove existing panels according to your taste. If you have a small screen, autohiding panels is useful to increase your screen estate. However, when you right click on a panel and choose 'autohide', you will find that a bit of the panel still sticks out. This is because the autohide size is 6 pixels by default. If you dont like it, open gconf-editor and then go to '/apps/panel/toplevels/top_panel_screen0' and change 'auto_hide_size' to 0. Now, the panels stay well hidden and you have the full screen.
However, to see something on the panel now, you have to hover over the edge with the mouse. A cool trick is to bind toggling the autohide to a keypress, so that you can hide and show the panels by just pressing a key. See this post to learn how to do this.

6. Custom keymaps

Extra keys that you dont need or that dont function can be mapped to suit your needs. On my thinkpad, for example, this allows me to use the 'Access IBM' key and the forward and backward keys.
So let us say you want to map a key to run the hide panel toggle script. We first need to find the keycode for this key. Open a terminal and type 'xev' and press enter. A small window opens now. Press the key and look at the output in the terminal. Among the output, you will find something like 'keycode 44'. We can now map this key as F13 for instance. To do this create a file called .Xmodmap in your home directory. Type 'keycode 44 = F13' in this file. The exact keycode will vary depending on the key you are mapping, of course. Save the file and reboot for the key to become active. Now you can map any command to this key.

7. Grub

(i) Open /boot/grub/menu.lst. There are a couple of things you can modify according to your taste. Look for the entry 'default'. This determines the default choice that will be booted. 0 means the first entry is default, you can count down the entries to select another to make the default.
(ii) If you rarely use the other options (like me), you can uncomment the line 'hiddenmenu'. This means that you wont see the menu during boot up normally, but you can press the Esc key to bring it up when you want it.
(iii) The entry 'howmany' determines how many kernels you can see in the menu. You can change it from default all to something like 'howmany=3' if you dont want all the kernels to accumulate in you menu.lst.
(iv) Finally, those who miss the text during the boot up, remove 'quiet' from the kernel line - now you will see the bootup steps being displayed while the system starts.

8. Boot up - splash

If you want to change the image that comes at the splash screen, you can look at http://www.gnome-look.org/ for some alternatives. Once you choose an image you like, gnome-splashscreen-manager is a nice frontend to modify the grub splashscreen. Just install this with aptitude or synaptic.

9. GDM

Similarly, you can change the gdm image that comes up when you log in. Again choose alternatives you like. You can run 'gdm-setup' to change the image.

10. Firefox - themes and add-ons

Finally, to get to the magic number of 10 - install a theme and add-ons for firefox. Again, you can choose the theme to match the system theme and the wallpaper. The add-ons that I find most useful are 'Download statusbar', 'Faviconize tab', 'Image zoom', 'Noscript' and 'tabmixplus'.