Add app icon on Ubuntu Dock

In this example we are going to create a profile for Thuderbird email client which will expose startup icon to our Ubuntu Dock. Once you download Thunderbird client (if you prefer .tar format), extract it to your Applications or any other folder:

tar xf thunderbird.tar

Now what about profile? All profiles for Dock are stored in `~/.local/share/applications`. And all profiles have `.desktop` extension. Let's create one for Thunderbird!

Here is example:

[Desktop Entry]
Version=1.0
Name=Thunderbird app
Comment=Thunderbird
Exec=/home/nick/Applications/thunderbird/thunderbird-bin
Icon=/home/nick/Applications/thunderbird/chrome/icons/default/default256.png
StartupWMClass=Thunderbird
Type=Application
Keywords=email;thunderbird;
X-GNOME-UsesNotifications=true

Alright, a small breakdown of unknown parts:

Exec -> a binary/script which is invoked when you press an icon on Dock.
Icon -> icon for your app exposed in Dock
StartupWMClass -> alright, this one need a bit of explanation. We need to get a WM tag of the window, to get this tag you should firstly run the app (/home/nick/Applications/thunderbird/thunderbird-bin) and once the window opens, run:

xprop | grep WM_CLASS | awk '{print $4}'

and then click on your app window. Yes, it requires you to have terminal and app side by side, however it is required to get a WM_CLASS for your app. After the click result will be echoed to the terminal.

Keywords -> a set of keywords separated by semicolon which your application can be searched on.

Voila! When you restart machine your icon will be displayed and application can be searched on.