aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/follow.sh
blob: f08bd2937108bf58d568a41d190bf63fb8996fda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# This scripts acts on the return value of followLinks in follow.js 

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"
        ;;
    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' > "$UZBL_FIFO"
                ;;
            clipboard)
                printf "$uri" | xclip
                ;;
        esac
        printf 'set mode=\nevent KEYCMD_CLEAR\n' > "$UZBL_FIFO"
esac