You are not logged in.

#1 2021-01-07 20:13:07

Adcock
Member
From: Earth
Registered: 2020-06-14
Posts: 8

[SOLVED] Force Regenerate thumbnails

How can I force Thunar to regenerate thumbnails of a specific folder?
I tried Ctrl + R.

Last edited by Adcock (2021-02-06 15:12:21)

Offline

#2 2021-01-08 00:10:35

toz
Member
Registered: 2011-10-28
Posts: 513

Re: [SOLVED] Force Regenerate thumbnails

There is no built in function to regenerate thumbnails, but you can use a custom action to do this.
Note: tumbler creates a hash of the URI and saves the thumbnail file in ~/.cache/thumbnails/{normal,large}.

Here is a PoC script that can be used as a custom action (make sure you test the script on dummy data first):

#!/bin/bash

# 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
do   

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

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.

Offline

#3 2021-01-10 10:19:00

Adcock
Member
From: Earth
Registered: 2020-06-14
Posts: 8

Re: [SOLVED] Force Regenerate thumbnails

Thank you
This seems to work
But for my cursors it doesn't regenerate automatically
After running the script on cursors, I have to open those cursors in gimp and then press Ctrl+r
and that seems to regenerate.
I don't know what gimp does though.
But earlier Ctrl+r did not work but with the script it seems to work.
So thanks. smile

Offline

#4 2021-01-10 18:07:57

toz
Member
Registered: 2011-10-28
Posts: 513

Re: [SOLVED] Force Regenerate thumbnails

tumbler doesn't currently support xcursor thumbnails. Interesting that gimp can create something though. Not sure how that works.

Offline

Board footer

Powered by FluxBB