m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-02-25 14:59:51 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2017-02-25 15:01:03 +0100
commitb08781e2a6e183986eb1c24f51cdeff879b7a6af (patch)
tree88db537d6c0425be22fa71e8ed6a1d7ae17552a4
parent0ea5ac68bca08036971484a8d9749e68916060ee (diff)
clip: sleep may require argv[0] to be sleep
-rwxr-xr-xsrc/password-store.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index ce140db..17142f0 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -153,7 +153,7 @@ clip() {
local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | base64)"
echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard"
(
- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )
+ ( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" )
local now="$(xclip -o -selection "$X_SELECTION" | base64)"
[[ $now != $(echo -n "$1" | base64) ]] && before="$now"