Skip to content

Commit

Permalink
style(status): use @catppuccin_status_background as background color (#…
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
4 people authored Oct 12, 2024
1 parent da28bb2 commit 4dd824c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
30 changes: 18 additions & 12 deletions catppuccin_tmux.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
source -F "#{d:current_file}/themes/catppuccin_#{@catppuccin_flavor}_tmux.conf"

%if "#{==:#{@catppuccin_status_background},default}"
set -gF @_ctp_status_bg "#{@thm_surface_1}"
set -gF status-style "bg=#{@_ctp_status_bg},fg=#{@thm_fg}"

%hidden CTP_MESSAGE_BACKGROUND="#{@thm_surface_0}"
%elif "#{==:#{@catppuccin_status_background},none}"
set -g status-style "default"
set -g @_ctp_status_bg "none"

%hidden CTP_MESSAGE_BACKGROUND="default"
%else
# Treat @catppuccin_status_background as a format string.
set -gF status-style "bg=#{E:@catppuccin_status_background},fg=#{@thm_fg}"
set -gF @_ctp_status_bg "#{E:@catppuccin_status_background}"

%hidden CTP_MESSAGE_BACKGROUND="#{E:@catppuccin_status_background}"
%endif

source -F "#{d:current_file}/status/application.conf"
source -F "#{d:current_file}/status/battery.conf"
source -F "#{d:current_file}/status/clima.conf"
Expand All @@ -16,18 +34,6 @@ source -F "#{d:current_file}/status/uptime.conf"
source -F "#{d:current_file}/status/user.conf"
source -F "#{d:current_file}/status/weather.conf"

%if "#{==:#{@catppuccin_status_background},default}"
set -gF status-style "bg=#{@thm_bg},fg=#{@thm_fg}"
%hidden CTP_MESSAGE_BACKGROUND="#{@thm_surface_0}"
%elif "#{==:#{@catppuccin_status_background},none}"
%hidden CTP_MESSAGE_BACKGROUND="default"
set -g status-style "$CTP_MESSAGE_BACKGROUND"
%else
# Treat @catppuccin_status_background as a format string.
%hidden CTP_MESSAGE_BACKGROUND="#{E:@catppuccin_status_background}"
set -gF status-style "bg=$CTP_MESSAGE_BACKGROUND,fg=#{@thm_fg}"
%endif

# messages
set -gF message-style "fg=#{@thm_sky},bg=$CTP_MESSAGE_BACKGROUND,align=centre"
set -gF message-command-style "fg=#{@thm_sky},bg=$CTP_MESSAGE_BACKGROUND,align=centre"
Expand Down
6 changes: 3 additions & 3 deletions utils/status_module.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ set -agF "@catppuccin_status_${MODULE_NAME}" \
set -agF "@catppuccin_status_${MODULE_NAME}" "#[fg=#{@catppuccin_${MODULE_NAME}_color},"

# If _only_ the icon should be filled in, then change the background
# to surface_1, and the foreground to crust. Otherwise leave the formatting as-is.
# 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=#{@thm_surface_1}]#{@catppuccin_status_middle_separator}#[fg=#{@thm_fg}] "
set -agF "@catppuccin_status_${MODULE_NAME}" "bg=#{E:@_ctp_status_bg}]#{@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=#{@thm_surface_1}]"
set -agF "@catppuccin_status_${MODULE_NAME}" "#[fg=#{E:@_ctp_status_bg}]"
%else
set -agF "@catppuccin_status_${MODULE_NAME}" "#[fg=#{@catppuccin_${MODULE_NAME}_color}]"
%endif
Expand Down

0 comments on commit 4dd824c

Please sign in to comment.