Ian's Thoughts: How To: Change The Menu Icon In Ubuntu 9.04

ne of the first things most people do after installing a Linux distribution is to tweak settings and customize the desktop interface. One of the things I normally do in customizing the desktop interface is change the panel icon. Up until now I have been doing this by fiddling around in /usr/share/icons/$icon_theme and I never liked replacing system files even if the change was easy to revert. This tutorial was completed on an Ubuntu 9.04 system but the instructions may work on other distros.

I’m going to show you an easy way to change the menu icon for a menu bar panel applet in Ubuntu 9.04 without having to use sudo or tamper with the system icons. Why use sudo when you don’t have to?

This tutorial is organized into three steps:

  1. Creating a directory
  2. Creating an icon
  3. Restarting the panel

This is the default menu bar icon installed by the Ubuntu 9.04 system:

The default themes and colors included with Ubuntu 9.04 are very nice, but I’m not a fan of the colors orange or brown.

This is what my menu bar panel applet looks like after following this tutorial:

I’ve always been a fan of the Bluecurve theme included in Red Hat and earlier Fedora distributions so I will choose the old Fedora menu icon to match this beautiful theme:

Step 1: Create the necessary directory
This step is going to partially mirror the directory tree of a /usr/share/icons icon theme in ~/.icons. I like this method because it’s easy to change icons for any icon theme without having to escalate privileges. However, this method only works on a per-user basis. If you don’t want to have to perform these steps for every user on the system, then it’s probably best to make changes in /usr/share/icons/$icon_theme.

Creating the directory – command line method:

$ mkdir -p ~/.icons/$(gconftool-2 –get /desktop/gnome/interface/icon_theme)/24×24/places

Creating the directory – file browser method:
Create the following directory:

Where icon-theme-name is the name of your chosen icon theme.

This will create a directory used to store an icon that looks good in a panel that is 24 to 32 pixels in height. You should create other directories for panels which are different sizes (ie. 26×26, 32×32, 48×48 etc.) if you want the size of your menu icon to increase with the panel height. This will also require that you create different icons sized to match each directory that you create.

Step 2: Create an icon
Now that the necessary directory is in place, you should find yourself an appropriate icon. There are many icon themes locate here and here and any of these icons can be used. This icon can be in almost any format but may need to be resized to match the folder size that you created in Step 1.

Resizing the icon using The GIMP:

  1. Launch The GIMP.
  2. In the File menu click File > Open and browse to your desired image and click the Open button.
  3. In the Image menu click Image > Scale Image.
  4. In the Scale Image dialog choose your desired Image Size (I recommend choosing an image size that is equal to or smaller than your desired panel height). Click the Scale button.
  5. After your image is scaled, go to the File menu and choose File > Save As… to save the image as a .png file with the filename start-here.png in the places folder you created in “Step 1: Create the necessary directory”. You will need to repeat steps 2 through 5 for each directory you created in “Step 1: Create the necessary directory”. It is vital that the image be renamed to start-here.png or it will not be displayed on the menu bar.

Step three – restart the panel:
The gnome panel needs to be restarted in order to display the new icon in the menu bar.

GUI method:
Log out and back in

Command line method:

$ killall gnome-panel

The gnome-panel will respawn and you should see your shiny new menu icon.

Leave a Reply

Your email address will not be published. Required fields are marked *

To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image