aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar keis <keijser@gmail.com>2011-02-26 23:56:45 +0100
committerGravatar keis <keijser@gmail.com>2011-02-27 00:00:01 +0100
commit1197e8ddbc8348e9437ada42b35c72f38d4698ce (patch)
treec0d8871679b041dc4d85b6b5f54e4df6ecf2effd /examples
parentd86a69f6a105f611e49ecb10d206933cfdd7f90a (diff)
update config and follow.sh to use new follow.js
Diffstat (limited to 'examples')
-rw-r--r--examples/config/config4
-rwxr-xr-xexamples/data/scripts/follow.sh20
2 files changed, 8 insertions, 16 deletions
diff --git a/examples/config/config b/examples/config/config
index ab690e0..5c00fb5 100644
--- a/examples/config/config
+++ b/examples/config/config
@@ -72,6 +72,7 @@ set download_handler = sync_spawn @scripts_dir/download.sh
# add some javascript to the page for other 'js' and 'script' commands to access later.
@on_event LOAD_COMMIT js uzbl = {};
@on_event LOAD_COMMIT script @scripts_dir/formfiller.js
+@on_event LOAD_COMMIT script @scripts_dir/follow.js
# Userscripts/per-site-settings. See the script and the example configuration for details
#@on_event LOAD_COMMIT spawn @scripts_dir/per-site-settings.py @data_home/uzbl/per-site-settings
@@ -327,7 +328,8 @@ 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 \@< uzbl.follow("\@follow_hint_keys", "%s", 0) >\@
+@cbind Fl* = spawn @scripts_dir/follow.sh \@< uzbl.follow("\@follow_hint_keys", "%s", 1) >\@
@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 d7fe117..1f8947d 100755
--- a/examples/data/scripts/follow.sh
+++ b/examples/data/scripts/follow.sh
@@ -1,21 +1,11 @@
#!/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.
-
-# 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
- echo 'script @scripts_dir/follow.js "@{follow_hint_keys} '$1'"' > "$UZBL_FIFO"
- exit
-fi
-
-result=$(echo 'script @scripts_dir/follow.js "@{follow_hint_keys} '$1'"' | socat - unix-connect:"$UZBL_SOCKET")
-case $result in
- *XXXEMIT_FORM_ACTIVEXXX*)
+case "$1" in
+ XXXEMIT_FORM_ACTIVEXXX)
# a form element was selected
- echo 'event FORM_ACTIVE' > "$UZBL_FIFO" ;;
- *XXXRESET_MODEXXX*)
+ printf 'event FORM_ACTIVE\nevent KEYCMD_CLEAR\n' > "$UZBL_FIFO" ;;
+ XXXRESET_MODEXXX)
# a link was selected, reset uzbl's input mode
printf 'set mode=\nevent KEYCMD_CLEAR\n' > "$UZBL_FIFO" ;;
esac