diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 93782ebf..098bf37d 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -976,3 +976,14 @@ set -g @dracula-weather-hide-errors true For testing/ running custom plugins, put the bash script into the scripts directory of dracula/tmux plugin. Additionally, in the `@dracula-plugins` option, add the script as `custom:name-of-script.sh`. + +Each custom plugin can have its own colors, just like a packaged plugin, by setting +`@dracula-custom--colors "bg fg"`, using the full script name including any file +extension (e.g. `@dracula-custom-docker.sh-colors`). The `custom-` prefix avoids clashing with a +packaged plugin's own `@dracula--colors` option, should one exist. If unset, it +falls back to `@dracula-custom-plugin-colors "bg fg"`, and then to dracula defaults. + +```bash +set -g @dracula-plugins "custom:docker.sh" +set -g @dracula-custom-docker.sh-colors "blue dark_gray" +``` diff --git a/docs/color_theming/README.md b/docs/color_theming/README.md index 1b3fe04b..5d60ed29 100644 --- a/docs/color_theming/README.md +++ b/docs/color_theming/README.md @@ -5,6 +5,7 @@ set -g @dracula-attached-clients-colors "cyan dark_gray" set -g @dracula-battery-colors "pink dark_gray" set -g @dracula-continuum-colors "cyan dark_gray" set -g @dracula-cpu-usage-colors "orange dark_gray" +set -g @dracula-custom--colors "cyan dark_gray" set -g @dracula-custom-plugin-colors "cyan dark_gray" set -g @dracula-cwd-colors "dark_gray white" set -g @dracula-fossil-colors "green dark_gray" @@ -31,6 +32,8 @@ set -g @dracula-tmux-ram-usage-colors "cyan dark_gray" set -g @dracula-weather-colors "orange dark_gray" ``` +per-plugin colors for custom scripts are covered in [custom:script-name](/docs/CONFIG.md#customscript-name---up). + # overriding color variables all dracula colors can be overridden and new variables can be added. diff --git a/scripts/dracula.sh b/scripts/dracula.sh index be75feb6..dd327695 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -196,7 +196,8 @@ main() { if case $plugin in custom:*) true;; *) false;; esac; then script=${plugin#"custom:"} if [[ -x "${current_dir}/${script}" ]]; then - IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-custom-plugin-colors" "cyan dark_gray") + default_custom_plugin_colors=$(get_tmux_option "@dracula-custom-plugin-colors" "cyan dark_gray") + IFS=' ' read -r -a colors <<<"$(get_tmux_option "@dracula-custom-${script}-colors" "$default_custom_plugin_colors")" script="#($current_dir/${script})" else colors[0]="red"