DSwain- The New Day

Sunday, April 02, 2006

Gnome is pwning my face

Seriously, I'm just having more and more fun with this thing all the time. It never seems to just let me go and live on peacefully, and I can't get enough of it.

Anyway, for anyone who uses a newer version of Gnome (<=2.0) you may or may not know that dealing with menus can be quite an annoyance, to say it in a polite way. The idea behind why it is hard to use, though, is good and somewhat justified.

As this website explains, Gnome makes good use of the gnome-vfs system. This is a special filesystem (vfs=Virtual File System) which is, to generalize and simplify it, a filesystem layer which sits on top of your actual filesystem of the actual hard disk. Gnome-vfs makes it easy to keep track of files across a computer and helps for developers to create applications with a little less tedious work. This is exactly the case as to why menu entries are a tough battle. What gnome-vfs does is reads these files (.desktop files) which are xml files specifying the information of the menu entries. It's designed like this to provide a standardize system of creating menu entries and a central location to access them from so you don't end up with as scattered of a filesystem. In other words, when a developer creates a program, they don't need to be able to handle the addition of a menu entry manually or in a very complex manner, but rather write a quick xml file with the information required and add it to this (/usr/share/applications/) directory. So, in other words, to answer the question of why it's so hard to work with; It's because in theory it makes it easier for developers and users to handle.

The problem is, what happens when that entry doesn't make it into its correct location? You've got yourself a nice situation, and I finally managed to figure out all of the above to figure out how to add these entries and they're not too complex at all.

My issue was with Gaim. Currently, I'm using a beta version of Gaim which was installed from source. If I had used pacman and stuck with the current stable, I would have had an entry. I may have needed to specify more information during compiling the source or something, so I'm not really sure why this failed me. At any rate, I needed to fix it, as it was becoming a real annoyance.

The first thing to do is get a good feel for the files and how they're set up. In all honesty, they're really not that complex of files. Here's the one I wrote for my Gaim entry:

[Desktop Entry]
Encoding=UTF-8
Categories=Application;Network;
Exec=gaim
Icon=gaim.png
StartupNotify=true
Terminal=false
Type=Application

Name=Gaim IM
GenericName=Internet Messenger
Comment=Send instant messages over multiple protocols

Really, not a complex file at all. First we specify that we're dealing with a desktop entry, and then provide the other information (executable file, the icon to use, etc.). Granted, if you don't know or understand what it's asking for, it could be somewhat confusing. Also another confusing problem you may deal with is if you started with what I did: an example straight out of the folder.

Name=Mozilla Firefox
Name[bn]=ফায়ারফক্স
Name[eo]=Mozilo Fajrovulpo
Name[fi]=Mozilla Firefox
Name[pa]=ਫਾਇਰਫੋਕਸ
Name[tg]=Рӯбоҳи оташин
GenericName=Web Browser
GenericName[af]=Web Blaaier
GenericName[ar]=متصفح ويب
GenericName[az]=Veb Səyyahı
GenericName[bg]=Браузър
GenericName[bn]=ওয়েব ব্রাউজার
GenericName[br]=Furcher ar Gwiad
GenericName[bs]=WWW Preglednik
GenericName[ca]=Fullejador web
GenericName[cs]=WWW prohlížeč

And so on with it... just to make it simple, you shouldn't need to worry about the additional GenericName(s) that are in another language. If you follow with what I wrote for an entry, you should be able to really just enter the language of your preference. Once you do that, simply save the file as the application with a .desktop extension. Something like this:

gaim.desktop

Save or move that into /usr/share/applications/ and then restart Gnome (or the panel) and your entry should appear. Or, at least, it worked for me.

Good luck!

0 Comments:

Post a Comment

<< Home