SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Trying out opensuse the other day, I noticed that when downloading (for example) a tar.bz2 in firefox, one option would be to 'open with ark'. This does not happen for me in slackware. I can configure firefox to automatically open archives with ark, but it seems that if I set it to ask me what to do each time, it is not aware of ark as an application. How can I solve this?
For any entity your browser can not render internally it will look for an accompanying MIME type. FF recognises MIME types searching through two databases" (type "about:config" and search for "mime"). Customised handling can then be configured in ~/.mozilla/firefox/$PROFILENAME/mimeTypes.rdf. Recognising applications linked to MIME types is done by your Desktop Environment which should honour the Desktop Entry Specification. It dictates each shared MIME type (also see: XDG) is mapped to a .desktop file in the mimeinfo.cache (and defaults.list) and each relevant application has a .desktop file with a "MimeType" entry in it. So if for instance you're looking for "tar" ("application/x-tar") you could check if 'grep -i 'tar=' mimeinfo.cache' and 'grep -i 'tar=' defaults.list' both point to the same .desktop file and if that file exists if it emits the right MIME types 'grep -i mime'.
* Somebody else may know of a more "correct", easier or even GUI way for handling this kind of thing.
yeah, that extension doesn't really help as far as I can tell. You don't get the option "Open this file with Ark" [pretty icon], just "open this file with:" and nothing. Although if I click okay, it does open in ark. weird stuff. Perhaps I can just copy an /etc/mime.types from opensuse??
Uh. All I'm saying is that maybe how the DE presents a default application for this MIME-type is inconsistent. AFAIK copying mailcap, mime.types or magic.* has *nothing* to do with it since the MIME-type *is* known and a default application *was* offered.
Maybe just read my reply starting at "So if for instance if..."
It seems to me that the problem is that even though KDE programs know the default apps associated with MIME types, Gtk2 apps like Firefox don't. As figured, Firefox in Xfce doesn't fair any better in these terms.
On Kubuntu, however, Firefox gives a drop down list of apps you can open downloads with in addition to browsing for others. I still don't know how to do this in Slackware (playing with the /usr/share/applications/{defaults.list,mimeinfo.cache} files didn't do anything for me), but at least the MIME Edit extension makes things a little easier.
Also, here's another helpful tweak for firefox that makes browsing for the app easier.
Enter "about:config" in the address bar, look for the "ui.allow_platform_file_picker" key and change its value to "false".
Now you have a more kde friendly file browser in firefox.
Have you actually gotten this working for any apps unSpawn?
Hey i was trying to do this too.
After read the posts and check in "about:config", i copy /etc/mailcap from other distro and if work now i have a list of programs to open with (i tried mime.types before mailcap and didn't work to me),
On Kubuntu, however, Firefox gives a drop down list of apps you can open downloads with in addition to browsing for others. (..) Have you actually gotten this working for any apps unSpawn?
I just tested getting any dummy app to work by adding a .desktop file and mimeinfo.cache references. It then showed the dummy as default app to open with, no other choice and adding it to the defaults.list made no difference. So basically the mechanism kinda works except I didn't get any choice with FF2/XFCE like you said you had in Kubuntu and I'm running neither that or Slackware so prolly MMMV(VM).
Hey i was trying to do this too.
After read the posts and check in "about:config", i copy /etc/mailcap from other distro and if work now i have a list of programs to open with (i tried mime.types before mailcap and didn't work to me),
Ahh, thanks for the tip. I think I have found one solution for getting this all to work in Firefox in Slackware. You can copy /etc/mailcap from a distro that has this working, yes, but you can also just write the entries you need.
Instead of modifying my /etc/mailcap I chose to modify ~/.mailcap. The default path for mailcap is (as found under the man page)
Now start up firefox and try opening a tar, tar.gz, or bz2 file. It doesn't work ...yet.
You have to modify mimeTypes.rdf under your firefox profile first. I found the easiest way to do this is to use the MIME Edit firefox extension. Simply add one entry for each corresponding entry of interest in the mailcap (you don't have to do them all).
Now once this is done you should see the default option (ark in this case) come up whenever you try to download or open one of these three archive file types. In addition, if you use the MIME edit extension to specify an alternate program to use for these files, it will now be included as an option. Be sure to check the 'always ask what to do' unless you want the files to be handled automatically. The option selected by default will be the last one selected under the MIME edit extension.
Once you are all setup with this you can simply copy the mimeTypes.rdf file to another profile if you desire.
Last edited by shadowsnipes; 01-29-2008 at 01:06 PM.
I just tested getting any dummy app to work by adding a .desktop file and mimeinfo.cache references. It then showed the dummy as default app to open with, no other choice and adding it to the defaults.list made no difference. So basically the mechanism kinda works except I didn't get any choice with FF2/XFCE like you said you had in Kubuntu and I'm running neither that or Slackware so prolly MMMV(VM).
But it worked for Firefox in KDE? Or are you using GNOME? What distro do you have this working in?
Which mimeinfo.cache file did you edit? I have three different ones located at
For any entity your browser can not render internally it will look for an accompanying MIME type. FF recognises MIME types searching through two databases" (type "about:config" and search for "mime"). Customised handling can then be configured in ~/.mozilla/firefox/$PROFILENAME/mimeTypes.rdf. Recognising applications linked to MIME types is done by your Desktop Environment which should honour the Desktop Entry Specification. It dictates each shared MIME type (also see: XDG) is mapped to a .desktop file in the mimeinfo.cache (and defaults.list) and each relevant application has a .desktop file with a "MimeType" entry in it. So if for instance you're looking for "tar" ("application/x-tar") you could check if 'grep -i 'tar=' mimeinfo.cache' and 'grep -i 'tar=' defaults.list' both point to the same .desktop file and if that file exists if it emits the right MIME types 'grep -i mime'.
* Somebody else may know of a more "correct", easier or even GUI way for handling this kind of thing.
I've been researching this issue for a few days. Believe it or not, this old thread is the best reference I have found on the topic. The answer above was really helpful to me. However, it is a gnome-specific answer and the question is about KDE. It would be awesome if someone can add a bit more info from a KDE perspective. The solutions mentioned in this thread didn't solve my problems in Kubuntu 12.04, but the info helped me understand my problem better. I'm still trying to solve it.
In regard to KDE-specific info, for example, /usr/share/applications/defaults.list is apparently not used on KDE (or at least this is the case on Kubuntu, Netrunner, and similar distros). Also /usr/share/applications/mimeinfo.cache is not used.
Here are my notes about the KDE files related to mime-types:
/etc/mime.types <-- present on Netrunner 4.1, Kubuntu 11.10 and 12.04, etc.
/usr/share/applications/mimeinfo.cache <-- NOT present on Netrunner, Kubuntu, etc.
/usr/share/applications/defaults.list <-- NOT present on Netrunner, Kubuntu, etc.
/etc/mailcap <-- present on Netrunner, Kubuntu, etc.
~/.local/share/applications/mimeapps.list <-- present on Netrunner but NOT on Kubuntu.
~/.mozilla/firefox/<profile>/mimeTypes.rdf <-- present on Netrunner & Kubuntu but the contents appear to differ.
Here are the Firefox settings. These KDE settings appear to be different from gnome Firefox settings.
Firefox about:config: helpers.global_mime_types_file /etc/mime.types
Firefox about:config: helpershelpers.private_mime_types_file ~/.mime.types
After tracking down all those files, I'm still missing something. I can't get it to work. What else controls Firefox's recognition of mimetypes in KDE?
Firefox works perfectly in Netrunner 4.1 (which is a customization of Kubuntu 11.10). However, Firefox has the problem described in this thread in Kubuntu 12.04b1 (and, I'm told, also in 11.10 proper). I want to fix this in Kubuntu without switching to Netrunner or OpenSuse.
Another very closely related problem I want to solve is getting Firefox to "Open Containing Folder" of downloaded items.
Since this thread already has good info and a high Google ranking, I would prefer to continue the discussion in this thread. But I also posted a question at Ask Ubuntu: http://askubuntu.com/questions/11219...wnloaded-files
I overcome this with xdg-open.
In KDE, I tune the apps I want to open each MIME type in Settings -> File association.
In Firefox, I browsed to /usr/bin/xdg-open the first time FF asked me what to do with a file it doesn't handle.
Now, whichever file Firefox does not handle it opens it with my chosen apps thanks to xdg-open.
I have it working since Slackware-13.0 / KDE 4.2 / FF 3.6 up to Slackware64-current / KDE 4.8 / FF 10.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.