Skip to content

Commit

Permalink
feat: replace @_ctp_status_bg with @thm_surface_0 in module configurt…
Browse files Browse the repository at this point in the history
…ion to properly show module separation (#380)

* fix: module bg color blending in with status line bg color preventing the seperator to be visible


---------

Co-authored-by: Kaley Main <[email protected]>
  • Loading branch information
xafarr and kjnsn authored Oct 19, 2024
1 parent 4bcc523 commit a4d4ad0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions catppuccin_options_tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ set -ogq @catppuccin_status_middle_separator ""
set -ogq @catppuccin_status_right_separator "█"
set -ogq @catppuccin_status_connect_separator "yes" # yes, no
set -ogq @catppuccin_status_fill "icon"
set -ogq @catppuccin_status_module_bg_color "#{@thm_surface_0}"
8 changes: 8 additions & 0 deletions status/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ set -g @catppuccin_[module_name]_icon "icon"
set -g @catppuccin_[module_name]_color "color"
```

#### Override the specific module background color

##### (NB: Only when `@catppuccin_status_fill` is `icon`)

```sh
set -g @catppuccin_status_[module_name]_bg_color "color"
```

#### Override the specific module text

```sh
Expand Down
2 changes: 1 addition & 1 deletion tests/application_module_expected.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@catppuccin_status_application #[fg=#f5c2e7,nobold,nounderscore,noitalics]#[fg=#11111b,bg=#f5c2e7] #[fg=#f5c2e7,bg=#181825]#[fg=#cdd6f4] #{E:@catppuccin_application_text}#[fg=#181825]█
@catppuccin_status_application #[fg=#f5c2e7,nobold,nounderscore,noitalics]#[fg=#11111b,bg=#f5c2e7] #[fg=#f5c2e7,bg=#313244]#[fg=#cdd6f4] #{E:@catppuccin_application_text}#[fg=#313244]█
2 changes: 1 addition & 1 deletion tests/battery_module_expected.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@catppuccin_status_battery #[fg=#f9e2af,nobold,nounderscore,noitalics]#[fg=#11111b,bg=#f9e2af]#{l:#{battery_icon}} #[fg=#f9e2af,bg=#181825]#[fg=#cdd6f4] #{E:@catppuccin_battery_text}#[fg=#181825]█
@catppuccin_status_battery #[fg=#f9e2af,nobold,nounderscore,noitalics]#[fg=#11111b,bg=#f9e2af]#{l:#{battery_icon}} #[fg=#f9e2af,bg=#313244]#[fg=#cdd6f4] #{E:@catppuccin_battery_text}#[fg=#313244]█
2 changes: 1 addition & 1 deletion tests/cpu_module_expected.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
E:@catppuccin_status_cpu #[fg=#{cpu_bg_color},nobold,nounderscore,noitalics]#[fg=#11111b,bg=#{cpu_bg_color}] #[fg=#{cpu_bg_color},bg=#181825]#[fg=#cdd6f4] #{cpu_percentage}#[fg=#181825]█
E:@catppuccin_status_cpu #[fg=#{cpu_bg_color},nobold,nounderscore,noitalics]#[fg=#11111b,bg=#{cpu_bg_color}] #[fg=#{cpu_bg_color},bg=#313244]#[fg=#cdd6f4] #{cpu_percentage}#[fg=#313244]█
10 changes: 8 additions & 2 deletions utils/status_module.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
set -gqF @_ctp_connect_style \
"#{?#{==:#{@catppuccin_status_connect_separator},yes},,#[bg=default]}"

%if "#{==:#{@catppuccin_status_${MODULE_NAME}_bg_color},}"
set -gqF @_ctp_module_bg_color "#{E:@catppuccin_status_module_bg_color}"
%else
set -gqF @_ctp_module_bg_color "#{E:@catppuccin_status_${MODULE_NAME}_bg_color}"
%endif

set -gF "@catppuccin_status_${MODULE_NAME}" \
"#[fg=#{@catppuccin_${MODULE_NAME}_color},nobold,nounderscore,noitalics]#{@_ctp_connect_style}#{@catppuccin_status_left_separator}"

Expand All @@ -16,15 +22,15 @@ set -agF "@catppuccin_status_${MODULE_NAME}" "#[fg=#{@catppuccin_${MODULE_NAME}_
# If _only_ the icon should be filled in, then change the background
# to catppuccin_status_default_background, and the foreground to crust. Otherwise leave the formatting as-is.
%if "#{==:#{@catppuccin_status_fill},icon}"
set -agF "@catppuccin_status_${MODULE_NAME}" "bg=#{E:@_ctp_status_bg}]#{@catppuccin_status_middle_separator}#[fg=#{@thm_fg}] "
set -agF "@catppuccin_status_${MODULE_NAME}" "bg=#{@_ctp_module_bg_color}]#{@catppuccin_status_middle_separator}#[fg=#{@thm_fg}] "
%else
set -agF "@catppuccin_status_${MODULE_NAME}" "]#{@catppuccin_status_middle_separator}#[fg=#{@thm_crust}]"
%endif

set -ag "@catppuccin_status_${MODULE_NAME}" "#{E:@catppuccin_${MODULE_NAME}_text}"

%if "#{==:#{@catppuccin_status_fill},icon}"
set -agF "@catppuccin_status_${MODULE_NAME}" "#[fg=#{E:@_ctp_status_bg}]"
set -agF "@catppuccin_status_${MODULE_NAME}" "#[fg=#{@_ctp_module_bg_color}]"
%else
set -agF "@catppuccin_status_${MODULE_NAME}" "#[fg=#{@catppuccin_${MODULE_NAME}_color}]"
%endif
Expand Down

0 comments on commit a4d4ad0

Please sign in to comment.