From d9c1fbf27bcaa62acd0df7107254aa1652700ba9 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Fri, 1 May 2009 20:30:53 +0200 Subject: smarter history picking. first entry == current url --- examples/scripts/load_url_from_history.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/scripts/load_url_from_history.sh b/examples/scripts/load_url_from_history.sh index 81a220a..3e2e2ee 100755 --- a/examples/scripts/load_url_from_history.sh +++ b/examples/scripts/load_url_from_history.sh @@ -2,6 +2,10 @@ # you probably really want this in your $XDG_DATA_HOME (eg $HOME/.local/share/uzbl/history) history_file=/tmp/uzbl.history -goto=`awk '{print $3}' $history_file | sort | uniq | dmenu -i` +# choose from all entries, sorted and uniqued +# goto=`awk '{print $3}' $history_file | sort -u | dmenu -i` + +# choose from all entries, the first one being current url, and after that all others, sorted and uniqued. +current=`tail -n 1 $history_file | awk '{print $3}'`; goto=`(echo $current; awk '{print $3}' $history_file | grep -v "^$current\$" | sort -u) | dmenu -i` #[ -n "$goto" ] && echo "uri $goto" > $4 [ -n "$goto" ] && uzblctrl -s $5 -c "uri $goto" -- cgit v1.2.3