diff options
Diffstat (limited to 'publish')
-rwxr-xr-x | publish | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -41,7 +41,7 @@ # # The random location chosen is printed to stdout when the script finishes, # and is copied to the xclipboard if the xclip(1) or xsel(1) utility is -# installed. +# installed (configurable via the clipper variable). # # base_http and base_rsync can be overriden in a ~/.publish.cfg shell snippet. @@ -55,6 +55,14 @@ ttl=180 date_format='%Y-%m-%d-' rsync_args="--compress --times --chmod=u=rwX,go=rX" +if command -v xclip >/dev/null 2>&1; then + clipper=xclip +elif command -v xsel >/dev/null 2>&1; then + clipper=xsel +else + clipper=true +fi + rsync_pre_invoke() { true ;} rsync_post_invoke() { true ;} @@ -297,13 +305,10 @@ if [ "$add_default_cs" -gt 0 ] ; then shift fi -if command -v xclip >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then - echo -n "$main_uri" | xclip -elif command -v xsel >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then - echo -n "$main_uri" | xsel +if [ -n "${DISPLAY:-}" ]; then + echo -n "$main_uri" | $clipper fi - if [ -n "${ttl}" ]; then setup_tmpdir echo "${ttl}" > "$tmpdir/.publish.ttl" |