aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/scripts/clipboard.sh
diff options
context:
space:
mode:
Diffstat (limited to 'examples/scripts/clipboard.sh')
-rwxr-xr-xexamples/scripts/clipboard.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/scripts/clipboard.sh b/examples/scripts/clipboard.sh
new file mode 100755
index 0000000..c64b65c
--- /dev/null
+++ b/examples/scripts/clipboard.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# with this script you can store the current url in the clipboard, or go to the url which is stored in the clipboard.
+
+fifo="$5"
+action="$1"
+url="$7"
+selection=$(xclip -o)
+
+case $action in
+ "yank" ) echo -n "$url" | xclip;;
+ "goto" ) echo "uri $selection" > "$fifo";;
+ * ) echo "clipboard.sh: invalid action";;
+esac
+