aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/dmp7
-rw-r--r--man/man1/dmp.15
2 files changed, 10 insertions, 2 deletions
diff --git a/bin/dmp b/bin/dmp
index d25082dd..fabb61a2 100755
--- a/bin/dmp
+++ b/bin/dmp
@@ -26,4 +26,9 @@ pw=$(
[ -n "$pw" ] || exit
# Pump the password into the clipboard xsel(2); allow 10 seconds
-pass show "$pw" | xsel -ibt "$((timeout_sec * 1000))"
+pass show "$pw" | xsel -ibt "$((timeout_sec * 1000))" || exit
+
+# If we have notify-send(1), alert that the password has been copied
+if command -v notify-send >/dev/null >&2 ; then
+ notify-send "$(printf '%s in clipboard' "$pw")"
+fi
diff --git a/man/man1/dmp.1 b/man/man1/dmp.1
index d5883afc..33dde9b8 100644
--- a/man/man1/dmp.1
+++ b/man/man1/dmp.1
@@ -13,8 +13,11 @@ 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.
.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), pass(1), xsel(1)
+dmenu(1), notify-send(1), pass(1), xsel(1)
.SH AUTHOR
Tom Ryder <tom@sanctum.geek.nz>