Here's the documentation on how to add a new thumbnailer.
You need to add two keys on gconf:
- /desktop/gnome/thumbnailers/application@x-foo/enable (boolean)
- /desktop/gnome/thumbnailers/application@x-foo/command (string)
Where application@x-foo
is the MimeType for the kind of file you want to generate the thumbnails. Set enable
to True and command
to the command to create the thumbnail.
To add one with gconftool-2:
gconftool-2 --set /desktop/gnome/thumbnailers/application@x-foo/enable --type bool true
gconftool-2 --set /desktop/gnome/thumbnailers/application@x-foo/command --type string "application-x-foo-thumbnailer %i %o %s"
The folders are created automatically. %i
is the input file, %o
where to write the output file (png) and %s
the size of the thumbnail.
And here's how to add a MimeType for custom files.
I found another way which seems easier, you can create a file in /usr/share/thumbnailers/
for example foo.thumbnailer:
[Thumbnailer Entry]
TryExec=/usr/bin/application-x-foo-thumbnailer
Exec=/usr/bin/application-x-foo-thumbnailer %i %o %s
MimeType=application/x-foo;
You can separate several MimeTypes with ;
.
Best Answer
Using Imagemagick to create text icons
Based on the same principle as here, the script below creates a text icon from a text file with the help of Imagemagick.
The color of the rounded background image and the text color can be set in the head of a script (as well as a number of other properties).
What it does
It reads the textfile, takes th first four lines (set in
n_lines = 4
), the first seven characters (set inn_chars = 10
) of each line, and creates an overlay over an image of the size, set in e.g.psize = "100x100"
.How to use
The script needs
imagemagick
to be installed:Then:
create_texticon.py
set in the head section:
Run it with your textfile as an argument:
The script