aboutsummaryrefslogtreecommitdiff
path: root/bin/dmenu_pass.sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2022-05-21 02:02:13 +1200
committerTom Ryder <tom@sanctum.geek.nz>2022-05-21 02:12:53 +1200
commitec401dcd28815aed5da3d5fbf53f247ed003b03e (patch)
tree62d4260ee332e8fc97db5e412695ddc583c59f14 /bin/dmenu_pass.sh
parentDon't copy PRIMARY to CLIPBOARD from urxvt anymore (diff)
downloaddotfiles-ec401dcd28815aed5da3d5fbf53f247ed003b03e.tar.gz
dotfiles-ec401dcd28815aed5da3d5fbf53f247ed003b03e.zip
Rewrite dmp(1df) as dmenu_pass(1df)
Diffstat (limited to 'bin/dmenu_pass.sh')
-rw-r--r--bin/dmenu_pass.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/dmenu_pass.sh b/bin/dmenu_pass.sh
new file mode 100644
index 00000000..bfb687b1
--- /dev/null
+++ b/bin/dmenu_pass.sh
@@ -0,0 +1,14 @@
+# Pick a pass(1) password with dmenu(1)
+self=dmenu_pass
+cd -- "${PASSWORD_STORE_DIR:-"$HOME"/.password-store}" || exit
+# shellcheck disable=SC2016
+name=$(
+ find . -name \*.gpg ! -type d |
+ sed -e 's_^\./__' -e 's_\.gpg$__' |
+ LC_ALL=C sort -f |
+ dmenu
+)
+pass show --clip -- "$name" || exit
+notify-send --app-name="$self" -- \
+ "Password saved to CLIPBOARD" \
+ "$name"