summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/pass.12
-rwxr-xr-xsrc/password-store.sh10
2 files changed, 6 insertions, 6 deletions
diff --git a/man/pass.1 b/man/pass.1
index c48de1b..c09e228 100644
--- 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
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."
}