Description:

This script allows you to reopen closed tabs (90% copied from the original undo script).

Undo script:

#!/bin/sh
UNDO="/tmp/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

Exit script:

#!/bin/bash
UNDO="/tmp/uzbl_undolist"
if [ -e $UNDO ]; then
    URL=`tail -n 1 $UNDO`
    LINECOUNT=`cat $UNDO | wc -l`
    if [[ $LINECOUNT == 1 ]]; then
        rm $UNDO
    else
        sed -i '$d' $UNDO
    fi
  echo "event NEW_TAB $URL" | socat - unix-connect:$5
fi

Usage:

Save the two scripts in your uzbl script dir and chmod +x them. Then add the following line to your uzbl config file:

@cbind  b               = spawn @scripts_dir/undo_exit.sh

And replace your tab close command with:

@cbind  gc              = chain 'spawn @scripts_dir/undolist.sh' 'exit'
 
undo_tabbed.txt · Last modified: 2010/06/28 00:00 by isilia
 
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