This also works for OOo1 files created or altered with OOo2. Beacuse OOo2 saves thumbnail of document into created file all what is needed is to extract the image a save it with right name
So first create file named ooo2-thumbnailer in /usr/bin
and put in it following codeCode:sudo gedit /usr/bin/ooo2-thumbnailer
and save the file.Code:#!/usr/bin/python # released into the public domain http://creativecommons.org/licenses/publicdomain import zipfile import sys import gnomevfs inURL=gnomevfs.get_local_path_from_uri(sys.argv[1]) outURL=sys.argv[2] zip=zipfile.ZipFile(inURL,mode="r") picture=zip.read("Thumbnails/thumbnail.png") thumbnail=open(outURL,"w") thumbnail.write(picture) thumbnail.write("/n") zip.close() thumbnail.close()
Now we need to make it executable
The next step is to tell Gnome how to use this thumbnailer. So create file ooo2.schemas in /usr/share/gconf/schemasCode:sudo chmod +x /usr/bin/ooo2-thumbnailer
and paste in it following codeCode:sudo gedit /usr/share/gconf/schemas/ooo2.schemas
and save it.Code:<gconfschemafile> <schemalist> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.text/enable</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.text/enable</applyto> <owner>ooo2-thumb</owner> <type>bool</type> <default>true</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.text/command</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.text/command</applyto> <owner>ooo2-thumb</owner> <type>string</type> <default>/usr/bin/ooo2-thumbnailer %u %o</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.spreadsheet/enable</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.spreadsheet/enable</applyto> <owner>ooo2-thumb</owner> <type>bool</type> <default>true</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.spreadsheet/command</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.spreadsheet/command</applyto> <owner>ooo2-thumb</owner> <type>string</type> <default>/usr/bin/ooo2-thumbnailer %u %o</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.graphics/enable</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.graphics/enable</applyto> <owner>ooo2-thumb</owner> <type>bool</type> <default>true</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.graphics/command</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.graphics/command</applyto> <owner>ooo2-thumb</owner> <type>string</type> <default>/usr/bin/ooo2-thumbnailer %u %o</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.formula/enable</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.formula/enable</applyto> <owner>ooo2-thumb</owner> <type>bool</type> <default>true</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.formula/command</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.formula/command</applyto> <owner>ooo2-thumb</owner> <type>string</type> <default>/usr/bin/ooo2-thumbnailer %u %o</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.presentation/enable</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.presentation/enable</applyto> <owner>ooo2-thumb</owner> <type>bool</type> <default>true</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.presentation/command</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.oasis.opendocument.presentation/command</applyto> <owner>ooo2-thumb</owner> <type>string</type> <default>/usr/bin/ooo2-thumbnailer %u %o</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.sun.xml.writer/enable</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.sun.xml.writer/enable</applyto> <owner>ooo2-thumb</owner> <type>bool</type> <default>true</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.sun.xml.writer/command</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.sun.xml.writer/command</applyto> <owner>ooo2-thumb</owner> <type>string</type> <default>/usr/bin/ooo2-thumbnailer %u %o</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.sun.xml.calc/enable</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.sun.xml.calc/enable</applyto> <owner>ooo2-thumb</owner> <type>bool</type> <default>true</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.sun.xml.calc/command</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.sun.xml.calc/command</applyto> <owner>ooo2-thumb</owner> <type>string</type> <default>/usr/bin/ooo2-thumbnailer %u %o</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.sun.xml.draw/enable</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.sun.xml.draw/enable</applyto> <owner>ooo2-thumb</owner> <type>bool</type> <default>true</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.sun.xml.draw/command</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.sun.xml.draw/command</applyto> <owner>ooo2-thumb</owner> <type>string</type> <default>/usr/bin/ooo2-thumbnailer %u %o</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.sun.xml.math/enable</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.sun.xml.math/enable</applyto> <owner>ooo2-thumb</owner> <type>bool</type> <default>true</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.sun.xml.math/command</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.sun.xml.math/command</applyto> <owner>ooo2-thumb</owner> <type>string</type> <default>/usr/bin/ooo2-thumbnailer %u %o</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.sun.xml.impress/enable</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.sun.xml.impress/enable</applyto> <owner>ooo2-thumb</owner> <type>bool</type> <default>true</default> <locale name="C"> <short></short> <long></long> </locale> </schema> <schema> <key>/schemas/desktop/gnome/thumbnailers/application@vnd.sun.xml.impress/command</key> <applyto>/desktop/gnome/thumbnailers/application@vnd.sun.xml.impress/command</applyto> <owner>ooo2-thumb</owner> <type>string</type> <default>/usr/bin/ooo2-thumbnailer %u %o</default> <locale name="C"> <short></short> <long></long> </locale> </schema> </schemalist> </gconfschemafile>
Now there are two ways to start gnome to use this thumbnailer
1) reboot
2) tell gnome to read this file:
and restart nautilusCode:gconftool-2 --install-schema-file /usr/share/gconf/schemas/ooo2.schemas
Code:killall -9 nautilus
Bookmarks