aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-05-01 20:30:53 +0200
committerGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-05-01 20:30:53 +0200
commitd9c1fbf27bcaa62acd0df7107254aa1652700ba9 (patch)
tree8a54302b3f83a395f7c1c6410e8f8950686bafa5 /examples
parent565e598c0e692283faeece6db596f9e12c55df56 (diff)
smarter history picking. first entry == current url
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/scripts/load_url_from_history.sh6
1 files changed, 5 insertions, 1 deletions
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"