I've create a basic sublime.desktop file for Linux. This will both automatically show Sublime in Gnome's menus and allow you to set Sublime as the default editor for your files. If you're using Ubuntu, this file should be placed in the /usr/share/applications directory.

If you prefer not to have to mess with root, you can put it in ~/.local/share/applications/ as well. This will make it only show up for your account though. I personally put all my non-deb packaged programs into ~/.bin so I don't have to muddle with the system. Hopefully by release they will have a .deb and a .rpm.

I'm trying this under XFCE (Crunchbang linux / Debian squeeze) and I get the menu fine.

However when Sublime opens up after click on a file from the file manager the contents of the file are not displayed. If I drag and drop files into Sublime they open fine. I'm using the latest Alpha of Sublime 2. Anyone else have this problem?

Thanks for the reply but it doesn't make any difference for me. This could just be me not understanding XFCE but based on the other .desktop files it should work.

When I click a file that has been set to open with Sublime I get a new instance of Sublime every time and also the contents of the window is blank. This happen whether I have %U or not. See attached screenshot:

senshikaze wrote:If you prefer not to have to mess with root, you can put it in ~/.local/share/applications/ as well. This will make it only show up for your account though. I personally put all my non-deb packaged programs into ~/.bin so I don't have to muddle with the system. Hopefully by release they will have a .deb and a .rpm.

I agree, ~/.local/share/applications/ is actually a better place to put the desktop file. That being said, I prefer to put locally installed programs in ~/opt and then link the binaries in ~/bin (the local bin folder should automatically added to your path, at least that's what happens on all my Ubuntu machines).

Also, I am willing to create a deb and setup a ppa for Ubuntu if jps gives me the ok.

knitatoms wrote:Thanks for the reply but it doesn't make any difference for me. This could just be me not understanding XFCE but based on the other .desktop files it should work.

When I click a file that has been set to open with Sublime I get a new instance of Sublime every time and also the contents of the window is blank. This happen whether I have %U or not. See attached screenshot:

http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html defines the specs for the .desktop file. The spec is meant to be implementation agnostic, and %U is defined as "A list of URLs. Each URL is passed as a separate argument to the executable program. Local files may either be passed as file: URLs or as file path." I'm not entirely sure why it doesn't work for you, but try opening any .desktop file for a program that does work (found in /usr/share/applications) in a text editor. That should give you an idea of what does work on your system.