diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-11-13 00:47:42 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-11-13 00:48:30 +1300 |
commit | d51d5f6be2e25f31a1314900ec74239bb72f7412 (patch) | |
tree | 2799f3844e5aec61b4ab6442f9b761f2695ac669 | |
parent | Update submodules (diff) | |
download | dotfiles-d51d5f6be2e25f31a1314900ec74239bb72f7412.tar.gz dotfiles-d51d5f6be2e25f31a1314900ec74239bb72f7412.zip |
Simplify/correct dmp(1) copying
Remove timeout feature; not working anyway
-rwxr-xr-x | bin/dmp | 7 | ||||
-rw-r--r-- | man/man1/dmp.1df | 8 |
2 files changed, 3 insertions, 12 deletions
@@ -1,8 +1,5 @@ #!/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%/} @@ -25,8 +22,8 @@ pw=$( # Bail if we don't have a password [ -n "$pw" ] || exit -# Pump the password into the clipboard xsel(2); allow 10 seconds -pass show "$pw" | xsel -ibt "$((timeout_sec * 1000))" || exit +# Pump the first line of the password into the clipboard +pass show "$pw" | sed 1q | xsel -ib || exit # If we have notify-send(1), alert that the password has been copied if command -v notify-send >/dev/null >&2 ; then diff --git a/man/man1/dmp.1df b/man/man1/dmp.1df index b9f11bf8..d663e3d0 100644 --- a/man/man1/dmp.1df +++ b/man/man1/dmp.1df @@ -4,19 +4,13 @@ \- pick a pass(1) password with dmenu(1) .SH SYNOPSIS .B dmp -.br -.B dmp -25 .SH DESCRIPTION .B dmp applies dmenu(1) to pick a password entry from a pass(1) store and put it into -the X CLIPBOARD for a period of time, defaulting to 10 seconds, after which -xsel(1) will remove it from the clipboard. +the X CLIPBOARD for a period of time. .P If notify-send(1) is installed, a notification with the default priority will be written when the password is successfully clipped. -.P -The timeout in seconds can be specified as an optional argument. .SH SEE ALSO dmenu(1), notify-send(1), pass(1), xsel(1) .SH AUTHOR |