Xfce Wiki

Sub domains


This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
xfce:thunar:tumbler [2012/12/11 21:48]
nick created
xfce:thunar:tumbler [2019/08/16 22:46] (current)
alexxcons [Customized Thumbnailer for folders]
Line 1: Line 1:
 ====== Tumbler ====== ====== Tumbler ======
 +The Tumbler package contains a D-Bus thumbnailing service based on the thumbnail management D-Bus specification. This is useful for generating thumbnail images of files. ​
 +===== Configuration =====
 +Tumbler has since version 0.1.27 a configuration file to control the priority, locations and file sizes the plugin is used for: [[http://​git.xfce.org/​xfce/​tumbler/​plain/​tumblerd/​tumbler.rc|tumbler.rc]].
 +To override the default configuration,​ located in one of the xdg directories on your system, you can copy the rc-file to your ''​$XDG_CONFIG_HOME''​ directory.
 +NB: ''​$XDG_CONFIG_HOME''​ defaults to ''​~/​.config''​.
 +  mkdir -p $XDG_CONFIG_HOME/​tumbler
 +  cp /​etc/​xdg/​tumbler/​tumbler.rc $XDG_CONFIG_HOME/​tumbler/​
 +Each group in the configuration file is responsible for the settings of a particular thumbnailer plugin. The following keys can be used to adjust a plugin:
 +? Disabled
 +! Disable the plugin, the values ''​true''​ and ''​false''​ are accepted.
 +? Priority
 +! Numeric value to control the priority of the plugin. If 2 plugins can provide thumbnails for the same scheme + mime-type combination,​ the plugin with the highest priority is used first.
 +? Locations
 +! A ;-separated path list the plugin will be used for. If the source file is not a child of one of the locations, the plugin won't be used and another plugin with a lower priority will be tried. Absolute paths, environment variables, ~/ and ~username/ are allowed. Leave empty to allow all locations.
 +? MaxFileSize
 +! Maximum size of the source file the plugin will still try to generate a plugin for. The size is in bytes, 0 disabled the check.
 ===== Cover Thumbnailer ===== ===== Cover Thumbnailer =====
 By the default the cover thumbnailer is disabled. The reason is that it sends information (movie title extracted from the filename) to online services to retrieve a poster. This information is normally harmless, but it is private, so therefore it's not enabled by default. By the default the cover thumbnailer is disabled. The reason is that it sends information (movie title extracted from the filename) to online services to retrieve a poster. This information is normally harmless, but it is private, so therefore it's not enabled by default.
-In other to use the cover thumbnailer you need to create a config ​file to white-list locations. If the thumbnail ​file is child of one of the locationsit will try to download ​poster.+In order to use the cover thumbnailer you need to copy the tumbler.rc file to your home directory as described above and set the ''​Disabled''​ key to ''​false''​. It is also advisable to set the Locations path to the directory where you store your movies. 
 +  [CoverThumbnailer] 
 +  Disabled=false 
 +  Priority=3 
 +  Locations=~/​movies 
 +  MaxFileSize=0 
 +  #​APIKey=your-api-key-from-themoviedb.org 
 +The movie thumbnailer supports two different movie APIs. By default, the [[http://​omdbapi.com|The Open Movie Database API]] is used. You can also choose to use [[http://​themoviedb.org|The Movie DB]], but this site requires an API key which you have to [[http://​docs.themoviedb.apiary.io/​|request]] or uh... [[https://​raw.github.com/​xbmc/​xbmc/​master/​addons/​metadata.themoviedb.org/​tmdb.xml|search]].\\ 
 +The advantage of the latter is that their database has better support for internationalized movie names. 
 +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 /​usr/​share/​thumbnailers folder. 
 +==== Customized Thumbnailer for .dds files ==== 
 +For example, ​to create a custom thumbnailer for .dds files, do the following:​ 
 +  - Create the appropriate .thumbnailer ​file:<file txt /​usr/​share/​thumbnailers/​dds.thumbnailer>​ 
 +[Thumbnailer Entry] 
 +Name=dds Thumbnailer 
 +Exec=/​usr/​bin/​convert -thumbnail %s %i %o 
 +  - 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:<file txt ~/​.local/​share/​mime/​packages/​dds.xml><?​xml version="​1.0"​ encoding="​UTF-8"?>​ 
 +<​mime-info xmlns="​http://​www.freedesktop.org/​standards/​shared-mime-info">​ 
 +    <​mime-type type="​image/​x-dds">​ 
 +        <​comment>​dds file</​comment>​ 
 +        <icon name="​image"/>​ 
 +        <​glob-deleteall/>​ 
 +        <glob pattern="​*.dds"/>​ 
 +    </​mime-type>​ 
 +</​mime-info></​file>​...and run "​update-mime-database ~/​.local/​share/​mime"​. 
 +==== Customized Thumbnailer for folders ==== 
 +Another example are albums cover thumbnails for folders in music collection. Starting with thunar 1.8.2 a custom thumbnailer can be added to e.g. add a file  ''​folder.jpg''​ or ''​cover.jpg''​ into a folder and display its thumbnail instead ​of the default folder icon: 
 +<file txt /​usr/​share/​thumbnailers/​folder.thumbnailer>​ 
 +[Thumbnailer Entry] 
 +Name=Folder Thumbnailer 
 +Exec=/​usr/​bin/​folder-thumbnailer %s %i %o %u 
 +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 /​usr/​bin/​folder-thumbnailer>​ 
 +convert -thumbnail "​$1"​ "​$2/​folder.jpg"​ "​$3"​ 1>/​dev/​null 2>&1 ||\ 
 +convert -thumbnail "​$1"​ "​$2/​.folder.jpg"​ "​$3"​ 1>/​dev/​null 2>&1 ||\ 
 +convert -thumbnail "​$1"​ "​$2/​folder.png"​ "​$3"​ 1>/​dev/​null 2>&1 ||\ 
 +convert -thumbnail "​$1"​ "​$2/​cover.jpg"​ "​$3"​ 1>/​dev/​null 2>&1 ||\ 
 +rm -f "​$HOME/​.cache/​thumbnails/​normal/​$(echo -n "​$4"​ | md5sum | cut -d " " -f1).png"​ ||\ 
 +rm -f "​$HOME/​.thumbnails/​normal/​$(echo -n "​$4"​ | md5sum | cut -d " " -f1).png"​ ||\ 
 +rm -f "​$HOME/​.cache/​thumbnails/​large/​$(echo -n "​$4"​ | md5sum | cut -d " " -f1).png"​ ||\ 
 +rm -f "​$HOME/​.thumbnails/​large/​$(echo -n "​$4"​ | md5sum | cut -d " " -f1).png"​ ||\ 
 +exit 1 
 +Dont forget ​to give execution permission to the file! E.g: sudo chmod a+x /​usr/​bin/​folder-thumbnailer 
 +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 /​usr/​share/​thumbnailers/​text.thumbnailer>​ 
 +[Thumbnailer Entry] 
 +Name=Text Thumbnailer 
 +Exec=/​usr/​local/​bin/​textthumb %s %i %o 
-<file plain ~/​.config/​tumbler/​cover.rc>​ +And supporting script:
-[General] +
-# a ; separated list of white-listed locations +
-[TheMovieDB] +<file sh /​usr/​local/​bin/​textthumb>​ 
-API key to use themoviedb.org information +#!/​bin/​bash 
 +unset iFile 
 +echo "​${iChopped}"​ > tmp.txt 
 +unset iChopped 
 +convert ​-size 210x290 ​-background white -pointsize 5 -border 10x10 -bordercolor "#​CCC"​ caption:​@"​tmp.txt"​ "​$3"​ 
 +rm tmp.txt
 </​file>​ </​file>​
-The cover thumbnailer supports two different API backends: +You can add additional mime types to the MimeType line of the thumbnailer file to support additional text-based document types.
-  * omdbapi.com\\ The //Open Movie Database API// by Brian Fritz. The used posters are most of the time retreived from IMDB. +
-  * themoviedb.org\\ A free and community maintained movie database. This API however required an API key.+