LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-23-2008, 04:11 AM   #1
john-boro
LQ Newbie
 
Registered: Jul 2007
Posts: 11

Rep: Reputation: 0
Make firefox aware of kde apps


Hi, quick question,


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?


Thanks a lot

john
 
Old 01-23-2008, 09:18 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
About MIME types and .desktop files

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.
 
Old 01-23-2008, 10:18 AM   #3
john-boro
LQ Newbie
 
Registered: Jul 2007
Posts: 11

Original Poster
Rep: Reputation: 0
thanks for the information. If I can decipher what it means then I'll give it a go

cheers
 
Old 01-23-2008, 12:40 PM   #4
randomsel
Member
 
Registered: Oct 2006
Location: Wilmington, DE
Distribution: Slackware 11
Posts: 201

Rep: Reputation: 30
Firefox's about:config points to two files: /etc/mime.types and ~/.mime.types, neither of which are present on a clean Slackware install...
 
Old 01-23-2008, 02:14 PM   #5
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
Quote:
Originally Posted by unSpawn View Post
* Somebody else may know of a more "correct", easier or even GUI way for handling this kind of thing.
Using the MIME Edit extension might be the easiest way to handle this.

Unfortunately, I don't think it will completely solve the problem.

Last edited by shadowsnipes; 01-23-2008 at 02:59 PM.
 
Old 01-23-2008, 04:26 PM   #6
john-boro
LQ Newbie
 
Registered: Jul 2007
Posts: 11

Original Poster
Rep: Reputation: 0
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??

john
 
Old 01-23-2008, 05:45 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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..."
 
Old 01-25-2008, 12:20 AM   #8
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
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?
 
Old 01-26-2008, 04:56 AM   #9
drauk
Member
 
Registered: Sep 2007
Location: /MX/BC/TJ
Distribution: Slackware 13
Posts: 37

Rep: Reputation: 15
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),
 
Old 01-26-2008, 06:33 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by shadowsnipes View Post
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).
 
Old 01-29-2008, 01:05 PM   #11
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
Quote:
Originally Posted by drauk View Post
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)

Code:
$HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
Here is an example of some lines you can add for getting files to associate with ark.

Code:
application/x-tar;ark %s
application/x-tgz;ark %s
application/x-bzip2;ark %s
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.
 
Old 01-29-2008, 01:12 PM   #12
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
Quote:
Originally Posted by unSpawn View Post
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

/home/USERNAME/.local/share/applications/mimeinfo.cache
/usr/local/share/applications/mimeinfo.cache
/usr/share/applications/mimeinfo.cache

I'm assuming you just put the .desktop file in /usr/share/applications.

What do you mean by MMMV(VM)? Is it supposed to be an acronym for something or are you just throwing out some Roman Numerals?

Even though I already got this working using the mailcap I'm still wondering if there are alternative methods that will work.
 
Old 03-14-2012, 08:25 PM   #13
Mountain
Member
 
Registered: Nov 2007
Location: A place with no mountains
Distribution: Kubuntu, sidux, openSUSE
Posts: 214

Rep: Reputation: 41
Quote:
Originally Posted by unSpawn View Post
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
 
Old 03-15-2012, 03:26 AM   #14
cendryon
Member
 
Registered: Aug 2005
Location: France
Distribution: Slackware64 current
Posts: 82

Rep: Reputation: 30
Hi

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.

Hope it helps

Cheers
 
1 members found this post helpful.
Old 03-15-2012, 06:43 AM   #15
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,884
Blog Entries: 28

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
OpenSuse and Kubuntu use a package called, you guessed it: firefox-kde-support

Which adds all the nifty mimetypes, makes Firefox use the kde/qt file picker, and other KDE apps.

firefox-kde-opensuse - Gitorious - https://gitorious.org/firefox-kde-opensuse/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any way to make Firefox and Evolution PAM aware? Ubuntu client in AD Domain MonctonJohn Linux - Software 0 09-28-2007 10:53 AM
how to make firefox aware of java on amd64 kpachopoulos Linux - General 3 11-19-2006 06:46 PM
How to make KDE aware of JAVA Jordan&&&& Linux - Newbie 5 09-20-2006 02:02 PM
Kde style's crash GTK apps *firefox* (suse 9.3) RoaCh Of DisCor Linux - Software 5 05-01-2005 06:05 PM
How to make OpenOffice 2.0 (beta) KDE theme-aware ltd602 Linux - Software 1 04-01-2005 09:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration