From e6732ad8adafdda9b50f3560715d2ecae238c304 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 18 Dec 2021 16:30:59 +0100 Subject: [PATCH] Rename picker choice option Renamed the picker option to `PICKER_BACKEND` to open another namespace for options and work better together with the others. closes #4 --- README.md | 2 +- pass-pick | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) mode change 100644 => 100755 pass-pick diff --git a/README.md b/README.md index c263478..cea8fa1 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ Additional configuration options with their default values: --- -* `PICKER` \ +* `PICKER_BACKEND` \ sets the tool to be used as interactive menu. Can be used either to prefer an alternative to one of the default pickers for the program (`bemenu`, `rofi`, `dmenu`) if multiple are installed. Can also be used to invoke a completely different picker program whose functionality needs to mimic `dmenu` in that it takes its arguments trough `stdin`. diff --git a/pass-pick b/pass-pick old mode 100644 new mode 100755 index 1a24de6..2453ba6 --- a/pass-pick +++ b/pass-pick @@ -40,8 +40,8 @@ # Passes along any options given to main script. rofi_opts=("$@") _picker() { - if [ -n "$PICKER" ]; then - "${PICKER[@]}" + if [ -n "$PICKER_BACKEND" ]; then + "${PICKER_BACKEND[@]}" elif command -v rofi 1>/dev/null 2>/dev/null; then rofi -dmenu -no-auto-select -i "${rofi_opts[@]}" "$@" -p "entry" elif command -v bemenu 1>/dev/null 2>/dev/null; then @@ -92,7 +92,7 @@ set_defaults() { # PP_CONFIGURATION_FILE="~/.config/pass-picker/pass-picker.conf" # set options, leaving already set environment variables intact # try to read any settings from config files - PICKER="${PP_PICKER:-$(get_config PICKER)}" + PICKER_BACKEND="${PP_PICKER_BACKEND:-$(get_config PICKER_BACKEND)}" KEY_AUTOFILL="${PP_KEY_AUTOFILL:-$(get_config KEY_AUTOFILL Return)}" KEY_ENTRY_OPEN="${PP_KEY_ENTRY_OPEN:-$(get_config KEY_ENTRY_OPEN Alt+Return)}" @@ -386,4 +386,3 @@ main() { set_defaults main -