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:
- Creating a directory
- Creating an icon
- 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:
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:
- Launch The GIMP.
- In the File menu click File > Open and browse to your desired image and click the Open button.
- In the Image menu click Image > Scale Image.
- 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.
- 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.
Log out and back in
Command line method:
The gnome-panel will respawn and you should see your shiny new menu icon.