Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO Create a mime-type
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
lordello
n00b
n00b


Joined: 13 Aug 2004
Posts: 43
Location: Rio de Janeiro - Brasil

PostPosted: Fri Feb 24, 2006 3:49 am    Post subject: HOWTO Create a mime-type Reply with quote

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 :D
Thanks
Back to top
View user's profile Send private message
Zepp
Veteran
Veteran


Joined: 15 Mar 2004
Posts: 1246
Location: Ontario, Canada

PostPosted: Fri Feb 24, 2006 5:49 pm    Post subject: Reply with quote

Is this a support question or posting of a how-to, if the latter it is in the wrong section...
Back to top
View user's profile Send private message
lordello
n00b
n00b


Joined: 13 Aug 2004
Posts: 43
Location: Rio de Janeiro - Brasil

PostPosted: Sat Feb 25, 2006 2:59 am    Post subject: Reply with quote

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
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Sat Feb 25, 2006 8:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Lokheed
Veteran
Veteran


Joined: 12 Jul 2004
Posts: 1295
Location: /usr/src/linux

PostPosted: Tue Feb 28, 2006 6:41 am    Post subject: Reply with quote

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 :D
_________________
You're not afraid of the dark are you?
Back to top
View user's profile Send private message
lordello
n00b
n00b


Joined: 13 Aug 2004
Posts: 43
Location: Rio de Janeiro - Brasil

PostPosted: Wed Mar 01, 2006 1:23 pm    Post subject: Reply with quote

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 :wink:
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 :D
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 :D
Back to top
View user's profile Send private message
Lokheed
Veteran
Veteran


Joined: 12 Jul 2004
Posts: 1295
Location: /usr/src/linux

PostPosted: Sat Mar 04, 2006 2:08 am    Post subject: Reply with quote

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 :wink:


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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum