Table of Contents

Description

A very basic implementation to run Uzbl from the CLI, opening local files.

I use it mostly for MAFF-archived pages.

Source

#!/bin/sh
# uzbl direct-launch from commandline wrapper
# requires 7-zip
# license: GPLv3

UZBL="uzbl-browser -u"
dir=$PWD
file="$1"
mypid=$$

## check args
if [ $# -ne 1 ]; then
    echo "Usage: `basename $0` <filename>"
    exit 1
fi
if [ ! -f "$file" ]; then
    echo "Cannot access file: $file"
    exit 2
fi


## for maff files
if echo "$file" | grep -E '.*\.maff' >/dev/null; then
    dir=/tmp/maff-$mypid
    7z -o${dir} x $file || exit 4

    subdir=`7z l $file | grep -oE "[0-9]*_[0-9]*$"`
    dir=$dir/$subdir
    file=index.html
fi

cd $dir
$UZBL $file

Installation

Put in a directory contaned in your shell's $PATH.

 
uzbl.txt · Last modified: 2010/05/12 20:42 by grimp3ur
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki