summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2014-03-20 02:12:50 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2014-03-20 02:24:17 -0600
commit072bbc617bdcbaa0cc643a67676916ac99116172 (patch)
tree4b2bfb9f03ae392107d94b6f7ac63c2d287ed147 /src
parentcb05ad0ccd96996cbf975d7261568d8bbc75ec56 (diff)
downloadpass-072bbc617bdcbaa0cc643a67676916ac99116172.tar.gz
pass-072bbc617bdcbaa0cc643a67676916ac99116172.tar.bz2
pass-072bbc617bdcbaa0cc643a67676916ac99116172.zip
Configurable clipboard time.
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index 4f2239f..3040a17 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -8,6 +8,7 @@ umask 077
GPG_OPTS="--quiet --yes --batch --compress-algo=none"
PREFIX="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
SELECTION="${PASSWORD_STORE_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}"
@@ -29,14 +30,14 @@ usage() {
cat <<_EOF
Usage:
- $program init [--reencrypt,-e] gpg-id
+ $program init [--reencrypt,-e] [--path=subfolder,-p subfolder] gpg-id...
Initialize new password storage and use gpg-id for encryption.
Optionally reencrypt existing passwords using new gpg-id.
$program [ls] [subfolder]
List passwords.
$program [show] [--clip,-c] pass-name
Show existing password and optionally put it on the clipboard.
- If put on the clipboard, it will be cleared in 45 seconds.
+ If put on the clipboard, it will be cleared in $CLIP_TIME seconds.
$program insert [--echo,-e | --multiline,-m] [--force,-f] pass-name
Insert new password. Optionally, echo the password back to the console
during entry. Or, optionally, the entry may be multiline. Prompt before
@@ -120,7 +121,7 @@ clip() {
before="$(xclip -o -selection "$SELECTION" | base64)"
echo -n "$1" | xclip -selection "$SELECTION"
(
- ( exec -a "$sleep_argv0" sleep 45 )
+ ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )
now="$(xclip -o -selection "$SELECTION" | base64)"
[[ $now != $(echo -n "$1" | base64) ]] && before="$now"
@@ -135,7 +136,7 @@ clip() {
echo "$before" | base64 -d | xclip -selection "$SELECTION"
) 2>/dev/null & disown
- echo "Copied $2 to clipboard. Will clear in 45 seconds."
+ echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."
}
tmpdir() {
if [[ -d /dev/shm && -w /dev/shm && -x /dev/shm ]]; then