password-store

Simple password manager using gpg and ordinary unix directories
git clone https://git.zx2c4.com/password-store
Log | Files | Refs | README | LICENSE

commit eccbf87dd710982fa0d681bfdbb2a892e28e7e22
parent 85c48b6ac41d58abc5fae1c24b0f9616f2ea0cbf
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date:   Sat, 22 Mar 2014 13:06:20 -0600

clip: rename SELECTION to X_SELECTION

Diffstat:
Mman/pass.1 | 2+-
Msrc/password-store.sh | 10+++++-----
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/man/pass.1 b/man/pass.1 @@ -350,7 +350,7 @@ Overrides the default root of the git repository, which is helpful if \fIPASSWORD_STORE_DIR\fP is temporarily set to a sub-directory of the default password store. .TP -.I PASSWORD_STORE_SELECTION +.I PASSWORD_STORE_X_SELECTION Overrides the selection passed to \fBxclip\fP, by default \fIclipboard\fP. See .BR xclip (1) for more info. diff --git 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." }