1 From d11261c2ad184daf6e9edd777bc8a3372c277b4b Mon Sep 17 00:00:00 2001
2 From: Johannes Frankenau <johannes@frankenau.net>
3 Date: Fri, 10 Aug 2018 09:49:57 +0200
4 Subject: [PATCH] Patch the clip() function to work even when using
5 single-binary coreutils
8 src/platform/cygwin.sh | 4 ++--
9 src/platform/darwin.sh | 4 ++--
10 3 files changed, 6 insertions(+), 6 deletions(-)
12 diff --git a/src/platform/cygwin.sh b/src/platform/cygwin.sh
13 index 5a8d5ea..423e0ce 100644
14 --- a/src/platform/cygwin.sh
15 +++ b/src/platform/cygwin.sh
19 local sleep_argv0="password store sleep on display $DISPLAY"
20 - pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5
21 + pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5
22 local before="$($BASE64 < /dev/clipboard)"
23 echo -n "$1" > /dev/clipboard
25 - ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )
26 + ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") )
27 local now="$($BASE64 < /dev/clipboard)"
28 [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now"
29 echo "$before" | $BASE64 -d > /dev/clipboard
30 diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh
31 index 342ecce..9e12837 100644
32 --- a/src/platform/darwin.sh
33 +++ b/src/platform/darwin.sh
37 local sleep_argv0="password store sleep for user $(id -u)"
38 - pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5
39 + pkill -P $(pgrep -f "^$sleep_argv0") 2>/dev/null && sleep 0.5
40 local before="$(pbpaste | $BASE64)"
43 - ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )
44 + ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") )
45 local now="$(pbpaste | $BASE64)"
46 [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now"
47 echo "$before" | $BASE64 -d | pbcopy