diff options
-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 |