Skip to content

Commit

Permalink
Fix the status module builder and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kjnsn committed Sep 27, 2024
1 parent df8411c commit a115b3c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/application_module_expected.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
E:@catppuccin_status_application #[fg=#f5c2e7,bg=default,nobold,nounderscore,noitalics]#[fg=#11111b,bg=#f5c2e7] #[fg=#cdd6f4,bg=#45475a,nobold] <application>#[fg=#45475a,bg=default]█
E:@catppuccin_status_application #[fg=#f5c2e7,nobold,nounderscore,noitalics]#[fg=#11111b,bg=#f5c2e7] #[fg=#f5c2e7,bg=#45475a]#[fg=#cdd6f4] <application>#[fg=#45475a]█
14 changes: 10 additions & 4 deletions utils/status_module.conf
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# vim:set ft=tmux:

set -gqF @_ctp_connect_color_bg "#{?#{==:#{@catppuccin_status_connect_separator},yes},,bg=default}"
# Embedded style that ensures that modules look "connected"
# when required.
set -gqF @_ctp_connect_style \
"#{?#{==:#{@catppuccin_status_connect_separator},yes},,#[bg=default]}"

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

set -agF "@catppuccin_status_${MODULE_NAME}" \
"#[fg=#{@thm_crust},bg=#{@catppuccin_${MODULE_NAME}_color}]#{@catppuccin_${MODULE_NAME}_icon}"

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.
%if "#{==:#{@catppuccin_status_fill},icon}"
set -agF "@catppuccin_status_${MODULE_NAME}" "bg=#{@thm_surface_1}]#{@catppuccin_status_middle_separator}#[fg=#{@thm_fg}] "
%else
Expand All @@ -23,6 +29,6 @@ set -agF "@catppuccin_status_${MODULE_NAME}" "#{@catppuccin_${MODULE_NAME}_text}
set -agF "@catppuccin_status_${MODULE_NAME}" "#[fg=#{@catppuccin_${MODULE_NAME}_color}]"
%endif

set -agF "@catppuccin_status_${MODULE_NAME}" "#[#{@_ctp_connect_color_bg}]#{@catppuccin_status_right_separator}"
set -agF "@catppuccin_status_${MODULE_NAME}" "#{@_ctp_connect_style}#{@catppuccin_status_right_separator}"

set -ug @_ctp_connect_color_bg
set -ug @_ctp_connect_style

0 comments on commit a115b3c

Please sign in to comment.