gopassmenu: add login retrieval
This commit is contained in:
parent
1782a45b50
commit
70c7d5528e
1 changed files with 11 additions and 2 deletions
|
@ -3,7 +3,12 @@
|
||||||
|
|
||||||
if test -z $ROFI_RETV
|
if test -z $ROFI_RETV
|
||||||
then
|
then
|
||||||
rofi -show gopass -modi "gopass:$0" -kb-accept-custom "" -kb-accept-alt "" -kb-custom-2 "Control+Return" -kb-custom-1 "Shift+Return"
|
rofi -show gopass -modi "gopass:$0" \
|
||||||
|
-kb-accept-custom "" \
|
||||||
|
-kb-accept-alt "" \
|
||||||
|
-kb-custom-1 "Shift+Return" \
|
||||||
|
-kb-custom-2 "Control+Return"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# echo "args $* --- retv $ROFI_RETV" >&2
|
# echo "args $* --- retv $ROFI_RETV" >&2
|
||||||
|
@ -18,11 +23,15 @@ error() {
|
||||||
case "$ROFI_RETV" in
|
case "$ROFI_RETV" in
|
||||||
# run it in backgroud and quit rofi
|
# run it in backgroud and quit rofi
|
||||||
0) echo -e "\0use-hot-keys\x1ftrue\n"
|
0) echo -e "\0use-hot-keys\x1ftrue\n"
|
||||||
echo -e "\0message\x1fShift-Enter for OTP\n"
|
echo -e "\0message\x1fControl-Enter for login, Shift-Enter for OTP\n"
|
||||||
gopass ls -f ;;
|
gopass ls -f ;;
|
||||||
1) ( gopass show -c $1 > /dev/null ) & ;;
|
1) ( gopass show -c $1 > /dev/null ) & ;;
|
||||||
10) (
|
10) (
|
||||||
out=$(gopass otp -c $1 2>&1)
|
out=$(gopass otp -c $1 2>&1)
|
||||||
(( $? > 0 )) && error "$out"
|
(( $? > 0 )) && error "$out"
|
||||||
) & ;;
|
) & ;;
|
||||||
|
11) (
|
||||||
|
out=$(gopass show -c ${1} login 2>&1)
|
||||||
|
(( $? > 0 )) && error "$out"
|
||||||
|
) & ;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Reference in a new issue