LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 11-11-2006, 05:07 PM   #1
gkiagia
Member
 
Registered: Oct 2003
Location: Greece
Distribution: Debian sid
Posts: 248

Rep: Reputation: 30
How to change mime associations in firefox


I have a simple problem. When I click on media links in firefox (for example .m3u files or .asx or .ram), firefox offers either to save to disk or to open with xmms or kaffeine.

The problem is that I want all of these links to open with amarok. Selecting open with other is a big waste of time because that stupid GTK open file dialog only allows you to browse through the filesystem to find the executable that you want. In addition, it doesn't remember the executable that you selected last time.

So, how can I change the default firefox file associations? I am using Debian testing with kde 3.5.5 and firefox 2.0.
 
Old 11-11-2006, 07:14 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
Somewhere in the users home directory, there is a hidden file with a .rdf extension that you can edit to change the mime type.

find ~/ -name '*.*' -type f | grep 'mimeType'

Edit the one for FireFox.
 
Old 11-12-2006, 03:41 PM   #3
gkiagia
Member
 
Registered: Oct 2003
Location: Greece
Distribution: Debian sid
Posts: 248

Original Poster
Rep: Reputation: 30
Thanks. I'll check it out.
 
Old 12-02-2006, 11:55 AM   #4
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
Quote:
Originally Posted by bigrigdriver

find ~/ -name '*.*' -type f | grep 'mimeType'

Edit the one for FireFox.
Thanks for this tip; it may provide what I need for the same problem.

In FireFox (I reverted to 1.5 because 2.0 did annoying things I imagine will be fixed later), the function "View and edit actions" under "Edit > Preferences > Download" does not allow just typing in the name of the application I want to open various files. Instead, my only choice seems to be to "browse" to the application--and that takes literally more than a minute for each line I want to change, as the program labors through the entire /usr/bin (or other) directory before displaying its contents.

Am I missing something? I could just type in the name of the application I want to use in a couple of seconds. When there are lots of lines to change, the method provided is simply out of the question.

I'll look into editing the .rdf file -- but there is a list of about six or seven of them, and I'm not sure which to choose; and as searching reveals this to be a very common problem, I'd think requiring manual editing of a (to most users) obscure file is not the way to enhance Firefox's popularity.

Thanks again for the tip.
 
Old 12-02-2006, 01:00 PM   #5
gkiagia
Member
 
Registered: Oct 2003
Location: Greece
Distribution: Debian sid
Posts: 248

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by jonr
Thanks for this tip; it may provide what I need for the same problem.

In FireFox (I reverted to 1.5 because 2.0 did annoying things I imagine will be fixed later), the function "View and edit actions" under "Edit > Preferences > Download" does not allow just typing in the name of the application I want to open various files. Instead, my only choice seems to be to "browse" to the application--and that takes literally more than a minute for each line I want to change, as the program labors through the entire /usr/bin (or other) directory before displaying its contents.

Am I missing something? I could just type in the name of the application I want to use in a couple of seconds. When there are lots of lines to change, the method provided is simply out of the question.

I'll look into editing the .rdf file -- but there is a list of about six or seven of them, and I'm not sure which to choose; and as searching reveals this to be a very common problem, I'd think requiring manual editing of a (to most users) obscure file is not the way to enhance Firefox's popularity.

Thanks again for the tip.
The inability to type in the application name is a stupid "feature" of the GTK libraries. Firefox unfortunately uses the GTK libraries and it inherits this behaviour.

GTK and GNOME developers, however, think that having a typing field on the open/save dialog "confuses" the users and they don't implement it because they want GNOME to be "easy to use" (?!)...
 
Old 12-02-2006, 01:15 PM   #6
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,734
Blog Entries: 12

Rep: Reputation: 457Reputation: 457Reputation: 457Reputation: 457Reputation: 457
You can change the way the file picker looks.

In about:config change : ui.allow_platform_file_picker to false

or add the following to use.js, this only works with 2.0
/* Get rid of the ugly file picker */
user_pref("ui.allow_platform_file_picker", false);

See my settings for more useful tweaks:
http://www.geocities.com/reverendsky....0settings.txt

If you are using plugins like totem-plugin, kaffeiene-plugin, mplayerplug-in, plugger or mozplugger you need to edit the config files for that particular plugin to point it toward the media player of your choice.
 
Old 12-02-2006, 01:33 PM   #7
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
gkiaga wrote:
Quote:
The inability to type in the application name is a stupid "feature" of the GTK libraries. Firefox unfortunately uses the GTK libraries and it inherits this behaviour.
Aha! I'm glad to know that; Firefox developers are not entirely to blame, then. It's just another example of the dumbing-down of things that actually makes them more difficult, not less. Sigh.

craigevil, thanks for your link. I'm going to look at your settings now.

Edited P.S.: The about:config change wasn't possible for me because there is no reference to "file_picker" in it... Maybe that's only on v. 2.0 also.

