LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-06-2007, 06:39 PM   #1
mathfeel
Member
 
Registered: Feb 2002
Distribution: Gentoo
Posts: 95

Rep: Reputation: 15
mime types association


I tried to google this a bit, but all I came up with is how to write a mime types xml file, not what I want.

How do I (gnome and/or kde) set the which programs to associate with a mime type SYSTEM WIDE?

e.g. When I right click on a *.m3u (audio/mpegurl) file in gnome it has "Open with RealPlayer" as default and then another list which includes totem, gvim etc...

How do I tell gnome to use totem as default player? SYSTEM WIDE?

THanks
 
Old 05-08-2007, 04:56 AM   #2
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
I doubt if it's possible (easily at least) to do it system-wide; mime types aren't that important for Linux as they are for Windows for example (Linux doesn't usually care about file suffixes, and you can use tools such as file to determine a file's type instead) and I believe the usage of mimetypes is based on your desktop environment (KDE, Gnome, ...) and because they don't all work the same way, you usually have to do the configuration per desktop environment. Well, usually people only use one desktop environment so that's easy.

EDIT: on Windows if you have a .m3u file, Windows tells you it's audio/mpegurl (or whatever) usually even if you rename a .jpg file to be .m3u. On Linux, on the other hand, you can rename all your image files .m3u (or those m3u files .jpg) and they should still work; desktop environments that use mime types (acknowledge .xxx from the filename) may get fooled but on a wider scale it doesn't matter. You can have filenames like somefile.jpg.mp3.aac.cad and it's all the same for Linux -- if you issue
Code:
file somefile.jpg.mp3.aac.cad
then you'll probably get to know what the file really is, as long as 'file' knows about such filetypes.

Last edited by b0uncer; 05-08-2007 at 04:59 AM.
 
Old 05-12-2007, 05:27 AM   #3
mathfeel
Member
 
Registered: Feb 2002
Distribution: Gentoo
Posts: 95

Original Poster
Rep: Reputation: 15
This is interesting. Here I am trying to figure this out by reading the various files in /usr/share/mime and /etc/mimetype

I think you are right, the xml files in /usr/share/mime just defines an mimetypes without specifying how to identify it from the filename (e.g. using some regexp match). And in /etc/mimtetypes, there are lines such as
Code:
application/vnd.oasis.opendocument.text   odt
That seems to do such thing. I am not so clear on what responsibilities are delegated to each configuration files

On the other hand, suppose I now give up on system-wide configuration. If I ask GNOME or KDE to use say xpdf to open an application/pdf file, where is this configuration information stored? In some plain text (xml??) file or in binary form. It is sometimes interesting and necessary to be able to mess with such file by hand...

EDIT: I finally found the answer to my original question. Check the file
/usr/share/applications/mimeinfo.cache

Last edited by mathfeel; 05-12-2007 at 05:38 AM.
 
  


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
Apache Mime Types jroggow Linux - Networking 1 07-26-2006 02:40 PM
cups, mime.types and mr.wobble Linux - Networking 2 05-29-2006 11:44 PM
mime types Nightfrost Linux - General 2 10-01-2004 06:11 AM
Gnome 1.4 and mime types kly546 Debian 0 07-25-2003 03:04 AM
MIME Types? JoeLinux Linux - Software 6 09-14-2002 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:40 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
Open Source Consulting | Domain Registration