Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Issue #407 and dynamic colors in status modules #411

Merged
merged 4 commits into from
Oct 25, 2024

Conversation

dreknix
Copy link
Contributor

@dreknix dreknix commented Oct 24, 2024

This PR fixes the issue #407 and enables dynamic color for text and icon in status modules.

E.g. the following custom module:

%hidden MODULE_NAME='memory'

# see https://github.com/tmux-plugins/tmux-cpu
set-option -ogq '@ram_low_bg_color' '#{E:@thm_green}'
set-option -ogq '@ram_medium_bg_color' '#{E:@thm_yellow}'
set-option -ogq '@ram_high_bg_color' '#{E:@thm_red}'

set-option -ogq "@catppuccin_${MODULE_NAME}_icon" '<U+E266> '
set-option -ogq "@catppuccin_${MODULE_NAME}_color" '#{l:#{ram_bg_color}}'
set-option -ogq "@catppuccin_${MODULE_NAME}_text" ' #{l:#{ram_percentage}}'

source-file -F '#{TMUX_PLUGIN_MANAGER_PATH}/tmux/utils/status_module.conf'

Results in the following status bar:

With the PR the expansions for the color parts in utils/status_module.conf are removed and the color can by changed dynamically:


Therefore, the color handling in the existing status modules must be unified (using set -F and E:).

@kjnsn kjnsn merged commit 5e273e4 into catppuccin:main Oct 25, 2024
2 checks passed
@dreknix dreknix deleted the fix-407 branch October 25, 2024 07:43
pauldthomson pushed a commit to pauldthomson/tmux that referenced this pull request Nov 14, 2024
…es issue catppuccin#407

* fix: allow also dynamic background when setting @catppuccin_${MODULE_NAME}_color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants