From 6b2a973e17a0cf4d3cdc88e71973624929018c78 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 11 Mar 2011 20:45:32 -0500 Subject: Allow the variable for follow.sh to be changed --- examples/config/config | 2 +- examples/data/scripts/follow.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/config/config b/examples/config/config index a2ecdb8..b5421da 100644 --- a/examples/config/config +++ b/examples/config/config @@ -309,7 +309,7 @@ set follow_hint_keys = 0123456789 #set follow_hint_keys = qwerty #set follow_hint_keys = asdfghjkl; #set follow_hint_keys = thsnd-rcgmvwb/;789aefijkopquxyz234 -@cbind fl* = spawn @scripts_dir/follow.sh "%s" +@cbind fl* = spawn @scripts_dir/follow.sh follow_hint_keys "%s" @cbind gi = spawn @scripts_dir/go_input.sh # Form filler binds diff --git a/examples/data/scripts/follow.sh b/examples/data/scripts/follow.sh index 4edab36..6401188 100755 --- a/examples/data/scripts/follow.sh +++ b/examples/data/scripts/follow.sh @@ -5,17 +5,20 @@ . "$UZBL_UTIL_DIR/uzbl-util.sh" +key_variable="$1" +shift + keys="$1" shift # if socat is installed then we can change Uzbl's input mode once a link is # selected; otherwise we just select a link. if ! which socat >/dev/null 2>&1; then - print "script @scripts_dir/follow.js \"@{follow_hint_keys} $keys\"\n" > "$UZBL_FIFO" + print "script @scripts_dir/follow.js \"@{$key_variable} $keys\"\n" > "$UZBL_FIFO" exit 0 fi -result="$( print "script @scripts_dir/follow.js \"@{follow_hint_keys} $keys\"\n" | socat - "unix-connect:$UZBL_SOCKET" )" +result="$( print "script @scripts_dir/follow.js \"@{$key_variable} $keys\"\n" | socat - "unix-connect:$UZBL_SOCKET" )" case $result in *XXXEMIT_FORM_ACTIVEXXX*) # a form element was selected -- cgit v1.2.3