February 22, 2018

Custom Mime File Type Icon in XFCE Thunar


I wanted to associate a custom icon for my old .PSP files in XFCE, but had no clue how.  Thanks to https://unix.stackexchange.com/questions/23776/how-to-change-a-file-type-icon-in-xfce-thunar, I was able to do it easily.



Firstly create a custom icon, then save it into ~/.local/share/icons/.  (Alternatively, with sudo/root access try /usr/share/icons/. For example, mine was ~/.local/share/icons/pspimage.png.

Then create a new mime xml in your user’s ~/.local/share/mime/packages/. For example, mine was ~/.local/share/mime/packages/pspimage.xml. (Alternatively, for system-wide, try /usr/share/mime/packages/.)

Which contained:
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="application/octet-stream">
    <comment>PaintShop Pro Image</comment>
    <glob pattern="*.psp"/>
    <glob pattern="*.pspimage"/>
    <generic-icon name="pspimage"/>
    <icon name="pspimage"/>
  </mime-type>
</mime-info>

Then simply update your system: (Alternatively, as sudo/root, perform same as below in /usr/share/mime/packages/.)
cd ~/.local/share/mime && update-mime-database $PWD

Refresh your Thunar view and viola.



~~
As always, good luck!

Please consider crypto tipping:
  

1 comment:

Comments, Suggestions or "Thank you's" Invited! If you have used this info in any way, please comment below and link/link-back to your project (if applicable). Please Share.
I accept Bitcoin tips of ANY amount to: 1GS3XWJCTWU7fnM4vfzerrVAxmnMFnhysL
I accept Litecoin tips of ANY amount to: LTBvVxRdv2Lz9T41UzqNrAVVNw4wz3kKYk