aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/gopassmenu23
1 files changed, 23 insertions, 0 deletions
diff --git a/bin/gopassmenu b/bin/gopassmenu
new file mode 100755
index 0000000..6a3c461
--- /dev/null
+++ b/bin/gopassmenu
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+DMENU_BIN="$HOME/bin/dmenu_wrapper"
+
+PROMPT="senha:"
+
+case "$1" in
+ "--copy"|"-c")
+ gopass ls --flat | ${DMENU_BIN:-/usr/bin/dmenu} -p $PROMPT | xargs --no-run-if-empty gopass show -c
+ ;;
+ "--type"|"-t")
+ gopass ls --flat | ${DMENU_BIN:-/usr/bin/dmenu} -p $PROMPT | xargs --no-run-if-empty gopass show -o | xdotool type --clearmodifiers --file -
+ ;;
+ "--login"|"-l")
+ gopass ls --flat | ${DMENU_BIN:-/usr/bin/dmenu} -p $PROMPT | xargs --no-run-if-empty -- bash -c 'gopass show -f $0 username' | head -n 1 | xdotool type --clearmodifiers --file -
+ ;;
+ *)
+ echo "USAGE:"
+ echo "-c or --copy: copy selected entry's password field to the clipboard"
+ echo "-t or --type: type selected entry's password field using xdotool"
+ echo "-l or --login: copy selected entry's login field to the clipboard"
+ ;;
+esac