How to Make a Compact Gnome Theme

The themes Human Compact and Clearlooks Compact have been quite a success, and I got several requests to make a tutorial on how to create such a compact theme.

UPDATE: Human Compact Theme for Ubuntu 8.10 (Intrepid Ibex) is available!

Well, it is a bit difficult to create a step-by-step tutorial, but I will try anyways. Prepare to fiddle around with your configuration and try it out several times until you get the desired results.

  1. All your Gnome themes are located under /usr/share/themes. Find the theme of which you want to create a compact one, and copy it into your home directory with e.g.
    cp -r /usr/share/themes/Human ~/.themes/Human-Compact
  2. If there is a file index.theme, open it and change all the names (e.g. add “Compact” where appropriate). This file is necessary if you want to directly choose the theme from the Appearance Preferences; if it is not available you have to choose a theme and select “customize” to select the compact controls for it.
  3. Now to the fiddling part. Open gtk-2.0/gtkrc, and change lots of thickness and width settings… When you do this, always check how your changes work visibly, e.g. if the application still have usable borders etc. To help with the fiddling, I have added a diff of the Human vs. the Compact theme, you might be able to reuse some of the settings there.
  4. Once you are satisfied with your theme, you can create a .tar.bz2 distribution for backup or to be used by others, e.g. with this command:
    cd ~/.themes
    tar cjvf ~/Human-Compact.tar.bz2 Human-Compact
  5. That’s it. Have fun with your theme!

Read more

Create High Quality Flash Videos in Ubuntu

I recently got a nice new camera that can shoot HDTV videos, and the only way to show off the awesome quality to the world is by creating flash videos by myself. Here is an example:

Get the Flash Player to see this player.



I use Ubuntu, so this tutorial won’t work on Windows. I have encoded the video into the H.264 format, left the original resolution at 848 x 480, and the framerate at 30 Hz. I use constant quality setting because then the video look very good even when the camera moves quickly, and it uses less bitrate when not needed. The disadvantage is that the required bitrate is uneven, so make sure youre buffer is large enough before you start playing.

Here is how to do this:

  1. Encode your video with mencoder (click to install). It has to be x264 for video (0 or 1 bframes), and faac for audio.
  2. Convert the result into an mp4 using mp4creator (click to install), as described here.
  3. Now you have an mp4 file that can be played with JW player. Download it, have a look at the readme.html, and follow the example described there.
  4. The player requires 20 pixels in height, so add this to the SWFObject creation.

I have written a small ruby script to convert any movie to a MP4 file. The first parameter is the input file, second parameter is the framerate. Save this file as e.g. convert2mp4.rb.
Read more