X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=examples%2Fdata%2Fuzbl%2Fscripts%2Fyank.sh;fp=examples%2Fdata%2Fuzbl%2Fscripts%2Fyank.sh;h=ddd0a4bc67563e4d26b1e4a67390bc3b507bed61;hb=135b490546cd5833aec76588825eba6634f8fd21;hp=ee140c7ea696cc65f50740d6c1c4ee959c49d6eb;hpb=d36686924a2b7d81ad5c74b38249e53af0b6449e;p=uzbl-mobile diff --git a/examples/data/uzbl/scripts/yank.sh b/examples/data/uzbl/scripts/yank.sh index ee140c7..ddd0a4b 100755 --- a/examples/data/uzbl/scripts/yank.sh +++ b/examples/data/uzbl/scripts/yank.sh @@ -1,3 +1,4 @@ +#!/bin/sh # use this script to pipe any variable to xclip, so you have it in your clipboard # 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. @@ -5,8 +6,10 @@ # bind yurl = spawn ./examples/scripts/yank.sh 6 primary # bind ytitle = spawn ./examples/scripts/yank.sh 7 clipboard +clip=xclip + which xclip &>/dev/null || exit 1 -[ "$9" == primary -o "$9" == secondary -o "$9" == clipboard ] || exit 2 +[ "x$9" = xprimary -o "x$9" = xsecondary -o "x$9" = xclipboard ] || exit 2 -echo echo -n "${!8}" '|' xclip -selection $9 -echo -n "${!8}" | xclip -selection $9 +echo "echo -n '${8}' | $clip -selection $9" +echo -n "'${8}' | $clip -selection $9"