![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Tutorials & Tips The place to find Ubuntu related Tips & Tricks. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Just Give Me the Beans!
![]() Join Date: Nov 2004
Location: Prague, Czech Republic
Beans: 71
|
HOWTO: Thumbnails for OpenOffice.org 2 files
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 Code:
sudo gedit /usr/bin/ooo2-thumbnailer 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 Code:
sudo chmod +x /usr/bin/ooo2-thumbnailer Code:
sudo gedit /usr/share/gconf/schemas/ooo2.schemas 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: Code:
gconftool-2 --install-schema-file /usr/share/gconf/schemas/ooo2.schemas Code:
killall -9 nautilus Last edited by minio; March 19th, 2009 at 03:15 PM.. |
|
|
|
|
|
#2 |
|
Dipped in Ubuntu
![]() |
Re: HOWTO: Thumbnails for OpenOffice.org 2 files
Awesome howto, works perfectly! Anyone know if there's a quick/easy way to add a small icon or watermark over the thumbnail?
|
|
|
|
|
|
#3 |
|
A Carafe of Ubuntu
![]() Join Date: Aug 2005
Beans: 132
|
Re: HOWTO: Thumbnails for OpenOffice.org 2 files
Could someone provide a screenshot to show the finished product?
|
|
|
|
|
|
#4 | |
|
A Carafe of Ubuntu
![]() Join Date: Feb 2005
Location: Chile
Beans: 104
|
Re: HOWTO: Thumbnails for OpenOffice.org 2 files
Quote:
If you decide to try out the thumbnails and don't like the results afterwards, you can roll back by deleting the two files: Code:
sudo rm /usr/bin/ooo2-thumbnailer sudo rm /usr/share/gconf/schemas/ooo2.schemas Btw, thank you minio for the how-to . The only downside I notice is that Ooo2 generates thumbnails with transparent backgrounds, so they don't look that good if you have set a background in nautilus.Last edited by NeTo; October 16th, 2005 at 01:59 AM.. |
|
|
|
|
|
|
#5 |
|
Spilled the Beans
![]() Join Date: Apr 2005
Location: France
Beans: 9
The Feisty Fawn Testing
|
Re: HOWTO: Thumbnails for OpenOffice.org 2 files
Excellent
Thanks. |
|
|
|
|
|
#6 |
|
A Carafe of Ubuntu
![]() Join Date: Jul 2005
Location: Grimstad, Norway
Beans: 74
Ubuntu 6.10 Edgy
|
Re: HOWTO: Thumbnails for OpenOffice.org 2 files
I have followed the instructions perfectly, and I still can't get this to work. Every file is in the right place with the right owner and permissions. Does anyone have a hint?
|
|
|
|
|
|
#7 |
|
Just Give Me the Beans!
![]() Join Date: Nov 2004
Location: Prague, Czech Republic
Beans: 71
|
Re: HOWTO: Thumbnails for OpenOffice.org 2 files
One of following steps should help
1) open gconf-editor and go to desktop->gnome->thumbnailers check if there ar e folders like "application@vnd.oasis.opendocument.graphics","app lication@vnd.sun.xml.impress" and similar. then check if key "command" in these folders contains correct path to thumbnailer (it should be /usr/bin/ooo2-thumbnailer %u %o) and if is enable checked. 2)try to delete entire ~/.thumbnails/fail directory and restart nautilus 3)check if those files you want to be thumbnailed were created with OOo2. 4)open one file with file-roller and look if there is Thumbnails directory some older betas of OOo2 used Thumbnail directory instead |
|
|
|
|
|
#8 |
|
A Carafe of Ubuntu
![]() Join Date: Jul 2005
Location: Grimstad, Norway
Beans: 74
Ubuntu 6.10 Edgy
|
Re: HOWTO: Thumbnails for OpenOffice.org 2 files
found the mistake. I executed this command:
Code:
gconftool-2 --install-schema-file /usr/share/gconf/schemas/ooo2.schemas |
|
|
|
|
|
#9 |
|
Quad Shot of Ubuntu
![]() |
Re: HOWTO: Thumbnails for OpenOffice.org 2 files
SCHWEET! Works great - any chance this can be incorporated into dapper with an option to turn it off sumwhere? Its definatly an improvement and I can't see how a load of open office file logos are any better in any way except maybe that they tell you what file format it is in. Maybe if you could get a little overlay on each if it is possible (I doubt its easy if I understand how you are doing it correctly)
Brilliant anyway...
__________________
Regards, Haegin If all else fails curl up in bed with a good book. "<mc44> rob: every time you don’t read the topic, god kills a lolcat" |
|
|
|
|
|
#10 |
|
Way Too Much Ubuntu
![]() |
Re: HOWTO: Thumbnails for OpenOffice.org 2 files
Nice one!
I am very picky, but try this: Using the GNOME Templates system in Nautilus, put an empty OpenOffice document (a template) in the /home/user/Templates folder, right-click on your desktop and look inside your "Create Document" menu. The icon for the document will now reflect the empty document, resulting in the icon of a "blank sheet". I suppose it can be fixed in some way. |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|