How to add Sublime Text to Unity launcher

I am using Sublime Text to write this blog post. It is great piece of software. However, it is does not contain desktop file, so you need to create it separately.

Desktop file

Create desktop entry file and store it as ~/.local/share/sublime_text.desktop.

[Desktop Entry]
Name=Sublime Text
GenericName=Text Editor
Comment=Edit text files
Exec=/opt/sublime_text/sublime_text %U

Use desktop-file-validate command to validate its contents.

Unity launcher

Add above-mentioned desktop entry file to the Unity launcher. You can do this by hand (drag file to launcher) or just execute following command.

$ gsettings set com.canonical.Unity.Launcher favorites \
  "$(gsettings get com.canonical.Unity.Launcher favorites | \
     sed "s|\]|,'application://sublime_text.desktop'&|")"


Milosz Galazka's Picture

About Milosz Galazka

Milosz is a Linux Foundation Certified Engineer working for a successful Polish company as a system administrator and a long time supporter of Free Software Foundation and Debian operating system.