From a115b3c8dd2f0c0a49274f69f80e85d5eed9ff76 Mon Sep 17 00:00:00 2001 From: Kaley Main Date: Fri, 27 Sep 2024 22:54:31 +1000 Subject: [PATCH] Fix the status module builder and tests --- tests/application_module_expected.txt | 2 +- utils/status_module.conf | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/application_module_expected.txt b/tests/application_module_expected.txt index 9e999038..af167fc4 100644 --- a/tests/application_module_expected.txt +++ b/tests/application_module_expected.txt @@ -1 +1 @@ -E:@catppuccin_status_application #[fg=#f5c2e7,bg=default,nobold,nounderscore,noitalics]#[fg=#11111b,bg=#f5c2e7] #[fg=#cdd6f4,bg=#45475a,nobold] #[fg=#45475a,bg=default]█ +E:@catppuccin_status_application #[fg=#f5c2e7,nobold,nounderscore,noitalics]#[fg=#11111b,bg=#f5c2e7] #[fg=#f5c2e7,bg=#45475a]#[fg=#cdd6f4] #[fg=#45475a]█ diff --git a/utils/status_module.conf b/utils/status_module.conf index 2b751815..47406d11 100644 --- a/utils/status_module.conf +++ b/utils/status_module.conf @@ -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 @@ -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