How to add program to Open With in Ubuntu

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.

  • First we need to create a .desktop file for your program. I find that the easiest way to do this is using the alacarte application. Installing and using alacarte is easy. Create a New Item using the name of your program. This creates a file of the name ~/.local/share/applications/alacarte-made.desktop.

  • Copy the above file somewhere and find the Exec section in the file. For example, this section might be:


Append a %F parameter to it:

Exec=foobar %F

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

  • Finally copy this file to /usr/share/applications:
$ 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

2 thoughts on “How to add program to Open With in Ubuntu

  1. Ubuntu 14.04
    DVDstyler would not appear in list of applications for me. I couldn’t associate .dvds files to DVDstyler.

    This had been bugging me for ages and couldn’t solve it until I found this thread.

    I found the dvdstyler.desktop file in /usr/share/applications/
    editited it in a terminal with “sudo gedit /usr/share/applications/dvdstyler.desktop”
    I added a %F to the Exec= to read “Exec=dvdstyler %F” and saved it.

    I also removed all the foreign language entries for GenericName=… and Comment=…. entries at the same time.
    rebooted and BINGO I can now associate dvds files with dvdstyler.

    ************ ABSOLUTELY FANTASTIC **********


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.