diff options
author | Paweł Zuzelski <pawelz@pld-linux.org> | 2010-03-28 18:19:14 +0200 |
---|---|---|
committer | Paweł Zuzelski <pawelz@pld-linux.org> | 2010-03-28 18:19:14 +0200 |
commit | 22c3109e1a26c2eb37e03d3f7bb86079c2e0874c (patch) | |
tree | 48122f272b7b3bcf76c504ef5715e9d464e84011 /examples/data/scripts/follow.sh | |
parent | 116a0b1459f56c9727bfdf056f37930332dbf6ba (diff) |
emit FORM_ACTIVE, when form element follow.js'ed
Due to Uzbl removal it is no longer possible to emit event from js script. So
follow.js does not emit FORM_ACTIVE event, when user selects form element
using follow.js. Workaround for that is to run follow.js from shell script,
set some global variable and next read this variable from shell script.
Diffstat (limited to 'examples/data/scripts/follow.sh')
-rw-r--r-- | examples/data/scripts/follow.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/data/scripts/follow.sh b/examples/data/scripts/follow.sh new file mode 100644 index 0000000..44a0d55 --- /dev/null +++ b/examples/data/scripts/follow.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +config=$1; +shift +pid=$1; +shift +xid=$1; +shift +fifo=$1; +shift +socket=$1; +shift +url=$1; +shift +title=$1; +shift + +echo 'script @scripts_dir/follow.js "@{follow_hint_keys} '$1'"' | socat - unix-connect:$socket + +# Read variable set by script. If it equals XXXFORMELEMENTCLICKEDXXX emit +# FORM_ACTIVE event +echo 'js rv' \ + | socat - unix-connect:$socket \ + | grep -q XXXINPUTELEMENTCLICKEDXXX \ + && echo 'event FORM_ACTIVE' \ + | socat - unix-connect:$socket |