User Tools

Site Tools


undo_tabbed

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: 2016/08/31 14:10 (external edit)