UPDATE!!!: This is an old guide, this is for configuring Ubuntu 8.04, not the current version, 8.10. Most of the information in this guide will still be relevant, but I would really suggest that you read my more recent guides first. I have not made an updated consolidated post like this one, but I will be doing that for Ubuntu 9.04. You can read my more recent posts related to Ubuntu 8.10 at this link:
and more recently, my posts on 9.04 Jaunty at this link:

So, now that you’ve finally gotten Ubuntu 8.04 Hardy Heron installed most people won’t be happy forever with the default desktop settings (me especially), so here is my guide to customizing and setting up Ubuntu 8.04 the way I like it. Each of these tips can be done independently, or pick and choose the ones you like. I’ll be using a fresh installation of Ubuntu 8.04 x86_64, but everything should be the same for both the 32-bit and 64-bit versions. The hardware I am using is a Lenovo x61 Tablet laptop, and a few of these customizations will be hardware specific, but I will not which are specific to who. If there is no note at the top, it should be good for everyone. The writing style nearly assumes that someone completely new to Ubuntu is reading this, however especially in the hardware specific sections, some advanced topics are covered. If you have any questions please leave a comment, and I will email you a response as quickly as possible. Or you could ask on the ubuntu forums at http://ubuntuforums.org Or you could join a Linux community, such as the ASULUG which is at http://asulug.org

I will start this off with a screenshot of the default desktop. Up at the top is the Applicatoins, Places, and the System menu, along with a few program shortcuts, the clock, power button, and the notification area. At the bottom is the “show desktop” button, the window list, virtual desktops list, and the trash. (yes, I still call it trash and not recycle bin. Nothing I put in there ever gets re-used. Ubuntu calls it trash too.)
Hardy Heron Default Desktop

Enabling Repositories and Installing Basic Codecs
The first thing I always do when I have a new installation of Ubuntu is to enable more repositories. Essentially, the repositories are servers where many Ubuntu software packages are held. However, when you have a fresh install, only a few of these are enabled, meaning that you can’t see all of the programs or software packages available to you. Change these settings by going to the System menu on the top, then Administration, then Software Sources. You will have to enter your account password here. (see note on “Sudo and the Administrator Password”) I go through all the tabs, and I check nearly every option. Check both under “Third Party Software”, under “Updates” it is your choice to check “Pre-released updates” and “Unsupported Updates” those are both repositories that will send programs that may have updated in the repositories since the distribution became available, but are not nearly beta updates, as they are generally just stable updates that have not yet been completely accepted by the Ubuntu community. And on the “Statistics” tab, it is nice to check the “submit statistical information” box just to help out find which programs are most popular. When you are through, select “Close” and an alert will pop up telling you that your information is out of date. Click reload, and then it should close. (if not, just click cancel the second time)

Now, to install the “Ubuntu Restricted Extras” package, go to Applications, then Add/Remove. At the top, under “Show:” change the option to “All Available Applications” then search for “Ubuntu Restricted Extras”. Check the box next to it, and click apply. This allows you to play MP3s, watch DVDs, view Microsoft Core Fonts, and a few other things. I would also suggest using the media player “VLC” instead of the default totem movie player, as VLC can handle many more formats than the other video players, and I believe it fetches codecies as you need them. More media compatibility is available by following this guide: https://help.ubuntu.com/community/Medibuntu

Middle Mouse-Scroll (Thinkpad Laptops only)
In order to get the middle-mouse button to scroll you need to edit a configuration file. This is probably the most “dangerous” step in the guide, it could make you unable to access your regular desktop without fixing an issue if something else gets changed, but if only these options are changed you should be fine. Even if something does go wrong though, it is an easy fix. (see appendix; restoring xorg.conf)

Just in case, ALWAYS BACK UP before editing xorg.conf. To back up, open a terminal and enter:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
What this does is it copies the xorg.conf file to another file named xorg.conf.backup in the same directory. If you have to revert to the original one from the failsafe terminal mode, or a live CD, you will need to enter the opposite:
sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf
That will replace the one you edited with the backup version you made before.

