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
This commit is contained in:
Marty Oehme 2021-12-18 16:30:59 +01:00
parent 9c22913cec
commit e6732ad8ad
Signed by: Marty
GPG key ID: B7538B8F50A1C800
2 changed files with 4 additions and 5 deletions

View file

@ -158,7 +158,7 @@ Additional configuration options with their default values:
--- ---
* `PICKER` \ * `PICKER_BACKEND` \
sets the tool to be used as interactive menu. 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`. 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`.

7
pass-pick Normal file → Executable file
View file

@ -40,8 +40,8 @@
# Passes along any options given to main script. # Passes along any options given to main script.
rofi_opts=("$@") rofi_opts=("$@")
_picker() { _picker() {
if [ -n "$PICKER" ]; then if [ -n "$PICKER_BACKEND" ]; then
"${PICKER[@]}" "${PICKER_BACKEND[@]}"
elif command -v rofi 1>/dev/null 2>/dev/null; then elif command -v rofi 1>/dev/null 2>/dev/null; then
rofi -dmenu -no-auto-select -i "${rofi_opts[@]}" "$@" -p "entry" rofi -dmenu -no-auto-select -i "${rofi_opts[@]}" "$@" -p "entry"
elif command -v bemenu 1>/dev/null 2>/dev/null; then 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" # PP_CONFIGURATION_FILE="~/.config/pass-picker/pass-picker.conf"
# set options, leaving already set environment variables intact # set options, leaving already set environment variables intact
# try to read any settings from config files # 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_AUTOFILL="${PP_KEY_AUTOFILL:-$(get_config KEY_AUTOFILL Return)}"
KEY_ENTRY_OPEN="${PP_KEY_ENTRY_OPEN:-$(get_config KEY_ENTRY_OPEN Alt+Return)}" KEY_ENTRY_OPEN="${PP_KEY_ENTRY_OPEN:-$(get_config KEY_ENTRY_OPEN Alt+Return)}"
@ -386,4 +386,3 @@ main() {
set_defaults set_defaults
main main