[gopass] Add fall-back to dmenu if rofi not found

This commit is contained in:
Marty Oehme 2020-05-16 08:45:23 +02:00
parent d5bc2aeab5
commit 6100215c72
No known key found for this signature in database
GPG key ID: 0CCB0526EFB9611A
2 changed files with 12 additions and 5 deletions

View file

@ -2,11 +2,18 @@
#
# Original inspiration from https://github.com/carnager/rofi-pass/
# rofi wrapper. Add custom settings here.
# selector wrapper
# uses rofi if found, or dmenu if found, complains if no selector available
_rofi() {
# TODO add check for dmenu
exist rofi critical "rofi-gopass" || exit 0
rofi -dmenu -no-auto-select -i "$@" -p "Entry"
if type rofi 2>/dev/null; then
echo "rofi found" 1>&2
rofi -dmenu -no-auto-select -i "$@" -p "Entry"
elif type dmenu 2>/dev/null; then
echo "dmenu found" 1>&2
dmenu -i "$@" -p "Entry"
else
exist rofi critical "rofi-gopass" || exit 0
fi
}
# parse, see https://unix.stackexchange.com/a/331965/8541

View file

@ -4,7 +4,7 @@
The gopass module tries to make interacting with the basic necessities of gopass painless and quick -- it is focused on accessing secrets, and quickly auto-filling forms or copying secrets to the clipboard. It relies on the default gopass auto-deleting clipping, so your secrets are automatically removed after a short while.
The configuration of gopass is relatively standard, it tries to follow XDG_specifications, putting the default pass store into `~/.local/share`.
The configuration of gopass is relatively standard, it tries to follow XDG_specifications, putting the default pass store into `~/.local/share/gopass/passwords`.
## rofi-gopass