summaryrefslogtreecommitdiff
path: root/private_dot_local/bin/executable_passmenu
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-02-11 02:47:33 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-02-11 02:47:33 +0000
commit2c485ce2b43bd810a88278215b771136a2a17881 (patch)
tree3fb74338b87553d898af7b1795de7322cbc5af63 /private_dot_local/bin/executable_passmenu
parentadd xdg (diff)
downloaddotfiles-2c485ce2b43bd810a88278215b771136a2a17881.tar.gz
add scripts
Diffstat (limited to 'private_dot_local/bin/executable_passmenu')
-rw-r--r--private_dot_local/bin/executable_passmenu42
1 files changed, 42 insertions, 0 deletions
diff --git a/private_dot_local/bin/executable_passmenu b/private_dot_local/bin/executable_passmenu
new file mode 100644
index 0000000..1aa1158
--- /dev/null
+++ b/private_dot_local/bin/executable_passmenu
@@ -0,0 +1,42 @@
1#!/bin/sh
2
3typeit=0
4nameit=0
5while true; do
6 case $1 in
7 "--type")
8 typeit=1
9 shift
10 ;;
11 "--name")
12 nameit=1
13 shift
14 ;;
15 *)
16 break
17 ;;
18 esac
19done
20
21prefix=${PASSWORD_STORE_DIR-~/.password-store}
22password=$(find $prefix -name '*.gpg' | sed "s@$prefix/\(.*\)\.gpg@\1@" | $MENU "$@")
23
24[ -n "$password" ] || exit
25
26if [ $nameit = 0 ]; then
27 what=$(pass show "$password" | head -n 1)
28 [ -n "$what" ] || exit
29else
30 what=$(basename $password)
31fi
32
33if [ $typeit = 0 ]; then
34 printf "$what" | wl-copy
35 if [ $nameit = 0 ]; then
36 notify-send "Coppied password for:" "$password"
37 else
38 notify-send "Coppied password name:" "$password"
39 fi
40else
41 printf "$what" | wtype - -k Tab
42fi