diff options
Diffstat (limited to 'examples/data/scripts/follow.sh')
-rwxr-xr-x | examples/data/scripts/follow.sh | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/examples/data/scripts/follow.sh b/examples/data/scripts/follow.sh index 014793e..30d3775 100755 --- a/examples/data/scripts/follow.sh +++ b/examples/data/scripts/follow.sh @@ -1,13 +1,31 @@ #!/bin/sh # This scripts acts on the return value of followLinks in follow.js -case "$1" in +result=$1 +shift + +uriaction=$1 +shift + +case "$result" in XXXEMIT_FORM_ACTIVEXXX) # a form element was selected - printf 'event FORM_ACTIVE\nevent KEYCMD_CLEAR\n' > "$UZBL_FIFO" + printf 'event 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" ;; + XXXRETURNED_URIXXX*) + uri=${result#XXXRETURNED_URIXXX} + + case "$uriaction" in + set) + printf 'uri '"$uri"'\n' | sed -e 's/@/\\@/' > "$UZBL_FIFO" + ;; + clipboard) + printf "$uri" | xclip + ;; + esac + printf 'set mode=\nevent KEYCMD_CLEAR\n' > "$UZBL_FIFO" esac |