diff options
author | Peter Palfrader <peter@palfrader.org> | 2013-01-27 18:01:24 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2013-01-27 18:01:24 +0000 |
commit | 1697ddfe8e57176319e79bed951198a8c8497d6f (patch) | |
tree | a311ab8fbf3c870a72231ad448486a121caed164 | |
parent | f31023508a768febf32ca2f4936a5d509fbee45a (diff) |
publish: add xsel support
Signed-off-by: Peter Palfrader <peter@palfrader.org>
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@575 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-x | publish | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -40,7 +40,8 @@ # automagically). # # The random location chosen is printed to stdout when the script finishes, -# and is copied to the xclipboard if the xclip(1) utility is installed· +# and is copied to the xclipboard if the xclip(1) or xsel(1) utility is +# installed. # # base_http and base_rsync can be overriden in a ~/.publish.cfg shell snippet. @@ -195,8 +196,14 @@ if [[ "$#" = 0 ]]; then cat "$stdin" | sed -e 's#^#| #' echo echo "EOF" + elif which xsel >/dev/null 2>&1; then + echo "Publishing x clipboard:" >&2 + xsel -o > "$stdin" + cat "$stdin" | sed -e 's#^#| #' + echo + echo "EOF" else - echo "xclip not installed?" >&2 + echo "Neither xclip nor xsel installed?" >&2 exit 1 fi fi @@ -251,6 +258,8 @@ fi if command -v xclip >/dev/null 2>&1; then echo -n "$main_uri" | xclip +elif command -v xsel >/dev/null 2>&1; then + echo -n "$main_uri" | xsel fi |