From 10e98e71af98eaf686d69f42ff4b9f4ed216f216 Mon Sep 17 00:00:00 2001 From: lara Date: Sat, 1 Oct 2022 12:10:55 +0200 Subject: [PATCH] [mailcap] Add support for opening office documents --- mailcap | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/mailcap b/mailcap index 07d5d74..cb81afa 100644 --- a/mailcap +++ b/mailcap @@ -1,3 +1,40 @@ text/html; unshare -n -r w3m -I %{charset} -T text/html; copiousoutput; image/*; mutt_bgrun /usr/bin/feh -. %s; test=test -n "$DISPLAY" application/pdf; mutt_bgrun /usr/bin/zathura %s; test=test -n "$DISPLAY" + +# Fichiers LibreOffice, Word, Excel et PowerPoint +application/vnd.openxmlformats-officedocument.wordprocessingml.document; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/vnd.openxmlformats-officedocument.wordprocessingml.template; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/vnd.openxmlformats-officedocument.spreadsheetml.template; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/vnd.openxmlformats-officedocument.presentationml.presentation; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" + +application/msword; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/vnd.msword; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" + +application/excel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/msexcel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/x-excel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/x-msexcel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/vnd.ms-excel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/ms-Excel; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" + +application/vnd.ms-powerpoint; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/x-mspowerpoint; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" +application/ppt; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" + +application/rtf; mutt_bgrun libreoffice --nologo '%s'; test=test -n "$DISPLAY" + +# # MS documents to txt +# application/msword; tika -t %s | less; +# application/vnd.msword; tika -t %s | less; +# application/excel; tika %s | less; +# application/msexcel; tika %s | less; +# application/x-excel; tika %s | less; +# application/x-msexcel; tika %s | less; +# application/vnd.ms-excel; tika %s | less; +# application/ms-Excel; tika %s | less; +# application/vnd.ms-powerpoint; tika %s | w3m -dump -T text/html | less; +# application/x-mspowerpoint; tika %s | w3m -dump -T text/html | less; +# application/ppt; tika %s | w3m -dump -T text/html | less; +# application/rtf; tika %s | w3m -dump -T text/html | less;