How to add a custom program to "Open With" list of programs in Xubuntu 13.04? How to associate a file with a program to open it with?

Read this answer: How to associate file types with Wine in Nautilus.

You must create/edit a .desktop file located in ~/.local/share/applications/ or /usr/share/applications/

Locate the Exec= parameter and at the end of the line add %U - it will be replaced with the filename to be opened.

Also see Associating file types in Ubuntu 13.10.


This is what I've just tried:

  1. Go to /usr/share/applications or ~/.local/share/applications/
  2. Create a new file appName.desktop (appName is the name of the app you want to use)
  3. Copy content of any other *.desktop file (I used gedit.desktop)
  4. Update the content: Name = , Exec = , ..., with %U being the filename to be opened.
  5. Save it.
  6. Right click on the file you want to be opened with the appName
  7. Go to Properties/Open With and click on 'Show Other applications' 8 Your appName should be there, just select it.

I found this way. And without any command line typing, which is good.

  1. In "File Manager" right click on a file (e.g. file.conf) you want to be opened by Sublime Text 2 (or any other application).

  2. Choose "Properties". A window titled file.conf - Properties should appear.

  3. In its tab "General" click "Open With:" and then choose "Other Application...". A window titled Open With should appear.

  4. At the bottom of this window select "Use a custom command:" option and then "Browse...".

  5. Browse to the necessary executable, Sublime Text 2, for example.

The most important part now: before click Ok put the selected path into double quotes, e.g.:

"/opt/Sublime Text 2/sublime_text"

because otherwise it cannot accept the path .