0

I downloaded SublimeText and placed it in my home folder. I locked sublimetext to the Unity launcher, but when I restart my PC the icon disappears from the launcher.

Why is this happening? Can I solve this somehow?

4
  • 1
    You should create a .desktop file and install it to your launcher. The procedure is described there: help.ubuntu.com/community/UnityLaunchersAndDesktopFiles you can also read my answer here and its corresponding question.
    – Byte Commander
    Feb 14, 2015 at 13:27
  • Did you install it from the tarball or the .deb installer? @Bytecommander : both versions come with a .desktop file. Feb 14, 2015 at 14:31
  • @JacobVlijm I don't know as I don't have this app. But maybe the files have to get installed as it is described both in the article and in my linked answer?
    – Byte Commander
    Feb 14, 2015 at 14:36
  • @ByteCommander I looked into both the tarball and the .deb installer of the Sublime download page: sublimetext.com/3. both do have a .desktop file. He probably used the first option, looking at "placed it in my home folder", and the .desktop file probably points to the wrong location or something like that. Feb 14, 2015 at 14:40

1 Answer 1

2

A .desktop file is needed. One way is to install sublime text editor via webupd8 ppa.

Version 3 (url):

sudo add-apt-repository ppa:webupd8team/sublime-text-3 
sudo apt-get update
sudo apt-get install sublime-text-installer

Version 2 (url, not tested, but should work):

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text

This adds a .desktop file to /usr/share/applications/.

Alternatively, add a .desktop file to $HOME/.local/share/applications/ manually. This should point to your binary.

This is the .desktop file from version 3 on my system:

# cat /usr/share/applications/sublime-text.desktop 
[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=/opt/sublime_text/sublime_text %F
Terminal=false
MimeType=text/plain;
Icon=sublime-text
Categories=TextEditor;Development;Utility;
StartupNotify=true
Actions=Window;Document;

X-Desktop-File-Install-Version=0.22

[Desktop Action Window]
Name=New Window
Exec=/opt/sublime_text/sublime_text -n
OnlyShowIn=Unity;

[Desktop Action Document]
Name=New File
Exec=/opt/sublime_text/sublime_text --command new_file
OnlyShowIn=Unity;
4
  • It seems a bit overdone to post a .desktop file, while all versions come with a .desktop file. If he needs an edited version, he can simply copy the one in /usr/share/applications or place the one that comes in the tarball in ~/.local/share/applications, depending on how he installed. Feb 14, 2015 at 14:35
  • It is not clear to me which version is installed. And since in the tarball v2.0.2 from sublimetext.com there is no .desktop file, I added one.
    – setempler
    Feb 14, 2015 at 14:46
  • Ah, I see. we need more info from OP. I assumed he would install the latest version. Without a .desktop file, he would however not be able to lock it to the launcher at all. Feb 14, 2015 at 14:49
  • You are right. But since sublime 3 is beta, still, this made me suspicious...
    – setempler
    Feb 14, 2015 at 14:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .