From d8dbb1d5af93eb6e89b0cb38f401a4bce38e4425 Mon Sep 17 00:00:00 2001 From: Chris Down Date: Fri, 17 Mar 2017 01:14:06 +0000 Subject: [PATCH] Use wrapper for xsel to avoid having to pass --logfile again and again --- clipmenud | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clipmenud b/clipmenud index 34dc115..71be9cf 100755 --- a/clipmenud +++ b/clipmenud @@ -6,6 +6,10 @@ cache_file=$cache_dir/line_cache lock_file=$cache_dir/lock lock_timeout=2 +_xsel() { + xsel --logfile /dev/null "$@" +} + get_first_line() { # Args: # - $1, the file or data @@ -65,7 +69,7 @@ while sleep "${CLIPMENUD_SLEEP:-0.5}"; do fi for selection in clipboard primary; do - data=$(xsel --logfile /dev/null -o --"$selection"; printf x) + data=$(_xsel -o --"$selection"; printf x) debug "Data before stripping: $data" @@ -118,7 +122,7 @@ while sleep "${CLIPMENUD_SLEEP:-0.5}"; do # We can't colocate this with the above copying code because # https://github.com/cdown/clipmenu/issues/34 requires knowing if # we would skip first. - xsel --logfile /dev/null -o --"$selection" | xsel --logfile /dev/null -i --"$selection" + _xsel -o --"$selection" | _xsel -i --"$selection" fi done