Now onto editing. In a terminal, enter:
sudo gedit /etc/X11/xorg.conf
You will then need to find the section labeled “Section “InputDevice”” that also has “Identifier “Configured Mouse”” in it. Mine is the second one on the list. Then put a pound sign (#) before each line in that section, and above it another line with a pound sign and “Original mouse configuration” The “#” means that line is a comment, and will not be read. Doing this gives you the opportunity to fix errors without erasing all of your configurations, and to know what you did. After the original section is commented out, type in this mouse section (above or below doesn’t matter) If you choose to copy-paste this section, make sure you re-type each quotation mark, because wordpress changes quotes to curved quotes instead of straight quotes, and the curved will cause an error.:
#Configured Mouse
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "Protocol" "ExplorerPS/2" #IMPS/2 is not recommend for TrackPoints
Option "Device" "/dev/input/mice"
Option "EmulateWheel" "on"
Option "Emulate3Buttons" "on"
Option "EmulateWheelButton" "2"
Option "YAxisMapping" "4 5"
Option "XAxisMapping" "6 7"

Note: I would tab over all the lines between Section and EndSection just to keep in the same format as the rest of the file. My blog won’t let me tab it over in the post. Here is a screenshot of the original and final xorg.conf files next to each other.
original and backup xorg.conf files
Then save the file, and restart your computer. Hopefully everything will work out great and you will now have a working middle mouse button, if not though, log into the Failsafe Terminal mode and either fix the error, or restore the backup. If you see random brown pixels on the desktop, clicking doesn’t work like it used to, or something is much more messed up, restore the backup or reconfigure using the instructions in the “Repairing xorg.conf” section in the notes.

If you have issues with the middle mouse button acting as “paste” as well as scrolling in Firefox, (an issue I found very annoying while writing this blog) all you need to do is open a new firefox tab, and navigate it to about:config then in the filter bar type “mouse,” and change the value of middlemouse.paste to false by double-clicking on it or right-clicking on it.

Setting up the Tablet
Thinkpad x61 or x60 tablet only (I think. But it might work for other wacom tablet computers as well.)

This again requires editing the xorg.conf file, so make sure you have at least one backed up copy of it already. If not, see the Middle Mouse Scroll section. Backing up xorg.conf before making edits is VERY IMPORTANT.
in a terminal:
sudo gedit /etc/X11/xorg.conf
then scroll down the the very bottom. Here you will find a section that looks like this:

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Synaptics Touchpad"

(of course, the correct line spacing will actually work… unlike wordpress’s)
change that so that it looks like this:

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Synaptics Touchpad"

#added to get tablet working
InputDevice “stylus” “SendCoreEvents”
InputDevice “cursor” “SendCoreEvents”
InputDevice “eraser” “SendCoreEvents”
InputDevice “touch” “SendCoreEvents”

Then, above that, make a few more lines, and then add in this:

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom" # USB ONLY
Option "Type" "stylus"
Option "USB" "on" # USB ONLY
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
Option "Button2" "3" # Added for stylus click

Section “InputDevice”
Driver “wacom”
Identifier “eraser”
Option “Device” “/dev/input/wacom” # USB ONLY
Option “Type” “eraser”
Option “USB” “on” # USB ONLY
Option “ForceDevice” “ISDV4” # Tablet PC ONLY
Option “Button3” “2” # Added for eraser working

Section “InputDevice”
Driver “wacom”
Identifier “cursor”
Option “Device” “/dev/input/wacom” # USB ONLY
Option “Type” “cursor”
Option “USB” “on” # USB ONLY
Option “ForceDevice” “ISDV4” # Tablet PC ONLY

# This section is for the TabletPC that supports touch
Section “InputDevice”
Driver “wacom”
Identifier “touch”
Option “Device” “/dev/input/wacom” # USB ONLY
Option “Type” “touch”
Option “ForceDevice” “ISDV4” # Tablet PC ONLY
Option “USB” “on” # USB ONLY

Now I would like to note that “touch” does not work yet with this tablet driver. However, It was in the manual, which means that it eventually could work, which would be amazing. It does not cause me any errors to have it in there though, so I figure it won’t hurt. If you wish, remove the section “for the TabletPC that supports touch” and the “touch” line in the server layout section at the bottom.

With this setting, the tip of the pen will act as a regular “left-click”, the button on the pen will act as a “right-click” and the eraser will act as a regular left-click except in applications that support the eraser.

My favorite of such eraser-supporting applications is called xournal. This is a note-taking program that allows a combination of tablet and typing, and lets you annotate PDF files. Very handy for taking notes in my engineering classes. However the eraser does not work correctly by default in this program. In order to get it to work go to Options, and check Use XInput, Discard Core Events, and Eraser Tip. Then, Options > Button 3 Mapping > Highlighter, and back to Options to select Auto-Save Preferences and Save Preferences. Then your pen will work nicely in Xournal from now on.

image of xorg.conf next to tablet writings in xournal

References: The Linux Wacom Project (man wacdump)

Lenovo Fingerprint reader (Lenovo Thinkpad laptops only!)

I suggest that before you do this you practice a few times. You must swipe your entire finger, and it is going to have to be at a slow and uniform speed. My thumbprint swipe takes about one second. I would like to post a video of this because people seriously have a very hard time with it, however I do not currently have a video. And it would be boring. But if i ever come across a video of correct thumb swiping procedure, I will be sure to post it.

In a terminal, enter:
sudo apt-get install thinkfinger-tools libpam-thinkfinger

Once that is complete enter:
sudo tf-tool --acquire

It will then ask you to swipe your finger three times. Do this and it will count each successful/ failed swipe. You need three successful swipes to finish. Then enter:
sudo tf-tool --verify

This will ask you to swipe your finger once, and will tell you if it matches or does not match. Now you need to make sure it actually uses that fingerprint information in password situations.
sudo gedit /etc/pam.d/common-auth

and change the contents of the file to read like this:
auth sufficient pam_thinkfinger.so
auth required pam_unix.so nullok_secure try_first_pass
auth optional pam_smbpass.so migrate

It should only be changing the first line and adding something to the second line, so I did not back up. I would suggest backing up if you are not comfortable in being able to undo that easily. Save and close, then enter:tf-tool –add-user $USERNAME
tf-tool --add-user $USERNAME
replacing “$USERNAME” with your username (should be all lowercase)
(Note: I don’t know if this needs to have sudo before it or not, but I tried both and both gave me an error. However when I logged out my thumbprint worked, so for now ignore the error.)

Now when you log in or need to enter your password in the terminal for sudo or need to enter it for nearly everything else, you can either slide your finger or type your password. For things like the Synaptic Package Manager or the Add/Remove Programs, it will not tell you that swiping oyur fingerprint is an option, but it will work anyway. (it will just say “enter your password”)
This does not however work for the screensaver password or the sleep-mode wake up password. For that you will either have to actually type in your password, or follow this marginally simple guide: http://www.thinkwiki.org/wiki/How_to_enable_the_fingerprint_reader_with_ThinkFinger and go to the section titled “xscreensaver/gnome-screensaver.” This is not in this guide because I like to have to type my password after a screensaver or sleep mode, and this is after all a guide to get Ubuntu set up how I like it.

Ondemand CPU Frequency Governor

The Ondemand CPU Frequency Governor automatically adjusts the CPU frequency in order to save power. It does not simply set the frequency to the lowest setting, because even if you are saving energy, the longer the CPU is in use the more power it uses. So this adjusts the frequency to complete processes as quickly as possible, so it can return to a low power state for longer periods of time, reaching longer and lower sleep levels.

Make sure all package managers are closed, open a terminal and enter each of the following in order:
sudo modprobe acpi-cpufreq
sudo modprobe cpufreq_ondemand
sudo aptitude install sysfsutils
sudo -s
echo "devices/system/cpu/cpu0/cpufreq/scaling_governor=ondemand" >> /etc/sysfs.conf

For the first two, it is good if you do not see any response from the terminal. It only responds on errors. After this, close the terminal window and reboot your computer. After the reboot right-click on the panel where you want the CPU monitor, and select “add to panel” then add the CPU Frequency Monitor. . Then in a terminal enter:
sudo dpkg-reconfigure gnome-applets
select “ok” and “yes” and bam! Now each time you left-click on the CPU Frequency Monitor you can choose from the available frequencies, or the available automatic options. Remember, Ondemand is the best for battery life.

sources: http://forum.thinkpads.com/viewtopic.php?t=50949&postdays=0&postorder=asc&highlight=ubuntu&start=0

Installing/Restoring a Pidgin backup.
I keep logs of my AIM conversations, and it is very obnoxious that when I upgrade to a new version I loose all the previous logs. Even if you do the Import Settings for Gaim, it doesn’t bring up logs or settings. So all I did to back up was to copy some files from the .purple folder from my Home folder on the old version to the new one. (note: “.purple” is a hidden folder, you have to press ctrl-h when in the home folder to see it) That means I copied the following files: logs, accels, accounts.xml, blist.xml, cap.db, otr.private_key, prefs.xml, status.xml. (note: “logs” is a folder) If you had plugins installed previously, you may want to re-install plugins, by going into synaptic, searching for “purple” and checking and installing libpurple-bin and pidgin-plugin-pack. Or instead of synaptic, you could (in a termainal) enter:
sudo apt-get install libpurple-bin pidgin-plugin-pack

Accelerometer and Automatic Screen Rotation


The first thing you need to do is set up the accelerometer. Doing this in Ubnutu Hardy no longer requires recompiling a kernel, which is pretty awesome.

just to make sure everything will work, in a terminal do:
sudo modprobe hdaps_ec
sudo modprobe tp_smapi

If those commands don’t return any errors, then you are in good shape.

you should then edit the kernel modules loaded on startup (if you want this to always work) to include those two.

sudo gedit /etc/modules

and add the two lines:

then save and close gedit.

Test everything to make sure it is working properly

install hdaps-utils in synaptic or in the terminal with:
sudo apt-get install hdaps-utils

then run the accelerometer test by either pressing alt-F2, or running “hdaps-gl” in a terminal. Then make sure that the image reflects the actual rotation of the laptop (for example, does tilting it forward make the picture of the laptop tilt forward?). If not, go HERE and follow the troubleshooting section. Hopefully though, everything will work and you can continue on to the screen rotation.

If you don’t want automatic screen rotation, or you just want to play around with this some more, you can do things like play Neverball which is like super monkey balls (install it from the add/remove programs program, or synaptic). But I don’t know of much else (I believe the hard drive protection is not working without a recompiled kernel at the moment).

Screen Rotation

Add the python-xrandr PPA repo by opening up the “Software Sources” program and adding the following line to the “Third Party Sources” list, or by adding the line to the bottom of /etc/apt/sources.list
deb http://ppa.launchpad.net/displayconfig-gtk/ubuntu gutsy main

Then do:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install wacom-tools python-xrandr

Next download the atorotate.py script written by Krizka from here (sorry for posting someone else’s script, but I don’t know how to write python anyway, that’s a project for another day) and move it to /usr/local/bin. For example, if you downloaded it to your desktop the code would be:
sudo mv /home/$USERNAME/Desktop/autorotate.py /usr/local/bin replacing “$USERNAME” with your username.

Then make sure it is executable:
sudo chmod +x /usr/local/bin/autorotate.py

create a file for “tabletmode” with the command:
sudo touch /etc/tabletmode

To create files that make an acpi event for putting the tablet up and down, first do:
sudo gedit /etc/acpi/events/swivel-down
and enter into that file:
# called when tablet screen swivels down (into tablet mode)
event=ibm/hotkey HKEY 00000080 00005009
action=echo tablet > /etc/tabletmode

sudo gedit /etc/acpi/events/swivel-up

and enter:
# called when tablet screen swivels up (into laptop mode)
event=ibm/hotkey HKEY 00000080 0000500a
action=echo laptop > /etc/tabletmode

Once this is finished, you have to restart ACPI (this does not restart your computer)
sudo /etc/init.d/acpid restart

Then edit /etc/gdm/Init/Default in order to get the python script to run on startup (including before login)
sudo gedit /etc/gdm/Init/Default
then before the line that reads “exit0” add:

Save all of your work and then run the following to restart GDM (this does log you out of your computer):
sudo /etc/init.d/gdm restart

The only issue I have found so far is that with automatic screen rotation, you must first disable compiz graphics. If you have the CompizFusion Icon in your system tray (as I recommend below), all you need to do before you flop your screen is right-click on the CompizFusion Icon, choose “select window manager” and choose “metacity”. Then when you are through with your rotated shenanigans, simply change the window manager back to Compiz.

Many thanks to the following posts on krizka.net for this information. I did not know how to do the accelerometer or screen rotation before reading these.

Setting up Compiz Desktop Effects
My laptop (Lenovo Thinkpad x61-t) has a blacklisted video card, the Intel X3100. In order to enable desktop effects with a blacklisted card do the following:
enter sudo gedit /etc/xdg/compiz/compiz-manager in a terminal. At the end of the file, type SKIP_CHECKS="yes" then save and close gedit and the terminal.

After you have done that, or if you do not have a blacklisted video card, enter the following in a terminal:
sudo apt-get install simple-ccsm compizconfig-settings-manager fusion-icon
Then (if you chose to install fusion-icon in the line above) go to System > Preferences > Sessions and create a new startup program. You can name it whatever you want (I chose “Fusion Icon”) but for the command enter fusion-icon -n This will put an icon in your notification area that allows you to turn on and off compiz effects, saving power, increasing performance, and stopping compatibility issues when you need it to. the -n in the startup means that compiz will not be restarted when fusion-icon starts.

Now go to System > Preferences > Appearance (and while I’m here I change the theme to Human-Murrine because I like it better) then click the Visual Effects tab and select Custom. If you are satisfied with the lame preferences menu offered there (courtesy of simple-ccsm) then that’s all, but I am not.

To get to more exciting settings and options, click close, and go to System > Preferences > Advanced Desktop Effects Settings and tweak away. (Note: if you had to add “skip_checks” to the compiz config file to get a blacklisted card working, don’t try the rain as it could freeze up your computer.)

Just for fun, here is what I change the settings to:
Enable Desktop Cube
Enable Rotate Cube
Enable Widget Layer
Disable Animations
Enable 3-D Windows
Enable Window Previews
Cube Caps

Then in the Simple ccsm, I go to the Desktop tab, and change Desktop Columns to 3 (making it a triangle, not a cube, but I don’t use more than 3 desktops), and under the Edges tab, I change the top left corner to Initiate Window Picker and the top right corner to Expo Edge.

Then, back to the advanced settings manager again (I do it in this order to make sure all the settings are kept)
Desktop Cube > Appearance > Cube Color and set Opacity to 0. Then under Skydome, I set the skydome to this image resized to 2048×660, due to video card limitations, and converted to PNG. (to find your max resolution, enter glxinfo -l | grep GL_MAX_TEXTURE_SIZE in the terminal, and the number returned is the max size any one side of an image can be.)
. and enable animation. Under the Transparent Cube tab, set Opacity on Rotate to 35.
After that, under Cube Caps > Appearance, set the opacity on both cube top color and cube bottom color to 0.

I have a significantly customized desktop look. Very nearly stolen from here: https://help.ubuntu.com/community/SimplyStunningLinuxDesktop Most of my configurations are aimed toward fitting more things on my screen at once, because I have a very small screen and can’t afford to have two panel bars.

Right click on the clock, go to Properties, uncheck “Show Date” and “Show Weather”.
Right click on a blank spot in the middle and go to properties. click “Show Hide Buttons” uncheck “Show arrows on hide buttons” and make the size 23 (or the smallest possible.)
Go to the Background tab, select “Solid Colour” and move the opacity slider so the left edge of the slider is at the left edge of the “n” in “Transparent”.
Then right-click and remove each of the “Acessories” “Places” and “System” menus. Then right-click and Add To Panel the Main Menu option, put that all the way at the left edge.
Remove the three shortcut icons, and replace them with a drawer.
Then unlock and move the Window List, right-click on it, go to Preferences, and select Always Group Windows.
Move the Trash Can to the top right, and the Workspace Switcher to the direct left of the clock.
Remove the User Switcher, move the CPU Frequency Monitor directly to the left of the Notification Area, and lock everything.
Now delete the bottom panel.

Set the Desktop background to http://en.wikipedia.org/wiki/Image:Pomegranate03_edit.jpg

Now add a Terminal shortcut to the Drawer, a Firefox Shortcut, Thunderbird Shortcut, Pidgin Shortcut, and an Xournal Shortcut.

Then open a terminal window, right-click in the blank area and select “Edit Current Profile” and on the Effects tab select “Transparent Background” with the slider going from the middle of the “r” to the middle of the “d”.

And now your desktop should look like this:
The Fully Customized Deaktop
Isn’t that beautiful?


Sudo and the Administrator Password
The password is required every time you change system settings as a security feature. This is one way to thwart such things as malicious softwares (viruses), malicious people touching your laptop (co-workers, friends, enemies), and mostly just to prevent you from breaking everything on your system. Essentially, you can’t break a Linux system without entering the password (at least the way Ubuntu is set up). So this means every time you type “sudo” in the command line, or every time you enter your password, you are accessing things that change how the system works, and there is a possibility of messing stuff up. So just be careful.

Essentially, the repositories are servers where many Ubuntu software packages are held. However, when you have a fresh install, only a few of these are enabled, meaning that you can’t see all of the programs or software packages available to you. You can think of the repositories as a giant library of programs that are free for you to use. The only downside to the repositories is that they often do not have the most updated versions of software feature-wise. This is because with each release of Ubuntu, they “lock” the repositories right before release, taking the stable versions of whatever programs are available at that time. This ensures near complete stability and compatibility with programs installed from the repositories. Security-related updates are added though, so it is not as if you are left unsecured due to lack of updates.

Repairing xorg.conf from Failsafe Terminal
There are two methods of recovering from an xorg.conf error. The first one is probably the best. When you get to the log on screen click the button in the bottom left corner. Then select Sessions and the Failsafe Terminal session. This will give you a terminal window that you can fix everything from. (for me it is off the screen mostly, but that doesn’t matter.) If you already have made a backup (which you should have if you have any sense!) then you should be able to enter:
sudo cp /etc/X11/xorg.conf.backup /etc/X11/xorg.conf
or replace the first filename with whatever your backup’s name is. If you don’t remember the name of the backup you will need to first do:
locate xorg.conf
then follow the first command with whatever file you determine to be your backup as the first filename.

If this does not work, then you have a more serious issue. It means that your backup was either also messed up, or something else is wrong. If editing xorg.conf caused the error, then to fix it enter the following command:
sudo dpkg-reconfigure -phigh xserver-xorg
That command automatically remakes you a new xorg.conf file (and backups up your current one in the format of xorg.conf.4-8-15-16-23-42 or other less ominous numbers.) This pretty much leaves you with whatever xorg.conf you had at install. Which is good, because now you get another chance to reconfigure everything and mess it up! (if you really are having problems ask in the comments or on ubuntuforums.com)

External Resources / References:
http://tombuntu.com/ Tombuntu is a blog about Ubuntu, with many tips and guides similar to this. I often reference it when I can’t remember things. A few of these I found out about first from Tombuntu.
http://forum.thinkpads.com Thinkpads.com forums are the best support forums for thinkpads anywhere.
http://thinkwiki.org A Wiki dedicated to running Linux on Thinkpad Laptops.
http://ubuntuforums.org The Ubuntu support forums. These can be a bit too busy most of the time, but there are tons of people answering questions all the time.
https://help.ubuntu.com/community/ The Ubuntu Community Documentation website. This is an extremely useful wiki, but it can sometimes be outdated, so make sure you know what it is telling you to do.

This guide is incomplete due to me being very busy. (Finals week) but I will be completing parts as often as I can. Last updated 04.27.2006 at 12:13 PM -aliencam