From c5f101d996a6ef47a0ee1764bdc1ca8e16547724 Mon Sep 17 00:00:00 2001 From: Chris Down Date: Sat, 5 Nov 2016 12:05:22 -0600 Subject: [PATCH] Use -o when running xsel xsel` without `-o` even though it has the same *end* result, has different internal logic. Specifically, it seems to do things with the PRIMARY selection that cause weird behaviour (like causing applications like urxvt to deselect their selection, see #33). --- clipmenud | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clipmenud b/clipmenud index a65e84e..2752c84 100755 --- a/clipmenud +++ b/clipmenud @@ -54,7 +54,7 @@ while sleep "${CLIPMENUD_SLEEP:-0.5}"; do if type -p xsel >/dev/null 2>&1; then debug 'Using xsel' - data=$(xsel --"$selection"; printf x) + data=$(xsel -o --"$selection"; printf x) # Take ownership of the clipboard, in case the original application # is unable to serve the clipboard request (due to being suspended, # etc). @@ -63,7 +63,7 @@ while sleep "${CLIPMENUD_SLEEP:-0.5}"; do # sometimes act up if clipboard focus is taken away from them -- # for example, urxvt will unhilight text, which is undesirable. if [[ $selection != primary ]]; then - xsel --"$selection" | xsel -i --"$selection" + xsel -o --"$selection" | xsel -i --"$selection" fi else debug 'Using xclip'