Description:

This script allows you to open closed window.

Undo script

#!/bin/bash
UNDO="$XDG_DATA_HOME/uzbl/undolist"
UZBL=uzbl-browser
if [ -e $UNDO ]; then
    URL=`tail -n 1 $UNDO`
    LINECOUNT=`cat $UNDO | wc -l`
    if [[ $LINECOUNT == 1 ]]; then
        $UZBL -u "$URL" &
        rm $UNDO
    else
        $UZBL -u "$URL" &
        sed -i '$d' $UNDO
    fi
fi

Exit script

#!/bin/sh
UNDO="$XDG_DATA_HOME/uzbl/undolist"
if [ -e $UNDO ]; then
    LINECOUNT=`cat $UNDO | wc -l`
    if [ $LINECOUNT -ge 100 ]; then
        sed -i "1d" $UNDO
    fi
fi
echo "$6" >> $UNDO

Usage:

Save the above scripts and add binding to them, for example:

bind d  = chain 'spawn $XDG_CONFIG_HOME/uzbl/scripts/exit.sh' 'exit'
 
undo.txt · Last modified: 2010/02/10 13:01 by alparo
 
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