Merge branch 'experimental' of git://github.com/Dieterbe/uzbl into experimental
[uzbl-mobile] / examples / data / uzbl / scripts / yank.sh
1 # use this script to pipe any variable to xclip, so you have it in your clipboard
2 # in your uzbl config, make the first argument the number of the (later) argument you want to use (see README for list of args)
3 # make the 2nd argument one of : primary, secondary, clipboard.
4 # examples:
5 # bind    yurl      = spawn ./examples/scripts/yank.sh 6 primary
6 # bind    ytitle    = spawn ./examples/scripts/yank.sh 7 clipboard
7
8 which xclip &>/dev/null || exit 1
9 [ "$9" == primary -o "$9" == secondary -o "$9" == clipboard ] || exit 2
10
11 echo echo -n "${!8}" '|' xclip -selection $9
12 echo -n "${!8}" | xclip -selection $9