Merge remote branch 'remotes/uzbl/master'
[uzbl-mobile] / examples / data / uzbl / scripts / clipboard.sh
diff --git a/examples/data/uzbl/scripts/clipboard.sh b/examples/data/uzbl/scripts/clipboard.sh
new file mode 100755 (executable)
index 0000000..60567d3
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# with this script you can store the current url in the clipboard, or go to the url which is stored in the clipboard.
+
+clip=xclip
+
+fifo="$5"
+action="$1"
+url="$7"
+
+selection=`$clip -o`
+
+case $action in
+  "yank" ) echo -n "$url" | eval "$clip";;
+  "goto" ) echo "uri $selection" > "$fifo";;
+  * ) echo "clipboard.sh: invalid action";;
+esac