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

style(status): use @catppuccin_status_background as background color #367

Merged
merged 6 commits into from
Oct 12, 2024
Merged

style(status): use @catppuccin_status_background as background color #367

merged 6 commits into from
Oct 12, 2024

Conversation

dreknix
Copy link
Contributor

@dreknix dreknix commented Oct 8, 2024

When changing the background of the status bar, I think the default background color of all modules should be this color.

Therefore, the hard coded references to default and thm_surface_1 in utils/status_module.conf should be in my opinion changed to ${CTP_MESSAGE_BACKGROUND}. With this changes the background color of the status bar is always the same.

I'm not so familiar with the new tmux configuration style. I hope that this is the correct way to solve the problem.

Copy link
Collaborator

@kjnsn kjnsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to make a PR!

Are you fixing a specific bug? And/or do you have before and after screenshots?

Why is default wrong? I agree that hardcoding surface 1 should probably change.

Also where did ${CTP_MESSAGE_BACKGROUND} come from? Where is that environment variable set?

@dreknix
Copy link
Contributor Author

dreknix commented Oct 8, 2024

I want the status bar to have a consistent color, when setting @catpuccin_status_background, e.g., to @thm_surface_0. The status bar and all modules should have the same background color.

Before

before

After

after

The variable ${CTP_MESSAGE_BACKGROUND} comes from the file catppuccin_tmux.conf. The content of the variable depends on the setting of @catppuccin_status_background.

But maybe it is better to change the hardcoded @thm_surface_1 into a tmux variable like @catppuccin_status_default_background.

@qwrtln
Copy link

qwrtln commented Oct 8, 2024

Not sure if it's related, but since 0.4 I can't seem to get transparent background to work. It's one of the reasons I've pinned to 0.3.

@dreknix Can you share your tmux.conf for that layout? I couldn't migrate to 0.4 successfully.

@kjnsn
Copy link
Collaborator

kjnsn commented Oct 8, 2024

I want the status bar to have a consistent color, when setting @catpuccin_status_background, e.g., to @thm_surface_0. The status bar and all modules should have the same background color.

Yep sounds reasonable.

The variable ${CTP_MESSAGE_BACKGROUND} comes from the file catppuccin_tmux.conf. The content of the variable depends on the setting of @catppuccin_status_background.

Ah that's meant to be local and not exported.

But maybe it is better to change the hardcoded @thm_surface_1 into a tmux variable like @catppuccin_status_default_background.

What happens if you use default? The status line is already styled, I don't want to duplicate that if possible

@dreknix
Copy link
Contributor Author

dreknix commented Oct 8, 2024

Here is my minimal tmux.conf

set -g default-terminal 'screen-256color'
set -g base-index 1
set -g pane-base-index 1

set-option -g status-position top

set -g @catppuccin_window_status_style "rounded"
set -g @catppuccin_status_background "#{@thm_surface_0}"

run ~/.local/share/tmux/plugins/tmux/catppuccin.tmux

set -g status-left "#{E:@catppuccin_status_session}"
set -g status-right "#{E:@catppuccin_status_host}"
set -ag status-right "#{E:@catppuccin_status_date_time}"

@dreknix
Copy link
Contributor Author

dreknix commented Oct 8, 2024

The variable ${CTP_MESSAGE_BACKGROUND} comes from the file catppuccin_tmux.conf. The content of the variable depends on the setting of @catppuccin_status_background.

Ah that's meant to be local and not exported.

Ok, good to know.

But maybe it is better to change the hardcoded @thm_surface_1 into a tmux variable like @catppuccin_status_default_background.

What happens if you use default? The status line is already styled, I don't want to duplicate that if possible

When I use default than in line 27 in utils/status_module.conf the default foreground color is used. Therefore, a variable is needed which stores the default color of the status bar if set.

Since ${CTP_MESSAGE_BACKGROUND} should be local, I will change my PR, to reflect this discussion.

@dreknix
Copy link
Contributor Author

dreknix commented Oct 8, 2024

I changed the PR to use a new variable @catppuccin_status_default_background instead of the hard coded color @thm_surface_1. With this change the status bar and the modules can have the same color by setting both variables:

set -g @catppuccin_status_background '#{@thm_surface_0}'
set -g @catppuccin_status_default_background '#{@thm_surface_0}'

Thanks a lot for the discussion and the great plugin.

catppuccin_options_tmux.conf Outdated Show resolved Hide resolved
@kjnsn kjnsn merged commit 4dd824c into catppuccin:main Oct 12, 2024
1 of 2 checks passed
@kjnsn
Copy link
Collaborator

kjnsn commented Oct 12, 2024

Thank you so much!

pauldthomson pushed a commit to pauldthomson/tmux that referenced this pull request Nov 14, 2024
…atppuccin#367)

* style(status): use @catppuccin_status_background as background color

* fix: color must be expanded for test cases

* fix: color must be expanded for test cases

* Update catppuccin_options_tmux.conf

* Reuse @catppuccin_status_background to determine the correct status line background color

---------

Co-authored-by: Christoph Weyer <[email protected]>
Co-authored-by: Kaley Main <[email protected]>
Co-authored-by: Kaley Main <[email protected]>
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.

3 participants