How can I disable preview for documents and use default LibreOffice icons for documents?

Switched from KDE yesterday for the first time in years. So far I enjoy the experience but I need to change many habits :stuck_out_tongue:

Is there a way to show file previews based on extension/mime type? I would like to have image preview but not document preview (odt, ods, pdf) as it confuses me when I browse a directory filled with documents (I find the previews to be distracting).

I also would like to use the new LibreOffice icons for odt and ods files instead of the default adwaita, any easy way to do this? :slight_smile:

Regards,
Racoon

There is no easy way.

If you have root access and are prepared to “void your warranty”, you can remove the /usr/share/thumbnailers/gsf-office.thumbnailer file or equivalent.

For icons, you need to find where the default icons are installed and replace them. Or make your own icon theme.

I don’t recommend any of the above, unless you know what you are doing and are prepared to fix your system when an update conflicts with your changes.

Yeah no worries, thanks for the tips, it helped a lot!
I made a very naive bash script I can run on new install to change some file extensions I most likely will use. I know KDE show the icon based on which app is going to open it, and it might get distracting. But I prefer having LO icons for popular extensions and the generic one for the extensions I use less often, it won’t be a big deal.

## as root
sudo su -

## Disable preview for LibreOffice files
## Thx https://discourse.gnome.org/u/antoniof
mv /usr/share/thumbnailers/gsf-office.thumbnailer /usr/share/thumbnailers/gsf-office.thumbnailer.bak

## Tip: Find filetypes from extension:
## grep 'odt' /etc/mime.types

## Copy LibreOffice official icons to adwaita theme


## odt, doc, docx  docm
MIME_WRITER=("application-vnd.oasis.opendocument.text" "application-vnd.openxmlformats-officedocument.wordprocessingml.document" "application-msword" "application-vnd.ms-word.document.macroEnabled.12")

## ods, xml, xmlx xmlm
MIME_CALC=("application-vnd.oasis.opendocument.spreadsheet" "application-vnd.openxmlformats-officedocument.spreadsheetml.sheet" "application-msexcel" "application-vnd.ms-excel.sheet.macroEnabled.12")

## odp, ppt, pptx, pptm
MIME_PRES=("application-vnd.oasis.opendocument.presentation" "application-vnd.ms-powerpoint" "application-vnd.ms-powerpoint.presentation.macroEnabled.12" "application-vnd.openxmlformats-officedocument.presentationml.presentation" "application-vnd.ms-powerpoint.presentation.macroEnabled.12")

for MIMEPATH in ${MIME_WRITER[@]}; do
	\cp -f "/usr/share/icons/hicolor/scalable/apps/libreoffice7.6-writer.svg" "/usr/share/icons/Adwaita/scalable/mimetypes/${MIMEPATH}.svg"
done
for MIMEPATH in ${MIME_CALC[@]}; do
	\cp -f /usr/share/icons/hicolor/scalable/apps/libreoffice7.6-calc.svg "/usr/share/icons/Adwaita/scalable/mimetypes/${MIMEPATH}.svg"
done
for MIMEPATH in ${MIME_PRES[@]}; do
	\cp -f /usr/share/icons/hicolor/scalable/apps/libreoffice7.6-impress.svg "/usr/share/icons/Adwaita/scalable/mimetypes/${MIMEPATH}.svg"
done

## LibreOffice Base - odb
cp /usr/share/icons/hicolor/scalable/apps/libreoffice7.6-base.svg /usr/share/icons/Adwaita/scalable/mimetypes/application-vnd.sun.xml.base.svg

## LibreOffice Math - odf (Formula)
cp /usr/share/icons/hicolor/scalable/apps/libreoffice7.6-math.svg /usr/share/icons/Adwaita/scalable/mimetypes/application-vnd.oasis.opendocument.formula.svg

## LibreOffice Draw - odg
cp /usr/share/icons/hicolor/scalable/apps/libreoffice7.6-draw.svg /usr/share/icons/Adwaita/scalable/mimetypes/application-vnd.oasis.opendocument.graphics.svg

## Reset cache
gtk-update-icon-cache /usr/share/icons/Adwaita

## Exit root
exit

Maybe I should symlink the icons instead, I guess I’ll try later… :person_shrugging:

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.