aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/uzbl/scripts/yank.sh
diff options
context:
space:
mode:
Diffstat (limited to 'examples/data/uzbl/scripts/yank.sh')
-rwxr-xr-xexamples/data/uzbl/scripts/yank.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/data/uzbl/scripts/yank.sh b/examples/data/uzbl/scripts/yank.sh
new file mode 100755
index 0000000..ee140c7
--- /dev/null
+++ b/examples/data/uzbl/scripts/yank.sh
@@ -0,0 +1,12 @@
+# 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.
+# 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 echo -n "${!8}" '|' xclip -selection $9
+echo -n "${!8}" | xclip -selection $9