Shows thumbnails of STL files in Nautilus file browser. The sources are based on linux nautilus stl thumbnailer :)
This project use stl-thumb for thumbnails preview. You must install stl-thumb before using it.
wget https://github.com/unlimitedbacon/stl-thumb/releases/download/v0.5.0/stl-thumb_0.5.0_amd64.deb
sudo apt install ./stl-thumb_0.5.0_amd64.deb
clone from repository
git clone https://github.com/MLAB-project/stl-thumbnailer.git
cd stl-thumbnailer
Intall thumbnailer
sudo cp stl_thumb.py /usr/local/bin/
sudo chmod a+x /usr/local/bin/stl_thumb.py
sudo cp stl.thumbnailer /usr/share/thumbnailers/
cp stl.xml ~/.local/share/mime/packages/
(note that it's also possible to keep files in the current dir, and only make symlinks. In that case, you'll have to edit stl.thumbnailer
file and adapt the Exec=
line to make it point to actual directory)
After that you should update MIME database by runnig following commands: (adapt to your Linux distribution)
-
update mime database :
update-mime-database ~/.local/share/mime/ sudo update-mime
-
clear thumbnails cache :
rm -rf ~/.cache/thumbnails/*
-
refresh (F5 or crtl-r) Nautilus showing a folder containing some stl files
Now the STL thumbnails should show-up. If not, you can try:
-
close Nautilus :
killall nautilus
-
and start it again
-
in last hope, you can try to log out and login to the desktop
If you looking for an preview generated from .scad files you could check OpenSCAD Thumbnailer for Gnome but computing power required for rendering more complicated scad model could be prohibitive to use this approach.