Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to associate a custom application to a file type in Gnome 3 (FC15). In Gnome 2 one could go in the "Open with" pane of the file properties dialog and add a custom command there. The custom command edit box seems to have disappeared from the "Open with" pane in Gnome 3, so I was wondering if there is some workaround to manually assign the application.

In other words, from which file/directory does Gnome pull out that application list? How do I add a custom one?

share|improve this question

3 Answers

up vote 2 down vote accepted

There is the answer: http://forums.fedoraforum.org/showthread.php?t=263501

I have Gnome3 and there is "Open with" pane :) You also go to proporties and there is "Open with" tab.

Edit: You should look on https://bbs.archlinux.org/viewtopic.php?id=118966. Your applications should show on list, if you add a *.desktop file associated with your application to /usr/share/applications or ~.local/share/applications/ directory. Exec should like this: Exec=yourprogram %U

share|improve this answer
Thanks for your answer but that is not what I am asking. I know that there is an "Open with" pane, what is missing is the "custom command" edit box. I will rephrase my question accordingly – nico Aug 2 '11 at 12:57
Seems to work fine, I'll still have to figure out a couple of things but it does the job. Thank you – nico Aug 8 '11 at 5:59
1  
Please don't answer with just a link. At the least, summarize the solution in the body of your answer. You can link for further reading, but that is not a substitute for providing an inline answer. Thanks. – Caleb Apr 29 '12 at 5:11

I know this is late but...Fist, create a desktop file in ~/.local/share/applications/ for example sublime.desktop would be something like ~/.local/share/applications/sublime.desktop with the following content:

[Desktop Entry]
Keywords=Plaintext;Write;Programming;Syntax;Ruby;HTML
Categories=;
Comment=sublime
Exec=sublime_text %U
Hidden=false
Icon=icon-name
Name=sublime
Terminal=false
Type=Application
Version=1.0
StartupNotify=true
MimeType=text/plain;text/html;application/ruby;

Then... if you edit ~/.local/share/applications/mimeapps.list you will see the content type text/html edit it like so:

[Default Applications]
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
x-scheme-handler/ftp=firefox.desktop
x-scheme-handler/chrome=firefox.desktop
text/html=sublime.desktop
application/x-extension-htm=sublime.desktop
application/x-extension-html=sublime.desktop
application/x-extension-shtml=firefox.desktop
application/xhtml+xml=firefox.desktop
application/x-extension-xhtml=firefox.desktop
application/x-extension-xht=firefox.desktop

[Added Associations]
x-scheme-handler/http=firefox.desktop;
x-scheme-handler/https=firefox.desktop;
x-scheme-handler/ftp=firefox.desktop;
x-scheme-handler/chrome=firefox.desktop;
application/x-extension-htm=firefox.desktop;
application/x-extension-html=firefox.desktop;
application/x-extension-shtml=firefox.desktop;
application/xhtml+xml=firefox.desktop;
application/x-extension-xhtml=firefox.desktop;
application/x-extension-xht=firefox.desktop;
application/x-yaml=sublime-1.desktop;

[Removed Associations]
text/html=firefox.desktop;gedit.desktop;

You can of-course change as many or as little as you want and you can also add as many or as little as you want to the desktop files MimeType for example application/python, application/x-ruby, text/ruby, text/x-python or dozens of other variants... though sticking to simple types should be alright for example application/python and application/ruby both work on my GNOME 3.2 install.

share|improve this answer

gnome-panel still has the old gnome2 command to do this.

Enter:

gnome-desktop-item-edit ~/.local/share/applications/ --create-new
share|improve this answer
Thanks Steve, surely that is another way, albeit less viable. By the way you can also pull out that panel from alacarte – nico Apr 29 '12 at 8:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.