Delete Gnome Thumbnails on Shutdown

Gnome saves thumbnails for most document types.  This process can speed up subsequent viewing of files, but it can also be problematic:

  1. The number of files is not limited (this can be addressed with gnome-tweak) nor is the overall space occupied by thumbnails.
  2. Thumbnails leave a trail of what you have been downloading or looking at (cough porn cough).

So I put together this really simple script to delete all of my thumbnails at shutdown (replace USERNAME with your username):

#!/bin/sh
#Delete all USERNAME thumbnails when shutting down
rm -rf /home/USERNAME/.thumbnails/normal/*
rm -rf /home/USERNAME/.thumbnails/fail/gnome-thumbnail-factory/*

Place this script in the /etc/init.d/ directory and make sure that it is executable by root by issuing chmod 755.  Then, create symbolic links to the correct run levels (0 and 6):

sudo ln -s /etc/init.d/delete-USERNAME-thumbs /etc/rc0.d/K10delete-USERNAME-thumbs

sudo ln -s /etc/init.d/delete-USERNAME-thumbs /etc/rc6.d/K10delete-USERNAME-thumbs

This entry was posted in Software and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>