My favorite file manager is Thunar, but it hasn’t folder thumbnails by default.
Here’s how to enable it.
- Install tumbler and imagemagick
yay -S tumbler imagemagick
- Create the following a folder.thumbnailer file and add the following
sudo vi /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
- Create the folder-thumbnailer script
sudo vi /usr/bin/folder-thumbnailer
#!/bin/bash
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
sudo chmod +x /usr/bin/folder-thumbnailer
To add a thumbnail to a folder you just need to add a .folder.jpg
file and your set. You can decide to use different names in the /usr/bin/folder-thumbnailer
script.
More information here https://docs.xfce.org/xfce/thunar/tumbler.