From 6100215c724da29c0d264d0d615611477413584a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 16 May 2020 08:45:23 +0200 Subject: [PATCH] [gopass] Add fall-back to dmenu if rofi not found --- gopass/.local/bin/rofi-gopass | 15 +++++++++++---- gopass/README.md | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gopass/.local/bin/rofi-gopass b/gopass/.local/bin/rofi-gopass index 984b470..dd639cb 100755 --- a/gopass/.local/bin/rofi-gopass +++ b/gopass/.local/bin/rofi-gopass @@ -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 diff --git a/gopass/README.md b/gopass/README.md index babf52a..f0d4fa9 100644 --- a/gopass/README.md +++ b/gopass/README.md @@ -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