Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
xfce:thunar:tumbler [2015/10/05 23:21] – ochosi | xfce:thunar:tumbler [2019/08/16 22:46] – [Customized Thumbnailer for folders] alexxcons | ||
---|---|---|---|
Line 42: | Line 42: | ||
After creating the rc file, it is best to log off and on again to restart Thunar and Tumbler, because both applications cache the mime-type combinations. | After creating the rc file, it is best to log off and on again to restart Thunar and Tumbler, because both applications cache the mime-type combinations. | ||
+ | |||
+ | ===== Customized Thumbnailers ===== | ||
+ | As of version 0.2.0, the desktop thumbnailer functionality has been added back into tumbler. This functionality supports custom .thumbailer files placed in the / | ||
+ | |||
+ | ==== Customized Thumbnailer for .dds files ==== | ||
+ | |||
+ | For example, to create a custom thumbnailer for .dds files, do the following: | ||
+ | - Create the appropriate .thumbnailer file:< | ||
+ | [Thumbnailer Entry] | ||
+ | Version=1.0 | ||
+ | Encoding=UTF-8 | ||
+ | Type=X-Thumbnailer | ||
+ | Name=dds Thumbnailer | ||
+ | MimeType=image/ | ||
+ | Exec=/ | ||
+ | </ | ||
+ | - Ensure that a dds mimetype exists in your system (you can view mimetypes with the Xfce4 Mime Type Editor). If it does not exist, create the necessary mime file:< | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <icon name=" | ||
+ | < | ||
+ | <glob pattern=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Customized Thumbnailer for folders ==== | ||
+ | |||
+ | Another example are albums cover thumbnails for folders in a music collection. Starting with thunar 1.8.2 a custom thumbnailer can be added to e.g. add a file '' | ||
+ | <file txt / | ||
+ | [Thumbnailer Entry] | ||
+ | Version=1.0 | ||
+ | Encoding=UTF-8 | ||
+ | Type=X-Thumbnailer | ||
+ | Name=Folder Thumbnailer | ||
+ | MimeType=inode/ | ||
+ | Exec=/ | ||
+ | </ | ||
+ | |||
+ | In order to support different names for the picture-file and to remove the thumbnail if not needed any more (display the default folder icon) , a separate script is required: | ||
+ | |||
+ | <file sh / | ||
+ | #!/bin/bash | ||
+ | |||
+ | convert -thumbnail " | ||
+ | convert -thumbnail " | ||
+ | convert -thumbnail " | ||
+ | convert -thumbnail " | ||
+ | rm -f " | ||
+ | rm -f " | ||
+ | rm -f " | ||
+ | rm -f " | ||
+ | exit 1 | ||
+ | </ | ||
+ | |||
+ | Dont forget to give execution permission to the file! E.g: sudo chmod a+x / | ||
+ | |||
+ | Note: imagemagick is a required dependency for this script. | ||
+ | |||
+ | ==== Customized Thumbnailer for text-based documents ==== | ||
+ | A thumbnailer for text-based documents can be created using the convert function from the imagemagick package with the following thumbnailer file: | ||
+ | |||
+ | <file txt / | ||
+ | [Thumbnailer Entry] | ||
+ | Version=1.0 | ||
+ | Encoding=UTF-8 | ||
+ | Type=X-Thumbnailer | ||
+ | Name=Text Thumbnailer | ||
+ | MimeType=text/ | ||
+ | Exec=/ | ||
+ | </ | ||
+ | |||
+ | And supporting script: | ||
+ | |||
+ | <file sh / | ||
+ | #!/bin/bash | ||
+ | iFile=$(<" | ||
+ | iChopped=" | ||
+ | unset iFile | ||
+ | echo " | ||
+ | unset iChopped | ||
+ | convert -size 210x290 -background white -pointsize 5 -border 10x10 -bordercolor "# | ||
+ | rm tmp.txt | ||
+ | </ | ||
+ | |||
+ | You can add additional mime types to the MimeType line of the thumbnailer file to support additional text-based document types. |