Wednesday, October 26, 2005

File associations in Fedora

Needed to open MP3 files with XMMS by just double-clicking them in Nautilus, so I looked up on how to change file associations. The Fedora Forum rocks! I learnt its quite a task! Here's how (with mplayer as example):

-> /usr/share/applications/[application_name].desktop
This is the file where "defaults.list" will point to. One of the most important things inside this file is the entry "MimeType=".

E.g: vi /usr/share/applications/mplayer.desktop
[Desktop Entry]
Name=Movie Player
Comment=Play multimedia files and media
Icon=mplayer.xpm
Exec=mplayer %f
Terminal=false
MimeType=video/mpeg;video/x-msvideo;video/quicktime;video/x-ms-asf;video/x-ms-wmv
Type=Application
Categories=Application;AudioVideo;
Encoding=UTF-8


-> /usr/share/applications/defaults.list
This file contains the applications which cause a double-click success. All Mime types will point to a desktop file.

E.g: Separate multiple app names with ;'s.

video/x-ms-asf=mplayer.desktop
video/x-ms-wmv=mplayer.desktop


-> /usr/share/applications/mimeinfo.cache
Contains information in similar form shown for file "defaults.list" in same directory. This file contains ALL associations given to a mime type. There is no need for a specified order of desktop files. E.g: Repeat above

To do the same for XMMS, replace realplayer.desktop with redhat-audio-player.desktop in all these files..

2 Comments:

At 12:10 pm, Anonymous Anonymous said...

Thank you. This is very helpful.

 
At 12:11 pm, Anonymous Anonymous said...

Thank you. This is very helpful.

 

Post a Comment

<< Home