How to place multiple icons according to "mime-type" in the same extension

Asked

Viewed 26 times

0

The idea is very simple:

I have a text file: texto.prisma

$ file -i text.prism

text.prism: text/Plain; charset=utf-8

I have another compiled file: compilado.prisma

$ file -i compiled.prism

compiled.prism: application/octet-stream; charset=Binary

I want an icon for each file type of the same extension. inserir a descrição da imagem aqui

1 answer

0

Let’s get to the facts:

I won’t be explaining about mime-types here.

Whoever wants to do this follow this recipe:

The distro in question is linux Ubuntu 16.04 64bits

  1. Create an icon file called application-prisma.svg 256x256px and put on /usr/share/icons/gnome/scalable/mimetypes then the complete path will be: /usr/share/icons/gnome/scalable/mimetypes/application-prisma.svg
  2. Create another application icon-x-prisma.svg and place in the same place so the path will stay: /usr/share/icons/gnome/scalable/mimetypes/application-x-prisma.svg
  3. create a file called prisma.xml and put in /usr/share/mime/packages then the whole way will stay: /usr/share/mime/packages/prisma.xml

  4. paste the following code into the prism.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
    <mime-type type="application/x-prisma">
        <sub-class-of type="application/octet-stream"/>
        <comment>Prisma compilado</comment>
        <glob pattern="*.prisma"/>
        <glob pattern="*.pris"/>
    </mime-type>
    <mime-type type="application/prisma">
        <sub-class-of type="text/plain"/>
        <comment>Prisma texto</comment>
        <glob pattern="*.prisma"/>
        <glob pattern="*.pris"/>
    </mime-type>
</mime-info>
  1. execute the following commands:

$ sudo update-mime-database /usr/share/mime && sudo gtk-update-icon-cache

  1. AND VUALÁ

inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.