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
xfce:tumbler:available_plugins [2020/08/30 09:51] – [Tumbler Plugins] kevinbowenxfce:tumbler:available_plugins [2023/07/04 15:45] (current) – Fix quoting in Exec commands gael
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
-====== Tumbler Plugins ======+{{ :xfce:xfce.tumbler.png?no link|}} 
 +====== Tumbler - Available Plugins ======
 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.  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. 
  
Line 6: Line 7:
   * **[[#Cover Thumbnailer|Cover Thumbnailer]]**   * **[[#Cover Thumbnailer|Cover Thumbnailer]]**
   * **[[#Customized Thumbnailers|Customized Thumbnailers]]**   * **[[#Customized Thumbnailers|Customized Thumbnailers]]**
-  * **[[#Customized Thumbnailers for .dds files|Customized Thumbnailers for .dds files]]** +  * **[[#Customized Thumbnailer for .dds files|Customized Thumbnailer for .dds files]]** 
-  * **[[#Customized Thumbnailers for folders|Customized Thumbnailers for folders]]** +  * **[[#Customized Thumbnailer for folders|Customized Thumbnailer for folders]]** 
-  * **[[#Customized Thumbnailers for text-based documents|Customized Thumbnailers for text-based documents]]** +  * **[[#Customized Thumbnailer for text-based documents|Customized Thumbnailer for text-based documents]]** 
-  * **[[#Customized Thumbnailers for comic book archives|Customized Thumbnailers for comic book archives]]** +  * **[[#Customized Thumbnailer for comic book archives|Customized Thumbnailer for comic book archives]]** 
-  * **[[#Customized Thumbnailers for webp content|Customized Thumbnailers for webp content]]**+  * **[[#Customized Thumbnailer for webp content|Customized Thumbnailer for webp content]]** 
 +  * **[[#Customized Thumbnailer for stl content|Customized Thumbnailer for stl content]]**
  
 ---- ----
Line 18: Line 20:
 === Image Thumbnailers === === Image Thumbnailers ===
   * __JPEG-thumbnailer__   * __JPEG-thumbnailer__
-     - Details missingPlease add, if known - +     Dedicated to JPEG image files.
-     * Is that plugin still needed ? Pixbuf-thumbnailer as well supports jpeg. Is this plugin faster ?+
   * __Pixbuf-thumbnailer__   * __Pixbuf-thumbnailer__
-     * Supports all type GdkPixbuf supports (Gtk3.22: anibmp, GdkPixdata, gif, icns, ico, jpeg, png, pnm, qtif, svg, tga, tiff, wmf, xbm, xpm)+     * Supports all type gdk-pixbuf supports. The list depends on the installed optional librariesbut you can obtain a minimal mime type list by<code> 
 +sed -n 's/MimeType=//p' /usr/share/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer 
 +</code>
   * __Raw-thumbnailer__   * __Raw-thumbnailer__
-      RAW image files using libopenraw (Adobe DNG, Canon CRW CR2, Epson ERF, Fuji RAF, Minolta MRW, Nikon NEF and NRW, Olympus ORF, Panasonic RAW and RW2, Pentax PEF, Sony ARW)+      RAW image files using libopenraw (Adobe DNG, Canon CRW CR2, Epson ERF, Fuji RAF, Minolta MRW, Nikon NEF and NRW, Olympus ORF, Panasonic RAW and RW2, Pentax PEF, Sony ARW).
 === Video Thumbnailers === === Video Thumbnailers ===
   * __Cover-thumbnailer__   * __Cover-thumbnailer__
-     * Downloads video covers from omdbapi.com or themoviedb.org. [[xfce:thunar:tumbler#cover_thumbnailer|See details below ]]+     * Downloads video covers from omdbapi.com or themoviedb.org. [[#cover_thumbnailer|See details below]].
   * __ffmpeg-thumbnailer__   * __ffmpeg-thumbnailer__
-     - Details missingPlease add, if known - +     Main video plugin.
-     * Requires package: ??+
   * __GStreamer-thumbnailer__   * __GStreamer-thumbnailer__
      * Provides video and audio cover (e.g. mp3, flac, etc) thumbnails.      * Provides video and audio cover (e.g. mp3, flac, etc) thumbnails.
-     * Requires package: gstreamer1.0-plugins-* (debian), gstreamer1-plugins-* (fedora), gst-plugins-* (Arch) +=== Document Thumbnailers ===
-=== Other Thumbnailers ===+
   * __Font-thumbnailer__   * __Font-thumbnailer__
-     - Details missingPlease add, if known -+     Provides thumbnails for font files.
   * __Poppler-thumbnailer__   * __Poppler-thumbnailer__
-     * Thumbnailer for PS/PDF files +     * Thumbnailer for PS/PDF files.
-     * Requires package: //poppler-utils//+
   * __ODF-thumbnailer__   * __ODF-thumbnailer__
-     * Provides thumbnails for different open document types, oasis.opendocument (presentation, text,chart, image), sun.xml ( calc, writer, draw, impress. math) and some more +     * Provides thumbnails for different open document types, ''oasis.opendocument'' (presentation, text,chart, image), ''sun.xml'' ( calc, writer, draw, impress. math) and some more
-     Here the [[https://git.xfce.org/xfce/tumbler/tree/plugins/odf-thumbnailer/odf-thumbnailer-provider.c#n104|complete MIME Type List]] +  * __GEpub-thumbnailer__ 
-  * __Customized thumbnailers__ +     Provides thumbnails for EPUB files. 
-     * All thumbnailers provided by .thumbnailer desktop files. [[xfce:thunar:tumbler#customized_thumbnailers|See examples below ]]+ 
 +=== External Thumbnailers === 
 +  * All thumbnailers provided by ''.thumbnailer'' desktop files. Also known as customized or desktop thumbnailers. [[#customized_thumbnailers|See examples below]].
  
  
Line 57: Line 59:
 NB: ''$XDG_CONFIG_HOME'' defaults to ''~/.config''. NB: ''$XDG_CONFIG_HOME'' defaults to ''~/.config''.
  
-  mkdir -p $XDG_CONFIG_HOME/tumbler +  mkdir -p "${XDG_CONFIG_HOME:=~/.config}/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 configuration file is responsible for the settings of a particular thumbnailer 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:
Line 65: Line 67:
 ! Disable the plugin, the values ''true'' and ''false'' are accepted. ! Disable the plugin, the values ''true'' and ''false'' are accepted.
 ? Priority ? Priority
-! Numeric value to control the priority of the plugin. If plugins can provide thumbnails for the same scheme + mime-type combination, the plugin with the highest priority is used first.+! Numeric value to control the priority of the plugin. If two plugins can provide thumbnails for the same scheme + mime-type combination, the plugin with the highest priority is used first.
 ? Locations ? 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.+! 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
 +? Excludes 
 +! A ;-separated path list the plugin will not be used for. If the source file is 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 exclude nothing. Please note that paths in ''Excludes'' precede those in ''Locations''.
 ? MaxFileSize ? 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.+! Maximum size of the source file the plugin will still try to generate a thumbnail for. The size is in bytes, 0 disables the check
 + 
 +As of Tumbler 4.17.0 (first stable release 4.18.0), these settings extend to [[#customized_thumbnailers|external thumbnailers]] of the desktop-thumbnailer plugin, by adding the group "X-Tumbler Settings" to the ''.thumbnailer'' files. Further instructions and an example are given at the end of the ''tumbler.rc'' file.
  
 [[|Back to Top]] [[|Back to Top]]
Line 76: Line 82:
 ===== 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 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 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. 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.
Line 96: Line 102:
  
 ===== Customized Thumbnailers ===== ===== Customized Thumbnailers =====
-As of version 0.2.0, the desktop thumbnailer functionality has been added back into tumbler. This functionality supports custom .thumbnailer files placed in the /usr/share/thumbnailers folder.+As of version 0.2.0, the desktop thumbnailer functionality has been added back into tumbler. This functionality supports custom ''.thumbnailer'' files placed in the ''XDG_DATA_DIRS/thumbnailers'' directories and the ''XDG_DATA_HOME/thumbnailers'' directory (which defaults to ''~/.local/share/thumbnailers''). The former is the place for system wide thumbnailers (normally in ''/usr/share/thumbnailers''), while the latter is the preferred place for the user's customized thumbnailers (see below). 
 + 
 +Since 4.17.0 (first stable release 4.18.0), in case of several ''.thumbnailer'' files with the same name in the thumbnailer directories, the one placed in the highest priority directory override all the others. 
  
 ==== Customized Thumbnailer for .dds files ==== ==== Customized Thumbnailer for .dds files ====
  
-For example, to create a custom thumbnailer for .dds files, do the following: +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>+  - Create the appropriate ''.thumbnailer'' file:<file txt ~/.local/share/thumbnailers/dds.thumbnailer>
 [Thumbnailer Entry] [Thumbnailer Entry]
 Version=1.0 Version=1.0
Line 108: Line 117:
 Name=dds Thumbnailer Name=dds Thumbnailer
 MimeType=image/x-dds; MimeType=image/x-dds;
-Exec=/usr/bin/convert -thumbnail %s %i %o+Exec=convert -thumbnail %s %i %o
 </file> </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"?>   - 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"?>
Line 118: Line 127:
         <glob pattern="*.dds"/>         <glob pattern="*.dds"/>
     </mime-type>     </mime-type>
-</mime-info></file>...and run "update-mime-database ~/.local/share/mime".+</mime-info></file>...and run<code> 
 +update-mime-database ~/.local/share/mime</code>
  
 ==== Customized Thumbnailer for folders ==== ==== 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: +Another example are albums cover thumbnails for folders in a music collection. 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>+<file txt ~/.local/share/thumbnailers/folder.thumbnailer>
 [Thumbnailer Entry] [Thumbnailer Entry]
 Version=1.0 Version=1.0
Line 130: Line 140:
 Name=Folder Thumbnailer Name=Folder Thumbnailer
 MimeType=inode/directory; MimeType=inode/directory;
-Exec=/usr/bin/folder-thumbnailer %s %i %o %u+Exec=sh -c '~/bin/folder-thumbnailer "$@"'%s %i %o %u
 </file> </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:+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>+<file sh ~/bin/folder-thumbnailer>
 #!/bin/bash #!/bin/bash
  
-convert -thumbnail "$1"$2/folder.jpg"$31>/dev/null 2>&1 ||\ +covers=("$2"/{.,}{folder,cover}.{jpg,png}) 
-convert -thumbnail "$1" "$2/.folder.jpg" "$3" 1>/dev/null 2>&1 ||\ +for f in "${covers[@]}"; do 
-convert -thumbnail "$1"$2/folder.png" "$3" 1>/dev/null 2>&||+  -"$f] && { 
-convert -thumbnail "$1" "$2/cover.jpg" "$3" 1>/dev/null 2>&1 ||\ +    cover=$
-rm -f "$HOME/.cache/thumbnails/normal/$(echo -n "$4" | md5sum | cut -d " " -f1).png" ||\ +    break 
-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" ||+done 
-rm -f "$HOME/.thumbnails/large/$(echo -n "$4" | md5sum | cut -d " " -f1).png" ||\ + 
-exit 1+if [ -"$cover|| convert -thumbnail "$1" "$cover" "$3"; then 
 +  gdbus call --session --dest=org.freedesktop.thumbnails.Cache1 --object-path /org/freedesktop/thumbnails/Cache1 
 +             --method org.freedesktop.thumbnails.Cache1.Delete "['$4']>/dev/null 
 +fi
 </file> </file>
  
-Dont forget to give execution permission to the file! E.gsudo chmod a+x /usr/bin/folder-thumbnailer+Don'forget to give execution permission to the file: 
 + 
 +  chmod u+x ~/bin/folder-thumbnailer 
 +   
 +and to restart Thunar and Tumbler so that the new folder mime type is taken into account.
  
-Note: imagemagick is a required dependency for this script.+Note: ImageMagick is a required dependency for this script.
  
 ==== Customized Thumbnailer for text-based documents ==== ==== 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:+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>+<file txt ~/.local/share/thumbnailers/text.thumbnailer>
 [Thumbnailer Entry] [Thumbnailer Entry]
 Version=1.0 Version=1.0
Line 163: Line 180:
 Name=Text Thumbnailer Name=Text Thumbnailer
 MimeType=text/plain;text/html;text/css; MimeType=text/plain;text/html;text/css;
-Exec=/usr/local/bin/textthumb %s %i %o+Exec=sh -c '~/bin/textthumb "$@"'%s %i %o
 </file> </file>
  
 And supporting script: And supporting script:
  
-<file sh /usr/local/bin/textthumb>+<file sh ~/bin/textthumb>
 #!/bin/bash #!/bin/bash
 +
 iFile=$(<"$2") iFile=$(<"$2")
-iChopped="${iFile:0:1600}" +tempFile=$(mktemp) && { 
-unset iFile +  echo "${iFile:0:1600}" "$tempFile
-echo "${iChopped}> tmp.txt +  convert -size 210x290 -background white -pointsize 5 -border 10x10 -bordercolor "#CCC" caption:@"$tempFile" "$3" 
-unset iChopped +  rm "$tempFile" 
-convert -size 210x290 -background white -pointsize 5 -border 10x10 -bordercolor "#CCC" caption:@"tmp.txt" "$3" +}
-rm tmp.txt+
 </file> </file>
  
-You can add additional mime types to the MimeType line of the thumbnailer file to support additional text-based document types.+You can add additional mime types to the ''MimeType'' line of the thumbnailer file to support additional text-based document types.
  
 ==== Customized Thumbnailer for comic book archives ==== ==== Customized Thumbnailer for comic book archives ====
-A thumbnailer for comic book archives (cbr, cbz, cbt, cb7) can be created using the comicthumb utility (search for it your distro's repositories). Use the following thumbnailer file: +A thumbnailer for comic book archives (cbr, cbz, cbt, cb7) can be created using the comicthumb utility (search for it your distro's repositories). If not already present as ''/usr/share/thumbnailers/comicthumb.thumbnailer'', create the following thumbnailer file: 
-<file txt /usr/share/thumbnailers/comicthumb.thumbnailer>+<file txt ~/.local/share/thumbnailers/comicthumb.thumbnailer>
 [Thumbnailer Entry] [Thumbnailer Entry]
 TryExec=comicthumb TryExec=comicthumb
Line 193: Line 210:
 ==== Customized Thumbnailer for webp content ==== ==== Customized Thumbnailer for webp content ====
 Note: Make sure there is an image/webp mimetype defined in your system. Note: Make sure there is an image/webp mimetype defined in your system.
-<file txt /usr/share/thumbnailers/webp.thumbnailer>+<file txt ~/.local/share/thumbnailers/webp.thumbnailer>
 [Thumbnailer Entry] [Thumbnailer Entry]
 Version=1.0 Version=1.0
Line 200: Line 217:
 Name=webp Thumbnailer Name=webp Thumbnailer
 MimeType=image/webp; MimeType=image/webp;
-Exec=/usr/bin/convert -thumbnail %s %i %o+Exec=sh -c '~/bin/webpthumbs "$@"' _ %s %i %o 
 +</file> 
 + 
 +And supporting script: 
 + 
 +<file sh ~/bin/webpthumbs> 
 +#!/bin/bash 
 + 
 +if tempfile=$(mktemp) && /usr/bin/webpmux -get frame 1 "$2" -o "$tempfile"; then 
 +  /usr/bin/convert -thumbnail "$1" "$tempfile" "$3"  
 +else 
 +  /usr/bin/convert -thumbnail "$1" "$2" "$3" 
 +fi 
 + 
 +[ -f "$tempfile" ] && rm "$tempfile" 
 +</file> 
 + 
 +==== Customized Thumbnailer for stl content ==== 
 +<file txt ~/.local/share/thumbnailers/stl.thumbnailer> 
 +[Thumbnailer Entry] 
 +Version=1.0 
 +Encoding=UTF-8 
 +Type=X-Thumbnailer 
 +Name=STL Thumbnailer 
 +MimeType=model/stl; 
 +Exec=sh -c '~/bin/stl-thumbnailer "$@"'%i %o %s 
 +</file> 
 + 
 +And supporting script: 
 + 
 +<file sh ~/bin/stl-thumbnailer> 
 +#!/bin/bash 
 + 
 +if (($# < 3)); then 
 +  echo "$0: input_file_name output_file_name size" 
 +  exit 1 
 +fi 
 + 
 +INPUT_FILE=$1 
 +OUTPUT_FILE=$2 
 +SIZE=$3 
 + 
 +if TEMP=$(mktemp --directory --tmpdir tumbler-stl-XXXXXX); then 
 +  cp "$INPUT_FILE" "$TEMP/source.stl" 
 +  echo 'import("source.stl", convexity=10);' > "$TEMP/thumbnail.scad" 
 +  openscad --imgsize "500,500" -o "$TEMP/thumbnail.png" "$TEMP/thumbnail.scad" 2>/dev/null 
 +  convert -thumbnail "$SIZE" "$TEMP/thumbnail.png" "$OUTPUT_FILE" &>/dev/null 
 +  rm -rf $TEMP 
 +fi
 </file> </file>