From 9e2be65d68aac7eaca0629c1d2567570e8868027 Mon Sep 17 00:00:00 2001 From: Nikita Ivanov Date: Thu, 28 Jul 2022 03:02:07 +0500 Subject: [PATCH] Add more document formats --- previews.h | 12 +++++++++++- sh/prev/{odt.sh => libreoffice.sh} | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) rename sh/prev/{odt.sh => libreoffice.sh} (77%) diff --git a/previews.h b/previews.h index a280f20..79d3cb9 100644 --- a/previews.h +++ b/previews.h @@ -17,7 +17,17 @@ Preview b_previews[] = { PR("md", NULL, NULL, mdcat, PREV_ATTR_NONE), PR("torrent", NULL, NULL, torrent, PREV_ATTR_NONE), - PR("odt", NULL, NULL, odt, PREV_ATTR_NONE), + + PR("ods", NULL, NULL, libreoffice, PREV_ATTR_NONE), + PR("fods", NULL, NULL, libreoffice, PREV_ATTR_NONE), + PR("xls", NULL, NULL, libreoffice, PREV_ATTR_NONE), + PR("xlsx", NULL, NULL, libreoffice, PREV_ATTR_NONE), + PR("csv", NULL, NULL, libreoffice, PREV_ATTR_NONE), + + PR("odt", NULL, NULL, libreoffice, PREV_ATTR_NONE), + PR("fodt", NULL, NULL, libreoffice, PREV_ATTR_NONE), + PR("doc", NULL, NULL, libreoffice, PREV_ATTR_NONE), + PR("docx", NULL, NULL, libreoffice, PREV_ATTR_NONE), PR(NULL, "text", NULL, bat, PREV_ATTR_NONE), PR(NULL, "text", NULL, highlight, PREV_ATTR_NONE), diff --git a/sh/prev/odt.sh b/sh/prev/libreoffice.sh similarity index 77% rename from sh/prev/odt.sh rename to sh/prev/libreoffice.sh index ea23722..02c13a4 100644 --- a/sh/prev/odt.sh +++ b/sh/prev/libreoffice.sh @@ -1,6 +1,6 @@ -# odt: libreoffice +# office: libreoffice -office() { +libreoffice() { # File produced by libreoffice jpg="$(printf '%s\n' "$f" | sed 's|^.*/||; s|\..*$||')" @@ -12,4 +12,4 @@ office() { mv -- "$cache_d/$jpg.jpg" "$cache_f" } -convert_and_show_image office +convert_and_show_image libreoffice