diff --git a/scripts/config.sh b/scripts/config.sh index a1af56d..d8400aa 100755 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -82,6 +82,7 @@ fingers_defaults=( \ [fingers-patterns]="$PATTERNS" \ [fingers-compact-hints]=1 \ [fingers-copy-command]="" \ + [fingers-copy-command-uppercase]="" \ [fingers-hint-position]="left" \ [fingers-hint-format]="#[fg=yellow,bold]%s" \ @@ -95,6 +96,7 @@ fingers_defaults=( \ set_tmux_env 'fingers-patterns' set_tmux_env 'fingers-compact-hints' set_tmux_env 'fingers-copy-command' +set_tmux_env 'fingers-copy-command-uppercase' set_tmux_env 'fingers-hint-position' set_tmux_env 'fingers-hint-format' process_format diff --git a/scripts/fingers.sh b/scripts/fingers.sh index 3ae0855..5673e8f 100755 --- a/scripts/fingers.sh +++ b/scripts/fingers.sh @@ -111,8 +111,11 @@ function copy_result() { exec_prefix="" fi - if [ ! -z "$FINGERS_COPY_COMMAND" ]; then - is_uppercase=$(echo "$input" | grep -E '^[a-z]+$' &> /dev/null; echo $?) + is_uppercase=$(echo "$input" | grep -E '^[a-z]+$' &> /dev/null; echo $?) + + if [[ $is_uppercase == "1" ]] && [ ! -z "$FINGERS_COPY_COMMAND_UPPERCASE" ]; then + tmux run-shell -b "echo -n \"$result\" | IS_UPPERCASE=$is_uppercase HINT=$hint $exec_prefix $FINGERS_COPY_COMMAND_UPPERCASE > /dev/null" + elif [ ! -z "$FINGERS_COPY_COMMAND" ]; then tmux run-shell -b "echo -n \"$result\" | IS_UPPERCASE=$is_uppercase HINT=$hint $exec_prefix $FINGERS_COPY_COMMAND > /dev/null" fi