how to add application to dock bar ubuntu code example

Example: add application to ubuntu dock

# add file to ~/.local/share/application/<application_name.desktop>

[Desktop Entry]
Version=1.0
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor
Exec=subl
Terminal=false
Icon="/opt/Sublime Text 2/Icon/48x48/sublime_text.png"
Type=Application
Categories=TextEditor;IDE;Development
X-Ayatana-Desktop-Shortcuts=NewWindow
Icon[en_US]=/opt/Sublime Text 2/Icon/128x128/sublime_text.png

[NewWindow Shortcut Group]
Name=New Window
Exec=subl -n
TargetEnvironment=Unity