Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<name-of-script>-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-<name-of-script>-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"
```
3 changes: 3 additions & 0 deletions docs/color_theming/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<name-of-script>-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"
Expand All @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion scripts/dracula.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading