aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-15 17:11:31 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-15 17:11:31 +1200
commit85163378bca88d16c5629009e4ab43a621fbe57c (patch)
treef2486557df78798a3272293a7cc899ecabdf1cf4 /bin
parentAdjust wrapping in dmp(1) man page (diff)
downloaddotfiles-85163378bca88d16c5629009e4ab43a621fbe57c.tar.gz
dotfiles-85163378bca88d16c5629009e4ab43a621fbe57c.zip
Allow timeout argument to dmp(1)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dmp5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/dmp b/bin/dmp
index b6c878f9..d25082dd 100755
--- a/bin/dmp
+++ b/bin/dmp
@@ -1,5 +1,8 @@
#!/bin/sh
+# Sole optional argument is the password timeout (defaults to 10 seconds)
+timeout_sec=${1:-10}
+
# Get the password store directory, bail if we can't
pwsd=${PASSWORD_STORE_DIR:-$HOME/.password-store}
pwsd=${pwsd%/}
@@ -23,4 +26,4 @@ pw=$(
[ -n "$pw" ] || exit
# Pump the password into the clipboard xsel(2); allow 10 seconds
-pass show "$pw" | xsel -ibt 10000
+pass show "$pw" | xsel -ibt "$((timeout_sec * 1000))"