Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to customize an old python script I like a lot, specifically gmail-notifier. It uses the default mail icon in the messaging menu instead of the gmail icon a lot of similar programs use. I was wondering how to go about using my own icon. I've been looking through the code and nothing stands out to me as to what to change for the small icon in the menu, I've only been able to change the pop-up notification icon. I tried changing the shortcut's icon, but that only gave an error icon in the messaging menu.

Anyway, I'm stumped... any advice?

share|improve this question
add comment

2 Answers

I've built a small gmail notifier app myself. There should be a piece of code in the python script which goes:

server = indicate.indicate_server_ref_default()
server.set_desktop_file("/usr/share/applications/gmail_notifier.desktop")

The .desktop file specified above is the one that determines the icon to be used in the messaging menu. The corresponding "Icon" key in my .desktop file looks like this:

Icon=mail-unread

The description for the "Icon" key, as given in the Desktop Entry Specification, is:

Icon to display in file manager, menus, etc. If the name is an absolute path, the given file will be used. If the name is not an absolute path, the algorithm described in the Icon Theme Specification will be used to locate the icon.

In my case, the second part of the above description applies (i.e., the algorithm described in the Icon Theme Specification is used to locate the icon corresponding to "mail-unread"). You can instead give the absolute path to your icon, as in:

Icon=/usr/share/icons/...

or you can try the following (it will work only if your icon theme has the icon, which is rare. That is why I'm using the generic icon "mail-unread".):

Icon=gmail

I'm not on my machine right now, but when I do get on it I'll tell you where exactly you can find your desired icon and what its name is. I also have links to (the very few) good resources which describe how to integrate apps with the messaging menu, but again I need to be on my machine for that.

If you're interested in the entire code for my app, I've got it on GitHub.

share|improve this answer
    
Okay, so i changed the icon in the .desktop file. No matter what icon I use or type, I get a weird icon that looks like an error icon. I tried a png and a svg. Why would it not be working? –  user16534 May 15 '11 at 4:15
add comment

There is no easy and clean answer to this question. I looked at the source code of gmail-notifier. There is no way to set an own icon using some configuration file. So you'll either have to change the source code, recompile and reinstall or change the existing icon file. If you choose the 2nd way, you'll find the icon in /usr/share/pixmaps/gnome-gmail-notifier.svg. When you replace this file by some other SVG the icon will change.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.