So you installed Gnome Shell and you want to open a specific type of file with your favorite application but when you select 'Open With' from the Nautilus menu, your application is not on the list? The good old Gnome 2.X had an option to open with a 'custom command', missing it already? I agree, its a design flaw.
So... here's how you do it.
1. Add your Application
First, you have to add your application so that Gnome Shell can find it. This can be done by creating a .desktop file. Run this command where myapp is the name you want to give your app.
Code:
sudo gedit /usr/share/applications/myapp.desktop
Now create the file with the following format:
Code:
Exec=/path/to/your/app %U
Version=1.0
Name=My First App
GenericName=MyApp
X-GNOME-FullName=My First Application
Comment=This app will do this and this
Icon=myapp-icon
StartupNotify=true
Terminal=false
Type=Application
The Icon value sets an icon to your application found in /usr/share/app-install/icons/
If you don't like any of the exiting icons, you can add your own! It's just a small .png image.
2. Find out what file type you want to associate
Right click your file, select Properties and look under Type, it should be something like application/x-type. Here's a screenshot!
3. Associate the file type with your application
Run the following command
Code:
sudo gedit /usr/share/applications/defaults.list
Now add your file type (preferably in an alphabetically correct place) and link it to your application.
Example:
Code:
application/x-type=myapp.desktop
4. Logout and Login again
I think this is necessary (its not enough to just restart the Gnome-shell).
5. Done!
Enjoy just having to double-click your files to open with your favorite application.
Bookmarks