Home > Ubuntu > Create icon in Unity – Ubuntu 11.04 Natty Narwhal

Create icon in Unity – Ubuntu 11.04 Natty Narwhal

Ubuntu 11.04 Natty Narwhal has a new feature called Unity, which replaced normal Gnome’s menu. The way to create menu icon in Unity is different and not as obvious as in Gnome’s menu.

Here are the steps:
sudo gedit /usr/share/applications/{launcher_name}.desktop

with {launcher_name} is name of executable file.

For example:

sudo gedit /usr/share/applications/zendstudio.desktop

Copy contents below and paste into gedit

[Desktop Entry]
Version={Application's version}
Name={Application's name}
GenericName={Application's generic name}
X-GNOME-FullName={Application's full name}
Comment={Comment}
Exec={Path to executable file}
Icon={Path to icon}
StartupNotify={boolean, whether you want to notify with it executes}
Terminal={boolean, whether you want to execute by terminal}
Type=Application
Categories={Application's category}

Here is the rule for Application’s name, which I found on Gnome’s website

http://live.gnome.org/GnomeGoals/CorrectDesktopFiles

Rules

  • If Name is just the application name, leave alone
  • If there is no GenericName, leave alone
  • If Name == GenericName: remove GenericName
  • If Name embeds both the application name and the generic name
    • Add X-GNOME-FullName, with what was in Name
    • Set Name to the application name only

Here is an example of Zend Studio 8’s icon

[Desktop Entry]
 Version=8.0
 Name=Zend Studio
 GenericName=PHP IDE
 Type=Application
 Comment=Zend's PHP IDE
 Exec=/opt/ZendStudio/ZendStudio
 Icon=/opt/ZendStudio/icon.xpm
 StartupNotify=false
 Terminal=false
 Type=Application
 Categories=Programming;

Save the file, and that’s it.

As you can see, in the search box of Unity, you can either type {Name} or {GenericName}, the application you have just made will show up.

Advertisements
Categories: Ubuntu Tags: , , ,
  1. July 26, 2011 at 7:26 pm

    Thank you very much! That worked a treat for one of the Humble Indie Bundle games that doesn’t come with an icon.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: