tools/textviewer.sh
[claws.git] / tools / textviewer.sh
index 85d3800bcc8b16ab3ee72c0c9a0ee9738c9bf0f5..075c025128664b76b8cadf1e8d11631377c48b90 100644 (file)
 # Change Log
 #
 # 2004-01-05
+#      - added matcher and action for OpenOffice Writer documents
+#        (requires ooo2txt)
+#
+# 2004-01-05
 #      - changed page width parameter for antiword
 #      - fixed matcher for 'diffs'
 #      - added a matcher and action for bzip2 - bzip2 files
@@ -98,6 +102,7 @@ case "$1" in
        *.diff) TYPE=TEXT       ;;
        *.txt)  TYPE=TEXT       ;;
        *.rtf)  TYPE=RTF        ;;
+       *.sxw)  TYPE=OOWRITER   ;;
 esac
 
 if [ "$TYPE" == "" ]   
@@ -155,5 +160,12 @@ case $TYPE in
                };
                antiword -w 72 "$1"                             ;;
 
+       OOWRITER) which ooo2txt > /dev/null 2>&1 ||
+               {
+                       echo "Program 'ooo2txt' for converting OpenOffice Writer files not files not found" >&2
+                       exit 1
+               };
+               ooo2txt "$1"                                    ;;
+
        *)      echo "Unsupported file type \"$FILETYPE\", cannot display.";;
 esac