clipmenu

Simple clipboard management using dmenu
git clone https://git.sinitax.com/cdown/clipmenu
Log | Files | Refs | README | LICENSE | sfeed.txt

commit 4a3862666fe8d73c20200a60a5d351068d020422
parent f3badd8f3558fd152cac91d32562717a00b5066c
Author: Chris Down <chris@chrisdown.name>
Date:   Thu, 10 May 2018 17:13:46 +0100

Always send xsel logfile to /dev/null

We don't want this logging to disk, but /dev/stderr doesn't always work
(see #81). Let's just stop all logging to avoid more shenanigans.

Diffstat:
Mclipmenu | 2+-
Mclipmenud | 13+------------
Mtests/test-clipmenu | 4++--
3 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/clipmenu b/clipmenu @@ -68,5 +68,5 @@ if ! [[ -f "$file" ]]; then fi for selection in clipboard primary; do - xsel --logfile /dev/stderr -i --"$selection" < "$file" + xsel --logfile /dev/null -i --"$selection" < "$file" done diff --git a/clipmenud b/clipmenud @@ -21,19 +21,8 @@ has_clipnotify=0 # shellcheck disable=SC2206 cm_selections=( $CM_SELECTIONS ) - -xsel_log=/dev/null -for file in /proc/self/fd/2 /dev/stderr; do - [[ -f "$file" ]] || continue - # In Linux, it's not possible to write to a socket represented by a file - # (for example, /dev/stderr or /proc/self/fd/2). See issue #54. - [[ -f "$(readlink -m "$file")" ]] || continue - xsel_log="$file" - break -done - _xsel() { - timeout 1 xsel --logfile "$xsel_log" "$@" + timeout 1 xsel --logfile /dev/null "$@" } get_first_line() { diff --git a/tests/test-clipmenu b/tests/test-clipmenu @@ -81,8 +81,8 @@ grep -Fxq 'dmenu line 1 stdin: Selected text 2. (2 lines)' "$temp" grep -Fxq 'dmenu line 2 stdin: Selected text. (2 lines)' "$temp" # xsel should copy both to clipboard *and* primary -grep -Fxq 'xsel args: --logfile /dev/stderr -i --clipboard' "$temp" -grep -Fxq 'xsel args: --logfile /dev/stderr -i --primary' "$temp" +grep -Fxq 'xsel args: --logfile /dev/null -i --clipboard' "$temp" +grep -Fxq 'xsel args: --logfile /dev/null -i --primary' "$temp" grep -Fxq 'xsel line 1 stdin: Selected text.' "$temp" grep -Fxq "xsel line 2 stdin: Yes, it's selected text." "$temp"