diff --git a/README.md b/README.md index 6711e84..2e88650 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,21 @@ icons: cmatrix: "🤯" # add new entries that aren't included ``` +### Custom Configuration File Path + +By default, the plugin looks for the configuration file at: + +```sh +~/.config/tmux/tmux-nerd-font-window-name.yml +``` + +You can override this path by adding the following line to your +tmux.conf file: + +```sh +set -g @tmux-nerd-font-window-name-config-file "/your/custom/path.yml" +``` + ## Contributions Contributions are welcome! Feel free to make a pull request to submit more diff --git a/bin/tmux-nerd-font-window-name b/bin/tmux-nerd-font-window-name index 1740ba3..45d099a 100755 --- a/bin/tmux-nerd-font-window-name +++ b/bin/tmux-nerd-font-window-name @@ -11,7 +11,10 @@ NAME="$1" PANES="$2" CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" DEFAULT_CONFIG="$CURRENT_DIR/defaults.yml" -USER_CONFIG="$HOME/.config/tmux/tmux-nerd-font-window-name.yml" + +# Allow overriding user config path via tmux option +USER_CONFIG=$(tmux show-option -gqv @tmux-nerd-font-window-name-config-file) +USER_CONFIG=${USER_CONFIG:-"$HOME/.config/tmux/tmux-nerd-font-window-name.yml"} # Function to retrieve a configuration value get_config_value() {