Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to add program to Open With in Ubuntu

📅 2014-May-20 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

You get a list of applications when you try the Open With option to open a certain type of file. If you try to associate a new application to open a certain type of file, you are shown a list of applications. The list of applications shown is the list of .desktop files in the /usr/share/applications directory.

Programs written by you or shared by a friend or compiled from source may not install their .desktop file in the /usr/share/applications directory. It takes a bit of work to get such a program added to the Open With list in Ubuntu. This post shows the details of how to achieve this. I use a method that is a bit easier.

Exec=foobar

Append a %F parameter to it:

Exec=foobar %F

This enables the .desktop file to be used to open a file using this program.

$ sudo cp alacarte-made.desktop /usr/share/applications

Your program should now appear in the list of Open With applications.

Tried with: Ubuntu 14.04