Skip to main content
Without this last step, you will see no effect on the desktop
Source Link

After all, run

update-mime-database ~/.local/share/mime/

to activate the configuartion.

After all, run

update-mime-database ~/.local/share/mime/

to activate the configuartion.

deleted 281 characters in body
Source Link
Munzir Taha
  • 1.6k
  • 6
  • 12

system mode would install to /usr/share/mime/ whereas. user mode to .local/share/mime. E.g. and the file list is:

./.local/share/mime                                                                                                                                                       
./.local/share/mime/generic-icons
./.local/share/mime/mime.cache
./.local/share/mime/types
./.local/share/mime/text
./.local/share/mime/text/x-shiny.xml
./.local/share/mime/version
./.local/share/mime/treemagic
./.local/share/mime/globs
./.local/share/mime/globs2
./.local/share/mime/aliases
./.local/share/mime/subclasses
./.local/share/mime/magic
./.local/share/mime/icons
./.local/share/mime/XMLnamespaces
./.local/share/mime/packages/shinythings-shiny.xml

system mode would install to /usr/share/mime/ whereas user mode to .local/share/mime. E.g.

./.local/share/mime                                                                                                                                                       
./.local/share/mime/generic-icons
./.local/share/mime/mime.cache
./.local/share/mime/types
./.local/share/mime/text
./.local/share/mime/text/x-shiny.xml
./.local/share/mime/version
./.local/share/mime/treemagic
./.local/share/mime/globs
./.local/share/mime/globs2
./.local/share/mime/aliases
./.local/share/mime/subclasses
./.local/share/mime/magic
./.local/share/mime/icons
./.local/share/mime/XMLnamespaces
./.local/share/mime/packages/shinythings-shiny.xml

system mode would install to /usr/share/mime/. user mode to .local/share/mime and the file list is:

./.local/share/mime/generic-icons
./.local/share/mime/mime.cache
./.local/share/mime/types
./.local/share/mime/text
./.local/share/mime/text/x-shiny.xml
./.local/share/mime/version
./.local/share/mime/treemagic
./.local/share/mime/globs
./.local/share/mime/globs2
./.local/share/mime/aliases
./.local/share/mime/subclasses
./.local/share/mime/magic
./.local/share/mime/icons
./.local/share/mime/XMLnamespaces
./.local/share/mime/packages/shinythings-shiny.xml
deleted 281 characters in body
Source Link
Munzir Taha
  • 1.6k
  • 6
  • 12
EXAMPLES
           xdg-mime query filetype /tmp/foobar.png

       Prints the MIME type of the file /tmp/foobar.png, in this case image/png

           xdg-mime query default image/png

       Prints the .desktop filename of the application which is registered to open PNG files.

           xdg-mime install shinythings-shiny.xml

       Adds a file type description for "shiny"-files. "shinythings-" is used as the vendor prefix. The file type description could look as follows.

           shinythings-shiny.xml:

           <?xml version="1.0"?>
           <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
             <mime-type type="text/x-shiny">
               <comment>Shiny new file type</comment>
               <glob pattern="*.shiny"/>
               <glob pattern="*.shi"/>
             </mime-type>
           </mime-info>

       An icon for this new file type must also be installed, for example with:

           xdg-icon-resource install --context mimetypes --size 64 shiny-file-icon.png text-x-shiny
EXAMPLES
           xdg-mime query filetype /tmp/foobar.png

       Prints the MIME type of the file /tmp/foobar.png, in this case image/png

           xdg-mime query default image/png

       Prints the .desktop filename of the application which is registered to open PNG files.

           xdg-mime install shinythings-shiny.xml

       Adds a file type description for "shiny"-files. "shinythings-" is used as the vendor prefix. The file type description could look as follows.

           shinythings-shiny.xml:

           <?xml version="1.0"?>
           <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
             <mime-type type="text/x-shiny">
               <comment>Shiny new file type</comment>
               <glob pattern="*.shiny"/>
               <glob pattern="*.shi"/>
             </mime-type>
           </mime-info>

       An icon for this new file type must also be installed, for example with:

           xdg-icon-resource install --context mimetypes --size 64 shiny-file-icon.png text-x-shiny
EXAMPLES
           xdg-mime install shinythings-shiny.xml

       Adds a file type description for "shiny"-files. "shinythings-" is used as the vendor prefix. The file type description could look as follows.

           shinythings-shiny.xml:

           <?xml version="1.0"?>
           <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
             <mime-type type="text/x-shiny">
               <comment>Shiny new file type</comment>
               <glob pattern="*.shiny"/>
               <glob pattern="*.shi"/>
             </mime-type>
           </mime-info>

       An icon for this new file type must also be installed, for example with:

           xdg-icon-resource install --context mimetypes --size 64 shiny-file-icon.png text-x-shiny
added 1123 characters in body
Source Link
Munzir Taha
  • 1.6k
  • 6
  • 12
Loading
added 510 characters in body
Source Link
Munzir Taha
  • 1.6k
  • 6
  • 12
Loading
Source Link
Munzir Taha
  • 1.6k
  • 6
  • 12
Loading