aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--AUTHORS2
-rwxr-xr-xexamples/data/uzbl/scripts/yank.sh14
2 files changed, 10 insertions, 6 deletions
diff --git a/AUTHORS b/AUTHORS
index e744900..3533097 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -24,7 +24,7 @@ Contributors:
Tom Adams (holizz) - few patches, cookies.py, gtkplug/socket & proof of concept uzbl_tabbed.py
neutralinsomniac - load_progress = 0 fix
Maximilian Gaß (mxey) - several small patches
- Abel Camarillo (00z) - make it compile on OpenBSD
+ Abel Camarillo (00z) - various portability fixes, such as BSD fixes for Makefile and posix shell scripts
(israellevin) - toggle_zoom_type
(kmeaw) - fix for multibyte utf8 characters segfault
(evocallaghan) - tiny patches
diff --git a/examples/data/uzbl/scripts/yank.sh b/examples/data/uzbl/scripts/yank.sh
index f953ec7..376b7e2 100755
--- a/examples/data/uzbl/scripts/yank.sh
+++ b/examples/data/uzbl/scripts/yank.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/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.
@@ -6,8 +6,12 @@
# 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
+clip=xclip
-echo echo -n "${!8}" '|' xclip -selection $9
-echo -n "${!8}" | xclip -selection $9
+which $clip &>/dev/null || exit 1
+[ "x$9" = xprimary -o "x$9" = xsecondary -o "x$9" = xclipboard ] || exit 2
+
+value=`eval "echo -n \\${$8}"` # bash: value = ${!8}
+
+echo "echo -n '${value}' | $clip -selection $9"
+echo -n "'${value}' | $clip -selection $9"