Step-by-Step Guide to Setting a Folder Thumbnail in Dolphin File Manager
Set a folder image as the thumbnail in Dolphin using Keneric.
Step-by-Step Guide to Setting a Folder Thumbnail in Dolphin File Manager
This post is specifically for dolphin file manager in KDE. So my goal was to achieve following:
- have a image inside some folders with name
folder.jpg - and display it as thumbnail of the folder
For this I used keneric.
- Install
keneric. This will create a shared library filekeneric.soin/usr/lib/x86_64-linux-gnu/qt5/plugins - Now create a desktop file
kenericfolder.desktopin one of the location given by commandkf5-config --path services. For me it was~/.local/share/kservices5and/usr/share/kseervices5. Content ofkenericfolder.desktop:
[Desktop Entry]
Type=Service
Name=Folder (Keneric)
Name[x-test]=xxFolder (Keneric)xx
X-KDE-ServiceTypes=ThumbCreator
MimeType=inode/directory;
X-KDE-Library=keneric
CacheThumbnail=true
- Now create a script
stripPicturein one of the locations in your$PATHvariable. Contents ofstripPicture:
#!/bin/sh
# Usage: stripPicture fullname mime exportPicture
fullname="$1"
mime="$2"
exportPicture="$3"
# thumbnail options by mime type
case "$mime" in
inode/directory)
cp "$fullname"/folder.jpg "$exportPicture"
cp "$fullname"/Cover.png "$exportPicture"
cp "$fullname"/Poster.jpg "$exportPicture"
cp "$fullname"/Front.jpg "$exportPicture"
exit
;;
*)
# case trap
exit
esac
- Now open dolphin -> open
Configure Dolphin...window. - Inside
Generalcategory, in thePreviewstab disable theFolderpreview and enableFolders only one image (Keneric)option.
References
This post is licensed under
CC BY 4.0
by the author.