summaryrefslogtreecommitdiff
path: root/bin/guiscripts
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-18 11:20:12 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-18 11:20:40 +0200
commit00ec1553e919e8b4f02e4f27d73bfac4c5c31494 (patch)
tree714dd264bd7015a1ea02a0fa1804bb5d816d929b /bin/guiscripts
parent776a138c1ac117f4eb6a52cd127bd840689d159a (diff)
made dmpas into menuscript
Diffstat (limited to 'bin/guiscripts')
-rwxr-xr-xbin/guiscripts/dmpass11
-rwxr-xr-xbin/guiscripts/mpass19
2 files changed, 19 insertions, 11 deletions
diff --git a/bin/guiscripts/dmpass b/bin/guiscripts/dmpass
deleted file mode 100755
index bb7bee2..0000000
--- a/bin/guiscripts/dmpass
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env sh
-store="$HOME/.password-store"
-lscmd="ls --group-directories-first"
-dmenucmd="dmenu -l 4 -g 2"
-while [ -d "${store}/${file}" ]
-do
- choice="$($lscmd "${store}/${file}" | sed 's/\.gpg$//'| $dmenucmd)"
- [ "$choice" ] || break
- file="${file}/${choice}"
-done
-pass show -c "${file}"
diff --git a/bin/guiscripts/mpass b/bin/guiscripts/mpass
new file mode 100755
index 0000000..386abdf
--- /dev/null
+++ b/bin/guiscripts/mpass
@@ -0,0 +1,19 @@
+#!/usr/bin/env sh
+store="$HOME/.password-store"
+lscmd="ls --group-directories-first"
+if [ "$MENUCMD" = "tofi" ]
+then
+ menucmd="tofi --matching-algorithm prefix --prompt pass:"
+elif [ "$MENUCMD" = "dmenu" ]
+then
+ menucmd="dmenu -l 4 -g 2 -x -i -p pass:"
+else
+ menucmd="fzf"
+fi
+while [ -d "${store}/${file}" ]
+do
+ choice="$($lscmd "${store}/${file}" | sed 's/\.gpg$//'| $menucmd)"
+ [ "$choice" ] || break
+ file="${file}/${choice}"
+done
+pass show -c "${file}"