diff --git a/scripts/config.sh b/scripts/config.sh index 112857f..c3b9a69 100755 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -94,6 +94,8 @@ fingers_defaults=( \ [fingers-hint-position-nocompact]="right" \ [fingers-hint-format-nocompact]="#[fg=yellow,bold][%s]" \ [fingers-highlight-format-nocompact]="#[fg=yellow,nobold,dim]%s" \ + + [fingers-keyboard-layout]="qwerty" \ ) set_tmux_env 'fingers-patterns' @@ -109,6 +111,7 @@ set_tmux_env 'fingers-hint-position-nocompact' set_tmux_env 'fingers-hint-format-nocompact' process_format set_tmux_env 'fingers-highlight-format-nocompact' process_format +set_tmux_env 'fingers-keyboard-layout' for option in fingers-{hint,highlight}-format{,-nocompact}; do env_name="$(envify "$option")_NOCOLOR" diff --git a/scripts/hinter.awk b/scripts/hinter.awk index 0c5bfb8..1ee2802 100644 --- a/scripts/hinter.awk +++ b/scripts/hinter.awk @@ -74,8 +74,7 @@ BEGIN { } END { - # TODO read alphabet root dir from ENVIRON - hints_path = "/home/morantron/hacking/tmux-fingers/alphabets/qwerty/" n_matches + hints_path = ENVIRON["FINGERS_ALPHABET_DIR"] n_matches getline raw_hints < hints_path split(raw_hints, hints, " ") diff --git a/scripts/hints.sh b/scripts/hints.sh index ccdaedf..eeed009 100755 --- a/scripts/hints.sh +++ b/scripts/hints.sh @@ -31,8 +31,10 @@ function show_hints() { local fingers_pane_id=$1 local compact_hints=$2 + FINGERS_ALPHABET_DIR="$CURRENT_DIR/../alphabets/$FINGERS_KEYBOARD_LAYOUT/" + clear_screen "$fingers_pane_id" - get_stdin | FINGERS_COMPACT_HINTS="$compact_hints" gawk -f $CURRENT_DIR/hinter.awk 3> $match_lookup_table + get_stdin | FINGERS_COMPACT_HINTS="$compact_hints" FINGERS_ALPHABET_DIR="$FINGERS_ALPHABET_DIR" gawk -f $CURRENT_DIR/hinter.awk 3> $match_lookup_table } function show_hints_and_swap() {