Allow customize key otpions

This commit is contained in:
Ferran Basora 2021-03-07 11:48:32 +00:00
parent 403be0fd1d
commit 8f95d2b6d2
2 changed files with 15 additions and 2 deletions

View File

@ -112,6 +112,16 @@ For example:
set -g @thumbs-key F set -g @thumbs-key F
``` ```
### @thumbs-key-options
Choose which arguments do you want for your key.
For example:
```
set -g @thumbs-key-options -n
```
### @thumbs-alphabet ### @thumbs-alphabet
`default: qwerty` `default: qwerty`

View File

@ -2,12 +2,15 @@
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DEFAULT_THUMBS_KEY=space DEFAULT_THUMBS_KEY_OPTIONS=""
THUMBS_KEY_OPTIONS="$(tmux show-option -gqv @thumbs-key-options)"
THUMBS_KEY_OPTIONS=${THUMBS_KEY_OPTIONS:-$DEFAULT_THUMBS_KEY_OPTIONS}
DEFAULT_THUMBS_KEY=space
THUMBS_KEY="$(tmux show-option -gqv @thumbs-key)" THUMBS_KEY="$(tmux show-option -gqv @thumbs-key)"
THUMBS_KEY=${THUMBS_KEY:-$DEFAULT_THUMBS_KEY} THUMBS_KEY=${THUMBS_KEY:-$DEFAULT_THUMBS_KEY}
tmux bind-key "${THUMBS_KEY}" run-shell -b "${CURRENT_DIR}/tmux-thumbs.sh" tmux bind-key ${THUMBS_KEY_OPTIONS:+"$THUMBS_KEY_OPTIONS"} ${THUMBS_KEY:+"$THUMBS_KEY"} run-shell -b "${CURRENT_DIR}/tmux-thumbs.sh"
BINARY="${CURRENT_DIR}/target/release/thumbs" BINARY="${CURRENT_DIR}/target/release/thumbs"