[Dillo-dev] wrapper script to allow reading *.maff

2 views
Skip to first unread message

Plmalternate Plmalternate

unread,
Sep 9, 2015, 5:48:08 AM9/9/15
to dill...@dillo.org
Some of y'all might find this useful. If you put it in your path, you
can invoke it "dill filename" or make it the default ap for maffs or
regular htm(l)s for that matter. It lets Dillo read the Mozilla
Archive File Format (*.maff) files. Maffs are pretty nice - if you
haven't played with them you might like to try it. Here is the body of
the file if you find that more convenient than the attachment:

#!/bin/bash

# if the argument ends in ".maff"
if [ "$(echo "$1" | rev | cut -c1-5 | rev)" = ".maff" ]; then
DIR="/tmp/dillo_maff_unzpped/$(date +%s%N)"
mkdir -p "$DIR"
unzip "$1" -d "$DIR"
SUBDIR="$(ls "$DIR")"
dillo "$DIR/$SUBDIR/index.html" || dillo "$DIR/$SUBDIR/index.htm"
rm -r "$DIR"
else
dillo "$1"
fi
dill
Reply all
Reply to author
Forward
0 new messages