Single letter Gnome menu-bar applet by patching the source ("Applications" to "A", etc)

I use a single panel for all my stuff, so I need to keep it tidy. To access the Gnome menu, you have two applets: the menu applet and the menu bar applet. The menu bar applets shows "Applications Places Systems" which is nice, but takes up a lot of space. The menu applet only uses a single icon, but will hide the your bookmarks quite deep (if you have more then 4 bookmarks). My bookmarks are hidden at Icon → Placed → Bookmarks. To long if you ask me. Meanwhile the menu-bar applet uses to much space on the panel. All this results in an irritated user: me.

Open source to the rescue! I'll show you what I've done to get it to work, if you don't want to know you can just download the Ubuntu Karmic package from my ppa: https://launchpad.net/~bneijt/+archive/ppa

Now if you don't use the en_US locale, you could change the translation of Applications to state "A". But I use the en_US local and I don't like changing the translation for Applications as that would imply that in my local the word for Applications is actually "A", which it's not.

The best solution then is to edit the source. This will only change the application string at the single place instead of everywhere. To make sure we keep up with updates, we simply patch the package! Here is what I did.

Get the source

mkdir pg
cd pg
apt-get source gnome-panel

The package uses the quilt patch system, so a good way to go from here is to create a new quilt patch:

cd gnome-panel-2.28.0
quilt patch -a #Apply the current debian package patch set
quilt new single_letter_menu_names

Then we find the files responsable and add them to a new patch:
grep '"Applications"' * -r | less

This gives us, amongst others, gnome-panel/panel-menu-bar.c. So we mention it to quilt and then edit it:
quilt add gnome-panel/panel-menu-bar.c
gnome-open gnome-panel/panel-menu-bar.c

We change '_("Applications")' to '_("A")'. The other strings are in panel-menu-items.c in much the same format:
quilt add gnome-panel/panel-menu-items.c
gnome-open gnome-panel/panel-menu-items.c

That's it. Refresh the patch and get the hell out of there...

quilt refresh
quilt pop -a

Mention our work:

dch -i

Making sure you have something like "gnome-panel (1:2.28.0-0ubuntu6~ppa1) karmic; urgency=low" as the first line.

Then, simply build the package for your system:

debuild

I choose to share my build with you using my launchpad PPA, so you can install the resulting package from there if you want. I did:

debuild -S -sa
cd ..
dput my-ppa gnome-panel_2.28.0-0ubuntu6~ppa1_source.changes

So now you can find the patched gnome-panel Ubuntu Karmic package at: https://launchpad.net/~bneijt/+archive/ppa