aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2020-02-02 11:06:24 -0500
committerBen Burwell <ben@benburwell.com>2020-02-02 11:06:24 -0500
commit9292ff0f514eb6e17234f25a0418dc2a742c605a (patch)
tree00f0ed2f852a6c7c2e7700da93dfccd70ba2b9cd
parente3ff6e6b863c4049016d43bb76f62e1048a69cce (diff)
pass: enable clipping otp code with dmenu
-rwxr-xr-xtemplates/.bin/passmenu10
-rw-r--r--templates/.config/sway/config3
2 files changed, 10 insertions, 3 deletions
diff --git a/templates/.bin/passmenu b/templates/.bin/passmenu
index 8284ff2..b5f431b 100755
--- a/templates/.bin/passmenu
+++ b/templates/.bin/passmenu
@@ -7,8 +7,14 @@ password_files=( "$prefix"/**/*.gpg )
password_files=( "${password_files[@]#"$prefix"/}" )
password_files=( "${password_files[@]%.gpg}" )
-password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@")
+password=$(printf '%s\n' "${password_files[@]}" | dmenu)
[[ -n $password ]] || exit
-pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | wl-copy
+cmd=show
+
+if [ "$1" = "otp" ]; then
+ cmd=otp
+fi
+
+pass "$cmd" "$password" | { IFS= read -r pass; printf %s "$pass"; } | wl-copy
diff --git a/templates/.config/sway/config b/templates/.config/sway/config
index a9275d1..7d78b3f 100644
--- a/templates/.config/sway/config
+++ b/templates/.config/sway/config
@@ -69,7 +69,8 @@ input "1133:16493:Logitech_M705" {
bindsym $mod+Shift+q exec swaylock -c 000000
# Grab a password
- bindsym $mod+Shift+p exec passmenu
+ bindsym $mod+p exec passmenu
+ bindsym $mod+Shift+p exec passmenu otp
#
# Moving around: