Caja and MIME types

63 views
Skip to first unread message

Glenn Holmer

unread,
Sep 12, 2015, 10:15:38 AM9/12/15
to MLUG
This question is about Debian Jessie running the MATE desktop environment. How do I add a new MIME type and set Caja (MATE file manager) to open it with a custom app? The use case is that I want to open Commodore 64 disk image files (.D64, .D81...) with a Java program I wrote.

--
Glenn Holmer (Linux registered user #16682)
"After the vintage season came the aftermath -- and Cenbe."

Glenn Holmer

unread,
Sep 12, 2015, 11:30:40 AM9/12/15
to Milwaukee Linux User's Group, milwau...@googlegroups.com
On Saturday, September 12, 2015 at 9:15:38 AM UTC-5, Glenn Holmer wrote:
This question is about Debian Jessie running the MATE desktop environment. How do I add a new MIME type and set Caja (MATE file manager) to open it with a custom app? The use case is that I want to open Commodore 64 disk image files (.D64, .D81...) with a Java program I wrote.

Found the answer in the freenode #mate channel.
(see https://developer.gnome.org/integration-guide/stable/mime.html.en)
To create a new mime type, create a file in /usr/share/mime/packages/:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
  <mime-type type="application/x-d64">
    <comment>Commodore 64 disk image</comment>
    <glob pattern="*.d64"/>
    <glob pattern="*.D64"/>
    <glob pattern="*.d81"/>
    <glob pattern="*.D81"/>
    <glob pattern="*.d41"/>
  </mime-type>
</mime-info>

Save as e.g. d64.xml, then run this command:
update-mime-database /usr/share/mime
After that, coaxing Caja to use it is child's play. Win!

Roger M. Jenson

unread,
Sep 12, 2015, 12:23:18 PM9/12/15
to Milwau...@googlegroups.com
Thanks for sharing the solution.

Having Fun,
Roger M. Jenson
> --
> You received this message because you are subscribed to the Google
> Groups "Milwaukee Linux User's Group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to MilwaukeeLUG...@googlegroups.com
> <mailto:MilwaukeeLUG...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Best Regards,
Roger M. Jenson
r...@eyedigix.com
414-429-6364
Reply all
Reply to author
Forward
0 new messages