X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=examples%2Fscripts%2Fyank.sh;h=ee140c7ea696cc65f50740d6c1c4ee959c49d6eb;hb=bf412203b44431ee61936615664b60fca817592a;hp=0429f199aa196ab598a623c9246ed7df5f8df658;hpb=94f2be465514937c12eb75a1a28d5a54649d0adb;p=uzbl-mobile diff --git a/examples/scripts/yank.sh b/examples/scripts/yank.sh index 0429f19..ee140c7 100755 --- a/examples/scripts/yank.sh +++ b/examples/scripts/yank.sh @@ -1,10 +1,12 @@ # use this script to pipe any variable to xclip, so you have it in your clipboard -exit -# this script is not done yet - -# can we make this universal? -# add xclip to optdeps +# in your uzbl config, make the first argument the number of the (later) argument you want to use (see README for list of args) +# make the 2nd argument one of : primary, secondary, clipboard. +# examples: +# bind yurl = spawn ./examples/scripts/yank.sh 6 primary +# bind ytitle = spawn ./examples/scripts/yank.sh 7 clipboard which xclip &>/dev/null || exit 1 +[ "$9" == primary -o "$9" == secondary -o "$9" == clipboard ] || exit 2 -echo -n `eval "$3"` #| xclip \ No newline at end of file +echo echo -n "${!8}" '|' xclip -selection $9 +echo -n "${!8}" | xclip -selection $9