Changing the icon of an application launcher in Unity

Posted by

You'd think this would be easy, right? You've just upgraded to Ubuntu 11.10 and it's got the fancy new "Launcher" for launching application. Now, it's not without it's problems, but here's one I wasn't expecting. One of my applications (SQLYog under Wine in this case) didn't have an icon. All I got was this:

Missing Icon

No big deal, right? In all previous version of Gnome (and Ubuntu) you could right-click on an icon, choose properties and select an icon. Guess what?

Right-click Menu

Not very useful, is it? So how do you do it? There's apparently not GUI at all for editing the icon of a launcher, and this is apparently the second version of Ubuntu to feature the launcher -- I might have accepted that there was no way to do it in version 1.0, but surely this isn't so uncommon that you need to be editing obscure files in hidden directories still, is it?

Apparently it is, because that's exactly what you need to do. So, which file does that launcher correspond to? I have no idea, because I couldn't figure out where that was configured. What I did find, though, was that in a subdirectory under ~/.local/share/applications there was a file called SQLyog.desktop (you will also find a bunch of .desktop files under /usr/local/applications). Opening up the SQLyog.desktop revealed the following:

[Desktop Entry]
Name=SQLyog
Exec=env WINEPREFIX="/home/dean/.wine" wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/dean/.wine/dosdevices/c:/users/Public/Start\\ Menu/Programs/SQLyog\\ Community/SQLyog.lnk
Type=Application
StartupNotify=true
Path=/home/dean/.wine/dosdevices/c:/Program Files/SQLyog Community
Icon=/usr/local/share/icons/hicolor/sqlyogcommunity.png

The Icon entry pointed to a file that did not exist (I'm pretty sure it existed in a previous installation of Ubuntu, but maybe the upgrade to 11.10 deleted it?). In any case, I edited that file to point to a file that did exist, save it, and... nothing. OK, maybe you need to log out and back in? Nope. Still the "missing" icon.

So perhaps the launcher is using some .desktop file that I couldn't find for this?

$ find / -name "*yog.desktop" 2>/dev/nul

Nothing doing. It only found the one that I was editing. So I gave up, pressing the Start key, I entered "main menu" which opens the main menu editor from the pre-Unity days, and I can see the menu entry for SQLyog in there has indeed picked up the new icon I gave it. So I tried something daring: what if I drag'n'dropped the menu item across?

Drag'n'Drop

What the heck is that? Clicking it, it just opens up my browser to the default page. How does dragging a program icon from the "main menu" editor result in a link that opens my browser? No idea.

Anyway, I eventually solved the problem by opening up the Start key menu, searching for "SQLyog", which came back with the correct icon (I don't know how... maybe it looks up the applications menu as well?). Don't launch SQLyog from there, because you end up with some "Wine Windows Program Loader" in the launcher instead. Instead, just drag the icon from the Start key menu onto the launcher.

But now the problem is, when I click the SQLyog icon, I still get that "Wine Windows Program Loader" icon in the launcher while the program is running. I guess even version 2.0 of Unity is still "rough around the edges".

The problem is, this only encourages people to turn off Unity which means the problems never get solved.

blog comments powered by Disqus