3

I downloaded sublime text 2, unpacked it to /opt/sublime and created a link of /opt/sublime/sublime_text (executable) in /usr/bin so now I can just call it by typing "sublime" in console.

But it's not appeared in applications list: if I type sublime there, it won't be shown. Only if type sublime_text, I will see it. But there is more: when I click on it, it won't launch, nothing won't happen at all!

Besides, if I lock it Launcher, I won't be able to launch it: I close it, when I click on it on the Launcher panel, but it doesn't launch and nothing happens!

Why is that happening?

Alan Coromano
  • 850
  • 4
  • 16
  • 29

2 Answers2

4

You need to put a .desktop file in /usr/share/applications (for all user) or ~/.local/share/applications (for current user).

Here is custom desktop file, save it as sublime.desktop and put in the above location.

(gksu nautilus for root access in case you want to put it for all user)

Change the Exec & Icon entry as per your path

[Desktop Entry]
Name=Sublime Text 2
Exec="/opt/Sublime Text 2/sublime_text" %F
MimeType=text/plain;
Terminal=false
Type=Application
Icon=sublime_text
Categories=GNOME;GTK;Utility;TextEditor;Development;
Actions=New;

[Desktop Action New]
Name=New Editor Window
Exec="/opt/Sublime Text 2/sublime_text" --new-window

Source

Web-E
  • 21,338
  • 12
  • 52
  • 93
  • that's good. but doesn't it create a quick launch icon on a desktop as well? actually it doesn't. – Alan Coromano Apr 01 '13 at 12:37
  • No it doesn't create shortcut. desktop files are for searching in unity & locking at launcher. To create shortcut you need to drag the icon to desktop. See [How to create a desktop shortcut in Unity?](http://askubuntu.com/q/67925) – Web-E Apr 01 '13 at 12:50
  • @Web-E How come you're not using \ on the space characters in the path for Exec? Shouldn't it be `/opt/Sublime\ Text\ 2/sublime_text`? – Torcellite Dec 27 '13 at 05:21
  • No you [don't need escape sequence for `EXEC` key when value is quoted](http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables).Also can see [here](http://askubuntu.com/a/175567/35775). BTW the escape sequence for space in `desktop` file is `\s` – Web-E Dec 28 '13 at 05:36
2

I've been using PPA from webupdate. Here's how to install

http://www.webupd8.org/2012/06/sublime-text-20-stable-released-ppa.html

Barz
  • 784
  • 4
  • 6