NikitaIvanovV / ctpv

Image previews for lf file manager
https://www.nikitaivanov.com/man1/ctpv
MIT License
264 stars 23 forks source link

Unable to preview office files using libreoffice #61

Open kd-koda opened 1 year ago

kd-koda commented 1 year ago

Sorry in advance. Maybe I missed something, but is this not supported? Using lf on macos. Libreoffice was installed with homebrew. I do have microsoft Office installed, but i manually set priority to libreoffice in the ctpv config file.

Lf just shows "binary" where preview should be. When I call ctpv in terminal (kitty) to one of these files (docx, pptx, xlsx) I get the following in the attached screenshot

Screen Shot 2023-06-22 at 10 20 54 AM

NikitaIvanovV commented 1 year ago

It looks like ctpv cannot find libreoffice and fallbacks to cat, which just spits out raw file bytes. Can you run libreoffice through command line? If you can, how do you do it?

VSuryaPrashanth commented 9 months ago

In MacOS there is no libreoffice when installed with brew, instead there is soffice. A work around for this is to simply link them with ln /opt/homebrew/bin/soffice /opt/homebrew/bin/libreoffice. But I think its batter to change libreoffice to soffice in ctpv.