diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-03-22 13:06:20 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2014-03-22 13:06:20 -0600 |
commit | eccbf87dd710982fa0d681bfdbb2a892e28e7e22 (patch) | |
tree | dd23b74c7d52ed79210e7d03e6895e3ea09894d7 /src | |
parent | 85c48b6ac41d58abc5fae1c24b0f9616f2ea0cbf (diff) |
clip: rename SELECTION to X_SELECTION
Diffstat (limited to 'src')
-rwxr-xr-x | src/password-store.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/password-store.sh b/src/password-store.sh index 3a6cbc9..5b5d36e 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -7,7 +7,7 @@ umask 077 GPG_OPTS="--quiet --yes --batch --compress-algo=none" PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}" -SELECTION="${PASSWORD_STORE_SELECTION:-clipboard}" +X_SELECTION="${PASSWORD_STORE_X_SELECTION:-clipboard}" CLIP_TIME="${PASSWORD_STORE_CLIP_TIME:-45}" export GIT_DIR="${PASSWORD_STORE_GIT:-$PREFIX}/.git" export GIT_WORK_TREE="${PASSWORD_STORE_GIT:-$PREFIX}" @@ -118,11 +118,11 @@ clip() { sleep_argv0="password store sleep on display $DISPLAY" pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.1 - before="$(xclip -o -selection "$SELECTION" | base64)" - echo -n "$1" | xclip -selection "$SELECTION" + before="$(xclip -o -selection "$X_SELECTION" | base64)" + echo -n "$1" | xclip -selection "$X_SELECTION" ( ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) - now="$(xclip -o -selection "$SELECTION" | base64)" + now="$(xclip -o -selection "$X_SELECTION" | base64)" [[ $now != $(echo -n "$1" | base64) ]] && before="$now" # It might be nice to programatically check to see if klipper exists, @@ -134,7 +134,7 @@ clip() { # so we axe it here: qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null - echo "$before" | base64 -d | xclip -selection "$SELECTION" + echo "$before" | base64 -d | xclip -selection "$X_SELECTION" ) 2>/dev/null & disown echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." } |