Is there an existing issue outlining your improvement?
What would you like to see added and/or changed?
#500 introduced the @catppuccin_reset option, which would reset most theme options. This is especially useful with the new tmux client-light-theme and client-dark-theme hooks.
However, with the current capabilities, users are not able to override any theme options if they wish to use the new tmux hooks: any user-defined options would be wiped by the @catppuccin_reset instruction.
Proposal: if @catppuccin_reset is enabled, the plugin resets all catppuccin_* and @thm_* options, and nothing else. This allows users to customize options as follows:
set-hook -g client-dark-theme {
# First, reset all options.
set -g @catppuccin_reset "true"
run ~/code/github.com/catppuccin/tmux/catppuccin.tmux
set -g @catppuccin_flavor "frappe"
set -g @thm_red "red"
set -g @catppuccin_host_icon " H "
# etc.
run ~/code/github.com/catppuccin/tmux/catppuccin.tmux
}
set-hook -g client-light-theme {
# First, reset all options.
set -g @catppuccin_reset "true"
run ~/code/github.com/catppuccin/tmux/catppuccin.tmux
set -g @catppuccin_flavor "latte"
set -g @thm_red "red"
set -g @catppuccin_host_icon " H "
# etc.
run ~/code/github.com/catppuccin/tmux/catppuccin.tmux
}
The plugin entry script could be updated as follows:
#!/usr/bin/env bash
# Set path of script
PLUGIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ "$(tmux show -gvq @catppuccin_reset)" == 'true' ]]; then
# Reset all options.
opts="$(tmux show -gq | cut -d ' ' -f 1 | grep -E '@catppuccin|@thm')"
for opt in ${opts}; do
tmux set -Ugq "${opt}"
done
else
# Otherwise, load the plugin.
tmux source "${PLUGIN_DIR}/catppuccin_options_tmux.conf"
tmux source "${PLUGIN_DIR}/catppuccin_tmux.conf"
fi
This additionally provides a complete plugin reset, so users no longer need to visually inspect tmux to find stale colors or options that need explicit resetting.
Is there an existing issue outlining your improvement?
What would you like to see added and/or changed?
#500 introduced the
@catppuccin_resetoption, which would reset most theme options. This is especially useful with the newtmuxclient-light-themeandclient-dark-themehooks.However, with the current capabilities, users are not able to override any theme options if they wish to use the new
tmuxhooks: any user-defined options would be wiped by the@catppuccin_resetinstruction.Proposal: if
@catppuccin_resetis enabled, the plugin resets allcatppuccin_*and@thm_*options, and nothing else. This allows users to customize options as follows:set-hook -g client-dark-theme { # First, reset all options. set -g @catppuccin_reset "true" run ~/code/github.com/catppuccin/tmux/catppuccin.tmux set -g @catppuccin_flavor "frappe" set -g @thm_red "red" set -g @catppuccin_host_icon " H " # etc. run ~/code/github.com/catppuccin/tmux/catppuccin.tmux } set-hook -g client-light-theme { # First, reset all options. set -g @catppuccin_reset "true" run ~/code/github.com/catppuccin/tmux/catppuccin.tmux set -g @catppuccin_flavor "latte" set -g @thm_red "red" set -g @catppuccin_host_icon " H " # etc. run ~/code/github.com/catppuccin/tmux/catppuccin.tmux }The plugin entry script could be updated as follows:
This additionally provides a complete plugin reset, so users no longer need to visually inspect
tmuxto find stale colors or options that need explicit resetting.