how to add linux executable to dock code example

Example 1: how to add application to unity launcher

# add the application, path, icon, and save it under 
# ~/.local/share/application/programName
[Desktop Entry]
Version=x.y
Name=ProgramName
Comment=This is my comment
Exec=/home/alex/Documents/exec.sh
Icon=/home/alex/Pictures/icon.png
Terminal=false
Type=Application
Categories=Utility;Application;

Example 2: 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