Xfce Forum

Sub domains

You are not logged in.

#1 2022-11-13 20:08:25

Registered: 2015-03-03
Posts: 20

tumbler - renew folder


Sometimes while working on images, tumbler leaves previews/thumbnails in thunar in an unfinished state. (Usually a visible strip at the top of the image, but largely grayed out in the remainder of the image.)

I'm wondering if there is a CLI command that can tell tumbler to redo the current directory, or something suchlike. I'd like to make a custom Thunar action.

The tumbler docs are kind of vague on the subject, at least to my non-programmer mind.



#2 2022-11-13 20:26:00

From: Canada
Registered: 2011-06-02
Posts: 9,792

Re: tumbler - renew folder

Here is a Proof-of-Concept thunar custom action script that can be used to regenerate a thumbnail (make sure you test the script on dummy data first):


# thunar custom action
# command = /path/to/script %F
# appearance = select all

delete_thumbnail () {
    hash=$(echo -n "file://$1" | md5sum | awk '{print $1}')
    rm -f ~/.cache/thumbnails/{normal,large}/$hash.png

for i in $1

    if [[ -d "$i" ]]   # if its a directory
    then   # process all files
        for f in "$i"/*
            delete_thumbnail "$f"
    else   #its a file so just process it
        delete_thumbnail "$i"

exit 0

Create a custom action, command is script plus %F (/path/to/script %F), and on the Appearance tab, check all boxes.

In thunar, you can select any combination of files and/or directories and it will run.

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---


#3 2022-11-14 18:40:44

Registered: 2020-12-31
Posts: 149

Re: tumbler - renew folder

Some notes:

  • The problem described in the OP corresponds to https://gitlab.xfce.org/xfce/tumbler/-/issues/15 and should be fixed since Tumbler 4.17.0 in many cases (it depends on the file system, but typically it's ok on ext4).

  • The thumbnail URI must be correctly escaped to match the RFC 3986 standard required by the spec, so personally I use this:

    hash=$(printf '%s' "$(gio info "$1" | sed -n 's/^uri.* //p')" | md5sum - | cut -d' ' -f1)
  • Instead of hash=... ; rm ... you can also use

    gdbus call --session --dest=org.freedesktop.thumbnails.Cache1 --object-path /org/freedesktop/thumbnails/Cache1 --method org.freedesktop.thumbnails.Cache1.Delete "['$(gio info "$1" | sed -n 's/^uri.* //p')']"

    which should take care of everything.

Last edited by Tamaranch (2022-12-03 14:46:19)


Board footer

Powered by FluxBB