]> git.phdru.name Git - dotfiles.git/commitdiff
Feat(.mc): Add commands to view/edit XLSX files
authorOleg Broytman <phd@phdru.name>
Fri, 5 Jun 2020 13:52:58 +0000 (16:52 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 5 Jun 2020 13:52:58 +0000 (16:52 +0300)
.mc/mc.ext
.mc/menu

index 2efbc07bb46b4d66bd89a617368333275b286d86..8ccf478683865c08504f6ced582392863dfc147c 100644 (file)
@@ -550,7 +550,7 @@ shell/.abw
 regex/\.([xX][lL][sSwW])$
        Open=(gnumeric %f >/dev/null 2>&1 &)
        View=%view{ascii} xls2csv %f || strings %f
-type/^Microsoft\ Excel
+type/^Microsoft\ Excel$
        Open=(gnumeric %f >/dev/null 2>&1 &)
        View=%view{ascii} xls2csv %f || strings %f
 
@@ -728,6 +728,12 @@ type/^Microsoft\ Word
 type/^Microsoft\ Office\ Document
    Include=msoffice-doc
 
+regex/\.([xX][lL][sS][xX])$
+   Include=msoffice-xlsx
+
+type/^Microsoft\ Excel 2007+
+   Include=msoffice-xlsx
+
 type/^Composite\ Document\ File
    Include=msoffice-doc
 
@@ -782,6 +788,11 @@ include/msoffice-doc
    Open=libreoffice %f &
    View=%view{ascii} catdoc %f
 
+include/msoffice-xlsx
+   Edit=libreoffice %f &
+   Open=libreoffice %f &
+   View=%view{ascii} xlsx2csv %f | iconv -f utf-8
+
 include/video
    Open=mplayer %f &
    View=%view{ascii} %f
index d33756212cd99869d11dd288889378b8d866c745..6179a675e81138f9c53260def2b11701278e0736 100644 (file)
--- a/.mc/menu
+++ b/.mc/menu
@@ -90,6 +90,9 @@ o  View OpenDoc with odt2txt
 d  View docx with docx2txt
    docx2txt %f - | iconv.py -f utf-8 | ${PAGER:-more}
 
++= t lr & f \.(xls|XLS|xlsx|XLSX)$
+o  View OpenXlsx with xlsx2csv
+   xlsx2csv %f | iconv -f utf-8 | ${PAGER:-more}
 
 += t lr & f \.(xls|XLS)$
 x  View xls with xls2csv