]> git.phdru.name Git - dotfiles.git/blobdiff - .mc/mc.ext
.mc: `pdftotext`: Preserve layout
[dotfiles.git] / .mc / mc.ext
index 6a91d165067447bd2b240346e57d5d1374d96720..c032ee679ac6aa8d72c0b57e8d864d5ad7c48c9c 100644 (file)
@@ -406,7 +406,7 @@ shell/.xpm
 shell/.ico
        Include=image
 
-include/oldimage
+include/image
        Open=(see %f &)
        View=%view{ascii} identify %f
        #View=%view{ascii} asciiview %f
@@ -441,10 +441,10 @@ include/oldimage
 #regex/\.([wW][mM][aA])$
 #      Open=mplayer -vo null %f
 #      View=%view{ascii} mplayer -quiet -slave -frames 0 -vo null -ao null -identify %f 2>/dev/null | tail +13 || file %f
-
-
-### Play lists ###
-
+#
+#
+#### Play lists ###
+#
 #regex/\.([mM]3[uU]|[pP][lL][sS])$
 #      Open=if [ -z "$DISPLAY" ]; then mplayer -vo null -playlist %f; else (xmms -p %f >/dev/null 2>&1 &); fi
 
@@ -501,15 +501,16 @@ include/oldvideo
 
 # Postscript
 type/^PostScript
-       Open=(gv %f &)
+#      Open=(gv %f &)
        View=%view{ascii} ps2ascii %f
 
 # PDF
 type/^PDF
+        Edit=libreoffice %f &
        Open=(see %f &)
        #Open=(acroread %f &)
        #Open=(ghostview %f &)
-       View=%view{ascii} pdftotext %f -
+       View=%view{ascii} pdftotext -layout -q %f - | iconv.py -f utf-8
 
 # The following code very ugly and should not be taken as example.
 # It should be cleaned up when the new format of mc.ext is developed.
@@ -525,6 +526,7 @@ shell/.sdw
 
 # StarOffice 6 and OpenOffice.org formats
 regex/\.(odt|ott|sxw|stw|ods|ots|sxc|stc|odp|otp|sxi|sti|odg|otg|sxd|std|odb|odf|sxm|odm|sxg)$
+       Edit=(libreoffice %f &)
        Open=(libreoffice %f &)
        View=%view{ascii} odt2txt %f
 
@@ -533,14 +535,14 @@ shell/.abw
        Open=(abiword %f &)
 
 # Microsoft Word Document
-regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$
-       Open=(abiword %f >/dev/null 2>&1 &)
-       View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f
-type/^Microsoft\ Word
-       Open=(abiword %f >/dev/null 2>&1 &)
-       View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f
-
-# RTF document
+#regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$
+#      Open=(abiword %f >/dev/null 2>&1 &)
+#      View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f
+#type/^Microsoft\ Word
+#      Open=(abiword %f >/dev/null 2>&1 &)
+#      View=%view{ascii} antiword -t %f || catdoc -w %f || word2x -f text %f - || strings %f
+#
+## RTF document
 #regex/\.([rR][tT][fF])$
 #      Open=(abiword %f >/dev/null 2>&1 &)
 
@@ -548,13 +550,13 @@ type/^Microsoft\ Word
 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
 
 # Use OpenOffice.org to open any MS Office documents
-type/^Microsoft\ Office\ Document
-       Open=(libreoffice %f &)
+#type/^Microsoft\ Office\ Document
+#      Open=(libreoffice %f &)
 
 # Framemaker
 type/^FrameMaker
@@ -692,8 +694,7 @@ shell/.chm
 
 # DejaVu
 shell/.djvu
-   #Open=djview %f &
-   Open=evince %f &
+   Open=djview %f &
 
 # EPUB
 shell/.epub
@@ -704,11 +705,38 @@ shell/.fb2
    Open=fbreader %f &
    View=%view{ascii} xsltproc /usr/local/src/FictionBook/FB2_2_txt_ru.xsl %f
 
+type/^PostScript
+   Open=libreoffice %f &
+   View=%view{ascii} ps2ascii %f
+
 # RTF
 regex/\.([rR][tT][fF])$
    Open=fbreader %f &
    View=%view{ascii} catdoc %f
 
+regex/\.([Dd][oO][cCtT]|[Ww][rR][iI])$
+   Include=msoffice-doc
+
+regex/\.([Dd][oO][cC][Xx])$
+   Edit=libreoffice %f &
+   Open=libreoffice %f &
+   View=%view{ascii} docx2txt %f - | iconv.py -f utf-8
+
+type/^Microsoft\ Word
+   Include=msoffice-doc
+
+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
+
 # ftplist
 regex/\.ftplist$
    Open=%cd %p#ftplist
@@ -726,11 +754,6 @@ shell/.o
    View=%view{ascii} nm %f
    Disassemble=%view{ascii} objdump -d -r %f
 
-# Python eggs are zip archives
-shell/.egg
-   Open=%cd %p/uzip://
-   View=%view{ascii} unzip -v %f
-
 # Python
 shell/.py
    Open=python %f
@@ -747,19 +770,31 @@ shell/.torrent
 regex/\.([xX][mM][lL])$
    Include=xml
 
-type/^XML *(1\.0 *)?document text
+type/^XML *(1\.0 *)?document
    Include=xml
 
+regex/\.([Zz][Ii][Pp])$
+   Open=%cd %p/uzip://
+   View=%view{ascii} unzip -v %f
+
 include/audio
-   #Open=[ "`audtool --get-volume`" -eq 0 ] && (audacious & sleep 3); audtool --playlist-clear --playlist-addurl %f --playback-play
-   #Open=smplay %f &
-   Open=deadbeef %f &
-   #Open=mediaplayer_open %f
+   Open=[ "`audtool --get-volume`" -eq 0 ] && (audacious & sleep 3); audtool --playlist-clear --playlist-addurl %f --playback-play
+   #Open=mplayer %f &
+   #Open=deadbeef %f &
    View=%view{ascii} %f
 
+include/msoffice-doc
+   Edit=libreoffice %f &
+   Open=libreoffice %f &
+   View=%view{ascii} catdoc %f
+
+include/msoffice-xlsx
+   Edit=libreoffice %f &
+   Open=libreoffice %f &
+   View=%view{ascii} xlsx2csv %f | iconv.py -f utf-8
+
 include/video
-   Open=smplay %f &
-   #Open=mediaplayer_open %f
+   Open=mplayer %f &
    View=%view{ascii} %f
 
 include/xml