diff options
author | Brendan Taylor <whateley@gmail.com> | 2011-03-13 21:17:43 -0600 |
---|---|---|
committer | Brendan Taylor <whateley@gmail.com> | 2011-03-13 21:17:43 -0600 |
commit | 5ec505fdb007d22bcfb5631e88e67038b06d778a (patch) | |
tree | 9b467f9fce2266114bcfe12cf7c1db0596b1f50b /examples/data/scripts/follow.sh | |
parent | 6b2a973e17a0cf4d3cdc88e71973624929018c78 (diff) | |
parent | 0d9073aa31d7592ae3e7b321ac71c4b480750e08 (diff) |
Merge branch 'experimental' into dev/fix-shell-scripts
Conflicts:
examples/config/config
examples/data/scripts/follow.sh
examples/data/scripts/formfiller.sh
Diffstat (limited to 'examples/data/scripts/follow.sh')
-rwxr-xr-x | examples/data/scripts/follow.sh | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/examples/data/scripts/follow.sh b/examples/data/scripts/follow.sh index 6401188..014793e 100755 --- a/examples/data/scripts/follow.sh +++ b/examples/data/scripts/follow.sh @@ -1,31 +1,13 @@ #!/bin/sh +# This scripts acts on the return value of followLinks in follow.js -# This script is just a wrapper around follow.js that lets us change uzbl's mode -# after a link is selected. - -. "$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 \"@{$key_variable} $keys\"\n" > "$UZBL_FIFO" - exit 0 -fi - -result="$( print "script @scripts_dir/follow.js \"@{$key_variable} $keys\"\n" | socat - "unix-connect:$UZBL_SOCKET" )" -case $result in - *XXXEMIT_FORM_ACTIVEXXX*) +case "$1" in + XXXEMIT_FORM_ACTIVEXXX) # a form element was selected - print "event FORM_ACTIVE\n" > "$UZBL_FIFO" + printf 'event FORM_ACTIVE\nevent KEYCMD_CLEAR\n' > "$UZBL_FIFO" ;; - *XXXRESET_MODEXXX*) + XXXRESET_MODEXXX) # a link was selected, reset uzbl's input mode - print "set mode=\n" > "$UZBL_FIFO" + printf 'set mode=\nevent KEYCMD_CLEAR\n' > "$UZBL_FIFO" ;; esac |