From b6539661465af0a28da4fcb5ac278757d82fdcb5 Mon Sep 17 00:00:00 2001 From: Agent725 Date: Sat, 8 Nov 2025 16:30:48 +0100 Subject: [PATCH] initial commit of Thunar-folder-icons trick --- Thunar-folder-icons/custom_icons.txt | 116 ++++++++++++++++++++++ Thunar-folder-icons/folder-thumbnailer.sh | 8 ++ Thunar-folder-icons/folder.thumbnailer | 7 ++ 3 files changed, 131 insertions(+) create mode 100644 Thunar-folder-icons/custom_icons.txt create mode 100755 Thunar-folder-icons/folder-thumbnailer.sh create mode 100755 Thunar-folder-icons/folder.thumbnailer diff --git a/Thunar-folder-icons/custom_icons.txt b/Thunar-folder-icons/custom_icons.txt new file mode 100644 index 0000000..b4e7aa7 --- /dev/null +++ b/Thunar-folder-icons/custom_icons.txt @@ -0,0 +1,116 @@ +HOWTO: MAKE CUSTOM FOLDER ICONS + +Find some cool icons in /usr/share/icons/... and get to work! + + +Tested in LM Xfce 19.3 we was on ubuntu 18.04 and on thunar 1.6.15. + +Now, that we are on LM 20 xfce and on thunar 1.8.14 ... we are able to show custom folder icons in thunar. +(Might be useful for music-collections - or image-collections ... e.g.) + +As shown on the xfce4 website we will need two scripts to do it. + +I will show you the way i got it to work (without the use of terminal) + +1. open up thunar and create a folder in your home-directory and name it like "mythunarfiles" (without quotes) ... or whatever you want. + +2. open up xed and copy the first script to it : + +Code: Select all + +#!/bin/bash + +convert -thumbnail "$1" "$2/cover.jpg" "$3" 1>/dev/null 2>&1 ||\ +convert -thumbnail "$1" "$2/.icon.png" "$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 + +3. save the script as : + +Code: Select all + +folder-thumbnailer + +to the folder home/yourname/mythunarfiles + +4. now copy the second script to xed : + +Code: Select all + +[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 + +5. save the script as : + +Code: Select all + +folder.thumbnailer + +to the folder home/yourname/mythunarfiles + +Open up thunar and + +home/yourname/mythunarfiles + +Open up a new thunar window + +6. navigate to > filesystem > usr > bin + +7. make a right click on the folder and choose "open as root" + +8. Drag and drop the file + +Code: Select all + +folder-thumbnailer + +from the thunar-window home/yourname/mythunarfiles to the window /usr/bin (which is now opened with root-privilegues.) + +9. now do a right click on the file folder-thumbnailer (that now sits in /usr/bin/ +and choose > Properties> Access rights and mark: "File can be started as a program" + +10. close the Folder + +11. navigate to > filesystem > usr > share > thumbnailers. + +12. now do a right click on the folder and choose "open as root" + +12. Drag and drop the file + +Code: Select all + +folder.thumbnailer + +from the thunar-window home/yourname/mythunarfiles to the window /usr/share/thumbnailers (which is now opened with root-privilegues.) + +13. now do a right click on the folder.thumbnailer (that now sits in /usr/share/thumbnailers +and choose > Properties> Access rights and mark: "File can be started as a program" + +14. close the folder. + +15. Very important : + +to get it to work : you must install imagemagick + +Code: Select all + +apt install imagemagick + +16. Now restart the system + +17. And now restarted : +...... if you place a jpg-image with the name : + cover.jpg +or + .icon.png +into a folder ..... the folder icon will show it . + +And if you delete the file thunar will show the "normal" file icon again ... diff --git a/Thunar-folder-icons/folder-thumbnailer.sh b/Thunar-folder-icons/folder-thumbnailer.sh new file mode 100755 index 0000000..5f88479 --- /dev/null +++ b/Thunar-folder-icons/folder-thumbnailer.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Creates a custom icon for folder based on hidden .folder.png file. +convert -thumbnail "$1" "$2/.icon.png" "$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 diff --git a/Thunar-folder-icons/folder.thumbnailer b/Thunar-folder-icons/folder.thumbnailer new file mode 100755 index 0000000..a395d8d --- /dev/null +++ b/Thunar-folder-icons/folder.thumbnailer @@ -0,0 +1,7 @@ +[Thumbnailer Entry] +Version=1.0 +Encoding=UTF-8 +Type=X-Thumbnailer +Name=Folder Thumbnailer +MimeType=inode/directory; +Exec=/home/user/.local/bin/folder-thumbnailer %s %i %o %u