Last edited by jonr; 12-02-2006 at 01:38 PM.
 
Old 12-03-2006, 05:05 AM   #8
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,734
Blog Entries: 12

Rep: Reputation: 457Reputation: 457Reputation: 457Reputation: 457Reputation: 457
Getting rid of the ugly file picker, in Firefox 1.5 is a little more complicated, but still possible:

Konquefox - Extension and tricks for a better integration of Firefox into Linux and KDE
Quote:
Firefox 1.5 : It's a little bit more complex !

Look for a file named nsFilePicker.js in the "components" folder of your firefox installation (usually in /usr/lib/firefox/components/ or /usr/lib/mozilla-firefox/components/). Open it with your favorite text editor (you'll probably need administrator rights), then localize the following lines :

function (compMgr, fileSpec, location, type)
{
debug("registering (all right -- a JavaScript module!)");
compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);

compMgr.registerFactoryLocation(FILEPICKER_CID,
"FilePicker JS Component",
//@line 278 "/builds/tinderbox/Fx-Mozilla1.8.0....
"",
//@line 280 "/builds/tinderbox/Fx-Mozilla1.8.0....
fileSpec,
location,
type);
}

and replace the previous red line with this green one :

function (compMgr, fileSpec, location, type)
{
debug("registering (all right -- a JavaScript module!)");
compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);

compMgr.registerFactoryLocation(FILEPICKER_CID,
"FilePicker JS Component",
//@line 278 "/builds/tinderbox/Fx-Mozilla1.8.0....
FILEPICKER_CONTRACTID,
//@line 280 "/builds/tinderbox/Fx-Mozilla1.8.0....
fileSpec,
location,
type);
}

Important : to make this change take effect, you need to reset Firefox's chrome registry, which you can do by installing or disabling an extension, then restarting Firefox. Now, when you need to open or save a file, it should come up with the KDE/Qt style dialog, rather than the default GTK file dialogs.
 
Old 12-03-2006, 02:17 PM   #9
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
Get rid of GTK 's use-crippling dialog

Quote:
Originally Posted by craigevil
Getting rid of the ugly file picker, in Firefox 1.5 is a little more complicated, but still possible:
craigevil, thanks for your research and helpful suggestion. Isn't it a shame it's necessary to jump through these hoops just to use a decent user interface? (I'm retired and I still feel it's a waste of my time to have to put up with these things.)

As soon as I can, I'll test this implementation and post back with results. I expect it to work if I carefully follow the instructions. Being red/green colorblind, I had a little trouble with the lines involved, but I did find them and marked them on a printout -- in blue!

Should be back in a couple of days or less with what works/didn't work for me.

P. S. I spent two hours AGAIN just getting sound working in the browser. I'm perpetually losing sound in this application or that; sometimes ESD is the cause, and sometimes it's the answer. The great crippling problem in Open Source is the (understandable) lack of coordination among developers. Oh, well, it's still better than you-know-what.
 
Old 12-04-2006, 03:37 AM   #10
gkiagia
Member
 
Registered: Oct 2003
Location: Greece
Distribution: Debian sid
Posts: 248

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by craigevil
You can change the way the file picker looks.

In about:config change : ui.allow_platform_file_picker to false

or add the following to use.js, this only works with 2.0
/* Get rid of the ugly file picker */
user_pref("ui.allow_platform_file_picker", false);
Wow! This trick is awesome. I finally got rid of the stupid GTK open/save dialog.

Thanks craigevil.
 
Old 12-04-2006, 11:04 AM   #11
jonr
Senior Member
 
Registered: Jan 2003
Location: Kansas City, Missouri, USA
Distribution: Ubuntu
Posts: 1,040

Rep: Reputation: 47
Quote:
Originally Posted by gkiagia
Wow! This trick is awesome. I finally got rid of the stupid GTK open/save dialog.

Thanks craigevil.
Now I'm really eager to do this. Maybe today or tomorrow.

I wonder if Mozilla could be persuaded to go back to the sensible way. (By somebody tough-skinned enough to suggest it to them.)
 
Old 12-07-2006, 08:33 AM   #12
noranthon
Member
 
Registered: Apr 2006
Location: Australia
Distribution: PCLinuxOS with Xfce
Posts: 301

Rep: Reputation: 30
I have just posted this link to another thread asking the same question.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
file associations change +music jolphil Linux - Software 1 02-19-2006 04:59 AM
change MIME associativity in firefox a1tair Linux - Software 7 11-11-2005 07:51 AM
How can i change file associations under fedora core 2? Braveheart1980 Linux - Software 13 08-01-2004 01:12 PM
change mime type dARkHunTEr Linux - Software 0 08-03-2003 01:30 PM
how do I change mime type? brian_eye Linux - Newbie 2 06-10-2002 10:14 AM


All times are GMT -5. The time now is 06:46 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration