Monday, January 07, 2008

Pimp my School Desktop

Ah, the first day back at school... I'm starting my second term of the school year and thought I'd celebrate by making my desktop environment just the way I like it on the university Linux computers. That means I'd have a leet hacker desktop that provides me with interesting information and no overhead. I ended up settling on Fluxbox for the window manager and gkrellm for system information. Unfortunately, I'm unable to use it on the Solaris workstations but at least it works on the CentOS Linux computers. Let's get started!

First we'll download the required source files:
wget prdownloads.sourceforge.net/fluxbox/fluxbox-1.0.0.tar.bz2
wget members.dslextreme.com/users/billw/gkrellm/gkrellm-2.3.1.tar.bz2


If these download locations change, you can just visit http://fluxbox.sourceforge.net and http://gkrellm.net and manually download the source files.

For our second step, we'll install fluxbox in our home directory. Normally, we'd want to install it system wide, but since we're merely users and not administrators of the system, this will have to do. To begin our installation, unpack the source files.

tar xvjf fluxbox-1.0.0.tar.bz2

x means extract, v means be verbose, j means use bz2 decompression, and f means we're dealing with a file. So that you don't consume your entire disk quota, you may wish to compile programs in the /tmp directory where space may be a little more abundant.

mv fluxbox-1.0.0 /tmp

Configure the pending installation for your operating system and architecture.

./configure --prefix=/home/username

Replace username with the path to the home directory that we will be using. If unsure, we can check what it is, by opening a terminal, and without changing directories, enter the command pwd, which stands for print working directory. By prefixing our configuration, we're stating that instead of installing the software to the root directory of the system, we want to install it in our home directory where it won't be erased. The rest of the installation is pretty straight forward.

make
make install


make compiles the source code and make install finally installs it in our home directory.

Let's customize a few things to make our fluxbox installation pretty and usable. Create a .xsession file in your home directory with the following contents to have it startup automatically upon login:

# Wallpaper
# if -a doesn't stretch, try -c to at least make it centered
# www.digitalblasphemy.com is a great place for wallpapers!
# Remember, fluxbox's themes have the ability to overwrite our background!
# To turn off the background from a given them, you may wish to comment
# out the lines beginning with background with a preceeding # from
# ~/share/fluxbox/styles/theme_in_use
/home/username/bin/fbsetbg -a /home/username/bg.jpg &

# System monitor (we'll install that next)
/home/username/bin/gkrellm &

# Fluxbox - It's what leet hackers use!
/home/username/bin/fluxbox


Notice the & used at the end of all, but the last, commands? This tells the computer to keep executing the next command instead of waiting for the current one to finish. We don't use & on the last command because if we were to continue past it, and indeed once it completes, our X session will terminate. By the way, if you mess something up where you can't login graphically. You would probably want to ssh in to the computer from a remote location and use your favorite text editor to fix the configuration file. Remember, when logging in, be sure to choose the system default session so that our custom .xsession file is used to setup the environment. In fact, choosing a different session may help out if you get yourself into a bind from incorrectly creating the session configuration. Also, notice how we're using the full filename of each command instead of the relative path? If you want to be able to execute the programs that the fluxbox installation put in your home directory without providing the full path after logging in, you would also need to create the following .bash_profile file in your home directory:

PATH=$PATH:/home/username/bin
export PATH


The first line appends the binary files directory, which the Fluxbox installation would have setup if it didn't already exist, to our path so that Linux will check it for executables we want to run. The second line exports our updated PATH variable to the environment so that the changes take effect after the script completes.

Alright, our desktop environment should be humming along now. If it's not, please feel free to comment on this post and maybe we can figure out the problem together. Onward to setting up gkrellm for all sorts of useful system information that can be displayed on the desktop!

Again, I recommend unpacking the source to the /tmp directory.

tar xvjf gkrellm-2.3.1.tar.bz2
mv gkrellm-2.3.1 /tmp


By reading the included INSTALL file, I found that gkrellm doesn't use a configure script like most Unix programs do. Recall that we used configure's prefix switch to set the installation path before. It turns out that we can achieve the same result with make in this case!

make
make PREFIX=/home/username install


Once gkrellm is installed and running (our .xsession file above will start it), let's right it and choose Configuration. Here we can enable the saving of it's location upon exit and, in the Properties tab, we can choose to keep it hidden from the taskbar and desktop pager.

Lastly, we should probably remove the unpacked source from the /tmp directory to free up the space we borrowed.

cd /tmp
rm -rv fluxbox-1.0.0 gkrellm-2.3.1


-r means recursive and -v means be verbose.

That's all! Now you too have a leet hacker desktop at school :)

1 comment:

Anonymous said...

Screenshots, yes?