Xfce Wiki

Sub domains
 

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
xfce:thunar:tumbler [2013/01/12 12:08] – [Cover Thumbnailer] nickxfce:thunar:tumbler [2018/08/25 20:35] – [Customized Thumbnailer for folders] alexxcons
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 ===== ===== Configuration =====
  
-Tumbler has since version 0.1.27 a configuration file to control the priority and locations, file sizes plugin is used for: [[http://git.xfce.org/xfce/tumbler/plain/tumblerd/tumbler.rc|tumbler.rc]].+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. 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   mkdir -p $XDG_CONFIG_HOME/tumbler
   cp /etc/xdg/tumbler/tumbler.rc $XDG_CONFIG_HOME/tumbler/   cp /etc/xdg/tumbler/tumbler.rc $XDG_CONFIG_HOME/tumbler/
  
-Each group in the plugin is responsible for the settings of a particular thumbnail provides plugin. The following keys can be used to adjust a plugin:+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 ? Disabled
Line 26: Line 29:
 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 order to use the cover thumbnailer you need to copy the tumbler.rc file to your home directory like described above and set the ''Disabled'' key to ''false''. It is also advised to set the Locations path to the directory where you store your movies.+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]   [CoverThumbnailer]
Line 35: Line 38:
   #APIKey=your-api-key-from-themoviedb.org   #APIKey=your-api-key-from-themoviedb.org
  
-The movie thumbnailer supports different movie API's. By default the [[http://omdbapi.com|The Open Movie Database API]] is used. At your choice you can also use [[http://themoviedb.org|The Movie DB]], but this site requires an API keywhich 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 movie thumbnailer supports two different movie APIs. By defaultthe [[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]].\\ 
-Advantage of the latter is that their database has better support for internationalized movie names.+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] 
 +Version=1.0 
 +Encoding=UTF-8 
 +Type=X-Thumbnailer 
 +Name=dds Thumbnailer 
 +MimeType=image/x-dds; 
 +Exec=/usr/bin/convert -thumbnail %s %i %o 
 +</file> 
 +  - 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 a 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] 
 +Version=1.0 
 +Encoding=UTF-8 
 +Type=X-Thumbnailer 
 +Name=Folder Thumbnailer 
 +MimeType=inode/directory; 
 +Exec=/usr/bin/folder-thumbnailer %s %i %o %u 
 +</file> 
 + 
 +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> 
 +#!/bin/bash
  
-After creating the rc file, it is best if you log-off and on again to restart Thunar and Tumbler, because both applications cache the mime-type combinations.+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 
 +</file>