diff options
author | tv <tv@krebsco.de> | 2023-03-22 18:04:21 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2023-03-22 18:04:21 +0100 |
commit | 782c8652366c173626c2f1ddd40eb1b220bd97d6 (patch) | |
tree | c8a671f1a4b0fd8b04d28c572222b229f8afbb9a /tv/5pkgs/simple/fzmenu/bin | |
parent | d873abf0a92c709ec9f79b49fa5d2e5bd244f0ad (diff) |
tv fzmenu: admit symlinks
Diffstat (limited to 'tv/5pkgs/simple/fzmenu/bin')
-rwxr-xr-x | tv/5pkgs/simple/fzmenu/bin/otpmenu | 11 | ||||
-rwxr-xr-x | tv/5pkgs/simple/fzmenu/bin/passmenu | 12 |
2 files changed, 15 insertions, 8 deletions
diff --git a/tv/5pkgs/simple/fzmenu/bin/otpmenu b/tv/5pkgs/simple/fzmenu/bin/otpmenu index 12bd60a9..273a408e 100755 --- a/tv/5pkgs/simple/fzmenu/bin/otpmenu +++ b/tv/5pkgs/simple/fzmenu/bin/otpmenu @@ -10,14 +10,17 @@ case ${FZMENU_PHASE-0} in ;; 1) if result=$( + PASSWORD_STORE_DIR=${PASSWORD_STORE_DIR-$HOME/.password-store} FZF_DEFAULT_OPTS=${FZMENU_FZF_DEFAULT_OPTS-} if test -n "$FZF_DEFAULT_OPTS"; then export FZF_DEFAULT_OPTS fi - pass git ls-files '*/otp.gpg' | \ - sed ' - - s/\/otp\.gpg$// + find -L "$PASSWORD_STORE_DIR" -type f -name 'otp.gpg' | + awk -F / -v PASSWORD_STORE_DIR="$PASSWORD_STORE_DIR" ' + { n = length(PASSWORD_STORE_DIR "/") } + $NF == "otp.gpg" { + print substr($0, 1 + n, length($0)-length("/otp.gpg")-n) + } ' | exec fzf \ --history=/dev/null \ diff --git a/tv/5pkgs/simple/fzmenu/bin/passmenu b/tv/5pkgs/simple/fzmenu/bin/passmenu index da8e739e..76153f53 100755 --- a/tv/5pkgs/simple/fzmenu/bin/passmenu +++ b/tv/5pkgs/simple/fzmenu/bin/passmenu @@ -10,14 +10,18 @@ case ${FZMENU_PHASE-0} in ;; 1) if result=$( + PASSWORD_STORE_DIR=${PASSWORD_STORE_DIR-$HOME/.password-store} FZF_DEFAULT_OPTS=${FZMENU_FZF_DEFAULT_OPTS-} if test -n "$FZF_DEFAULT_OPTS"; then export FZF_DEFAULT_OPTS fi - pass git ls-files '*/*.gpg' | \ - sed ' - /\/otp\.gpg$:/d - s/\.gpg$// + find -L "$PASSWORD_STORE_DIR" -type f -name '*.gpg' | + awk -F / -v PASSWORD_STORE_DIR="$PASSWORD_STORE_DIR" ' + { n = length(PASSWORD_STORE_DIR "/") } + $NF == "otp.gpg" { next } + /.*\.gpg$/ { + print substr($0, 1 + n, length($0)-length(".gpg")-n) + } ' | exec fzf \ --history=/dev/null \ |