Xfce Wiki

Sub domains
 

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
xfce:thunar:tumbler [2018/08/24 16:30]
alexxcons [Desktop Thumbnailer Plugin]
xfce:thunar:tumbler [2019/04/23 13:00] (current)
toz [Customized Thumbnailer for folders]
Line 70: Line 70:
 ==== 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 ​od the default folder icon:+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>​ <file txt /​usr/​share/​thumbnailers/​folder.thumbnailer>​
 [Thumbnailer Entry] [Thumbnailer Entry]
Line 78: Line 78:
 Name=Folder Thumbnailer Name=Folder Thumbnailer
 MimeType=inode/​directory;​ MimeType=inode/​directory;​
-Exec=/​usr/​bin/​folder-thumbnailer %s %i %o+Exec=/​usr/​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:
  
 <file sh /​usr/​bin/​folder-thumbnailer>​ <file sh /​usr/​bin/​folder-thumbnailer>​
 #!/bin/bash #!/bin/bash
  
-convert -thumbnail "​$1"​ "​$2/​folder.jpg"​ "​$3"​ ||\ +convert -thumbnail "​$1"​ "​$2/​folder.jpg"​ "​$3" ​1>/​dev/​null 2>&​1 ​||\ 
-convert -thumbnail "​$1"​ "​$2/​.folder.jpg"​ "​$3"​ ||\ +convert -thumbnail "​$1"​ "​$2/​.folder.jpg"​ "​$3" ​1>/​dev/​null 2>&​1 ​||\ 
-convert -thumbnail "​$1"​ "​$2/​folder.png"​ "​$3"​ ||\ +convert -thumbnail "​$1"​ "​$2/​folder.png"​ "​$3" ​1>/​dev/​null 2>&​1 ​||\ 
-convert -thumbnail "​$1"​ "​$2/​cover.jpg"​ "​$3"​ ||\ +convert -thumbnail "​$1"​ "​$2/​cover.jpg"​ "​$3" ​1>/​dev/​null 2>&​1 ​||\ 
-rm -f "​$HOME/​.cache/​thumbnails/​normal/​$(echo -n "file://$2" | md5sum | cut -d " " -f1).png"​ ||\ +rm -f "​$HOME/​.cache/​thumbnails/​normal/​$(echo -n "$4" | md5sum | cut -d " " -f1).png"​ ||\ 
-rm -f "​$HOME/​.thumbnails/​normal/​$(echo -n "file://$2" | 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 "file://$2" | 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 "file://$2" | md5sum | cut -d " " -f1).png"​ ||\ +rm -f "​$HOME/​.thumbnails/​large/​$(echo -n "$4" | md5sum | cut -d " " -f1).png"​ ||\ 
-exit 0+exit 1
 </​file>​ </​file>​
 +
 +Note: imagemagick is a required dependency for this script.