From 362a306db71794f04d0995fc058bcaa094d1af70 Mon Sep 17 00:00:00 2001 From: vdbe <44153531+vdbe@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:57:45 +0000 Subject: [PATCH] feat: warn users of whitespace in module lists (#266) --- README.md | 2 +- utils/module_utils.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index abe5b69..d279a3f 100644 --- a/README.md +++ b/README.md @@ -308,7 +308,7 @@ set -g @catppuccin_pane_background_color "#{thm_orange}" #### Set the module list ```sh set -g @catppuccin_status_modules_right "application session" -set -g @catppuccin_status_modules_left "" +set -g @catppuccin_status_modules_left "null" ``` Provide a list of modules and the order in which you want them to appear in the status. diff --git a/utils/module_utils.sh b/utils/module_utils.sh index e9d77f9..8362780 100644 --- a/utils/module_utils.sh +++ b/utils/module_utils.sh @@ -32,6 +32,16 @@ load_modules() { continue 2 fi done + + if [[ -z "${module_name/ }" ]]; then + if [[ -z "${modules_list/ }" ]]; then + tmux_echo "catppuccin warning: a module list has only white space, to remove all modules set it to \"null\"" + else + tmux_echo "catppuccin warning: a module list with value \"$modules_list\" has leading/trailing whitespace" + fi + continue + fi + tmux_echo "catppuccin warning: module $module_name not found"