View previous topic :: View next topic |
Author |
Message |
lordello n00b
Joined: 13 Aug 2004 Posts: 43 Location: Rio de Janeiro - Brasil
|
Posted: Fri Feb 24, 2006 3:49 am Post subject: HOWTO Create a mime-type |
|
|
File-roller is not assiciated with 7zip files, and I don't know how to create a mime-type!
So I start to search a HOWTO, and found this: Standards/AddingMIMETutor
So I created e 7zip.xml file into /usr/share/mime/packages, but I don't know if this is the best way to do this.
/usr/share/mime/packages/7zip.xml
Code: | <?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-7z-compressed">
<comment>7zip archive</comment>
<comment xml:lang="en">7zip archive</comment>
<comment xml:lang="pt">Ficheiro 7zip</comment>
<comment xml:lang="pt_BR">Arquivo 7zip</comment>
<glob pattern="*.7z"/>
</mime-type>
</mime-info> |
After the file is created, i just run this command as root:
Code: | # update-mime-database /usr/share/mime |
This code can be added to the local user file (not all users will have the file associated):
Code: | .local/share/mime/packages/Override.xml |
Any addiction to this format (translations), please post a comment.
Or comment HOWTO do this correctly
Thanks |
|
Back to top |
|
|
Zepp Veteran
Joined: 15 Mar 2004 Posts: 1246 Location: Ontario, Canada
|
Posted: Fri Feb 24, 2006 5:49 pm Post subject: |
|
|
Is this a support question or posting of a how-to, if the latter it is in the wrong section... |
|
Back to top |
|
|
lordello n00b
Joined: 13 Aug 2004 Posts: 43 Location: Rio de Janeiro - Brasil
|
Posted: Sat Feb 25, 2006 2:59 am Post subject: |
|
|
Can be considered both... A question because I don't know howto create a mime-type correctly, and a howto because I found how to do this (and I didn't found this information here in the forum). |
|
Back to top |
|
|
nixnut Bodhisattva
Joined: 09 Apr 2004 Posts: 10974 Location: the dutch mountains
|
Posted: Sat Feb 25, 2006 8:45 am Post subject: |
|
|
Moved from Desktop Environments to Documentation, Tips & Tricks. _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
talk is cheap. supply exceeds demand |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Tue Feb 28, 2006 6:41 am Post subject: |
|
|
It certainly looks like the proper way of doing it. I know many people often complained that it is not very user friendly. KDE has a really simple way of adding file types but like any GUI system, is prone to bugs and problems. I found it rather touchy. I really dont mind doing things like this in GNOME. Its solid and it works. Either way, thanks for the TIP. Nice to finally put this piece of the puzzle to rest. Also nice to have everything recognized and have their own icons _________________ You're not afraid of the dark are you? |
|
Back to top |
|
|
lordello n00b
Joined: 13 Aug 2004 Posts: 43 Location: Rio de Janeiro - Brasil
|
Posted: Wed Mar 01, 2006 1:23 pm Post subject: |
|
|
Lokheed,
Whith Gnome I can simple right click in the file and choose "Open with other application", and then choose a program to assiciate with the file-type, using graphical interface
What I want with this howto is create a global mime-type, not a file-type association, so, the file-roller.desktop is associated with 7zip files, but the system don't know what is a 7zip Archives, then I'm just telling to the system that .7z are 7zip Archives
After creating this xml, any associated program will be automatically able to open the file with a simple duble click.
Imagine, I have 3 programs that opens 7zip Archives (File-roller, XArchive and MC) and it has the "MimeTypes" section into the "program.desktop" file, than I will need to associate each program manually. If I create a simple xml file, all three programs will be associated automatically for all user accounts! What is the best way to do this?
I don't defend the "command line way", but cometimes it saves time.
Thanks |
|
Back to top |
|
|
Lokheed Veteran
Joined: 12 Jul 2004 Posts: 1295 Location: /usr/src/linux
|
Posted: Sat Mar 04, 2006 2:08 am Post subject: |
|
|
lordello wrote: | Lokheed,
Whith Gnome I can simple right click in the file and choose "Open with other application", and then choose a program to assiciate with the file-type, using graphical interface |
Yes I know, but that populates /.local/share/applications with a ton of .desktop files; one for every filetype you assigned a program too. It doesnt even reuse the existing .desktop files. Its a sloppy way to do it. I prefer your way much better, GNOME or no GNOME. It is clean and proper... _________________ You're not afraid of the dark are you? |
|
Back to top |
|
|
|