nemo: thumbnails for Libreoffice

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ichthus

nemo: thumbnails for Libreoffice

Post by ichthus »

I am running Cinnamon Mint 16
Can I enable thumbnails to show in Nemo for Libreoffice documents as I could in Nautilus under ubuntu?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
ichthus

Re: nemo: thumbnails for Libreoffice

Post by ichthus »

I am running Cinnamon Mint 17 on a number of machines.

I also need to enable thumbnails to show in Nemo for Libreoffice documents.
GIMP .xcf do not preview either.

I have installed nautilus and the ooo-thumbnailer does not work there either.
Any ideas anyone?
alexdd

Thumbnails for Libreoffice

Post by alexdd »

same problem here: I need thumbnails for my libreoffice files.

nemo has no support.
nautilus and ooo-thumbnailer doesn't work.

what can I do?
ichthus

Re: nemo: thumbnails for Libreoffice

Post by ichthus »

I followed
http://bernaerts.dyndns.org/linux/76-gn ... l-nautilus

but found that it cropped landscape thumbnails making it useless for presentations.
So I edited the script: /usr/local/sbin/lo-thumbnailer
However, for me it works

So, you need a file: /usr/local/sbin/lo-thumbnailer
Mine is as follows.

Code: Select all

#!/bin/sh
# ---------------------------------------------------
# Thumbnailer for
# LibreOffice & OpenOffice documents
#
# Procedure :
#   http://bernaerts.dyndns.org/linux/76-gnome/285-gnome-shell-generate-libreoffice-thumbnail-nautilus
# Depends on :
#   * unzip
#   * imagemagick
#   * gvfs
# Parameters :
#   $1 - URI of office file
#   $2 - full path of generated thumbnail
#   $3 - height of thumbnail in pixels
# Revision history :
# 04/08/2013, V1.0 - Creation by N. Bernaerts
# 15/11/2014, V2.0 - Use URI to handle network shares
# 22/05/2015, DJL simplify
# ---------------------------------------------------

# path where to get icons used for generation
ICONPATH="/usr/local/sbin/lo-thumbnailer-icons"


# get parameters
FILE_URI=$1
FILE_THUMB=$2
HEIGHT=$3

# get filename extension
FILE_EXT=$(echo "$FILE_URI" | sed 's/^.*\.\(.*\)/\1/')

# generate temporary local filename
TMP_FILE=$(mktemp -t XXXXXXXX.${FILE_EXT})

# copy input file to temporary local file
gvfs-copy "${FILE_URI}" "${TMP_FILE}"

# Just create a straight thumbnail HeightxHeight max
unzip -p "${TMP_FILE}" Thumbnails/thumbnail.png | convert - -resize x${HEIGHT} "${FILE_THUMB}"

# remove temporary local file
rm ${TMP_FILE} 
Then you need this file to tell your file-manager that this file deals with opendocument files.

/usr/share/thumbnailers/lo.thumbnailer
Mine is not changed from the link above:

Code: Select all

[Thumbnailer Entry]
TryExec=/usr/local/sbin/lo-thumbnailer
Exec=/usr/local/sbin/lo-thumbnailer %u %o %s
MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.graphics;application/vnd.oasis.opendocument.graphics-template;application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.presentation-template;application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.spreadsheet-template; 
I used gedit to edit these files:-
sudo gedit /usr/share/thumbnailers/lo.thumbnailer
and
sudo gedit /usr/local/sbin/lo-thumbnailer

Then you need to purge your thumbnails to allow them to re-generate.
In a terminal

Code: Select all

rm -r $HOME/.cache/thumbnails
nautilus -q
This works with Nautilus, Nemo, and Marlin
(and I suppose any gnome file manager that uses the gnome default thumbnailing process)
alexdd

Re: nemo: thumbnails for Libreoffice

Post by alexdd »

Hello,

is there an easier way now to get odt previews in nemo?

Thanks!
ichthus

Re: nemo: thumbnails for Libreoffice

Post by ichthus »

Try ooo-thumbnailer from the Software Manager - I think this was fixed in Mint 19.
IMHO it should be included as standard
alexdd

Re: nemo: thumbnails for Libreoffice

Post by alexdd »

Hey,
I'm on Linux Mint 19.1 Cinnamon. No luck in getting thumbnails for OpenDocument format yet:

ooo-thumbnailer does not work
tumbler-plugins-extra does not work
libgsf does not work

I am so frustrated. It's 2019. We are putting cars in space for fun, but getting thumbnails for my office files? Nope. PLEASE HELP.

This is also one of the reasons I cannot recommend Linux Mint to Windows users -- thumbnails is something a regular user just expects.
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: nemo: thumbnails for Libreoffice

Post by smurphos »

This works for Cinnamon / Nemo in 19.x. Run commands as given in the terminal....

Code: Select all

apt install ooo-thumbnailer

Code: Select all

sudo tee /usr/share/thumbnailers/ooo.thumbnailer <<'EOB'
[Thumbnailer Entry]

TryExec=ooo-thumbnailer
Exec=/usr/bin/ooo-thumbnailer %i %o %s
MimeType=application/vnd.oasis.opendocument.graphics;application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.text;
EOB

Code: Select all

nemo -q
Result
Image
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
Locked

Return to “Software & Applications”