From ec485688cd407bb0983c208dbf2c3267a9a071fc Mon Sep 17 00:00:00 2001 From: j-james Date: Wed, 21 Oct 2020 14:30:57 -0700 Subject: Create custom folder thumbnailer for Tumbler --- folder-thumbnailer | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 folder-thumbnailer (limited to 'folder-thumbnailer') diff --git a/folder-thumbnailer b/folder-thumbnailer new file mode 100644 index 0000000..b4b0b5b --- /dev/null +++ b/folder-thumbnailer @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ -f "$2/.folder.jpg" ]; then + convert -thumbnail "$1" "$2/.folder.jpg" "$3" 1>/dev/null 2>&1 +elif [ -f "$2/.folder.png" ]; then + convert -thumbnail "$1" "$2/.folder.png" "$3" 1>/dev/null 2>&1 +elif [ -f "$2/.folder.svg" ]; then + inkscape --export-type=png --export-dpi=500 "$2/.folder.svg" --export-filename="$3" 1>/dev/null 2>&1 + convert -thumbnail "$1" "$3" "$3" 1>/dev/null 2>&1 +else + 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" +fi -- cgit v1.2.3-70-g09d2