aboutsummaryrefslogtreecommitdiffstats
path: root/.config/herbstluftwm/pass.sh
diff options
context:
space:
mode:
authorkatherine <shmibs@shmibbles.me>2017-11-08 01:47:34 -0700
committerkatherine <shmibs@shmibbles.me>2017-11-08 01:47:34 -0700
commit5d57322f71a9f3193133c1be1d5fe938b5cb6e56 (patch)
tree3ea6f992a1e7a25608af06bd2a9bc074d2e17ff4 /.config/herbstluftwm/pass.sh
parent7f19a384e2f683cfec0186845af8837124184785 (diff)
downloaddotfiles-5d57322f71a9f3193133c1be1d5fe938b5cb6e56.tar.gz
add pass and maim support to herbstluftwm
Diffstat (limited to '.config/herbstluftwm/pass.sh')
-rwxr-xr-x.config/herbstluftwm/pass.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/.config/herbstluftwm/pass.sh b/.config/herbstluftwm/pass.sh
new file mode 100755
index 0000000..32a7b2d
--- /dev/null
+++ b/.config/herbstluftwm/pass.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env zsh
+
+source ~/.config/init/vars
+
+zparseopts -M -E -A args \
+ f -firefox=f
+
+local password_files
+
+password_files=( ~/.password-store/**/*.gpg )
+password_files=( ${password_files:t:r} )
+
+printf "%s\n" $password_files | dmenu -fn "${bfont}:size=${bfont_size}" -i \
+ -h "$bheight" -nb "$bar_bg" -nf "$bar_fg" \
+ -sb "$bg_focus" -sf "$fg_focus" \
+ -p "Pass:" | cut -d ')' -f 1 | read choice
+
+[[ -n $choice ]] || exit
+
+pass show $choice | sed -n -e 's/^login: //p' | xclip -selection clipboard
+
+pass show $choice | sed -n -e 's/^url: //p' | read url
+[[ ${(@k)args[-f]} ]] && firefox --new-tab "$url"
+
+pass show -c $choice