From 0f19833001a53b5da6aea5996a4af83a114b5346 Mon Sep 17 00:00:00 2001 From: Maciej Sypien Date: Sat, 21 Sep 2024 21:02:23 +0200 Subject: [PATCH] feat: when theme enabled and not set it default to dark256 --- src/gruvbox-main.sh | 21 ++++++++++++++++++--- tests/run_all_linux_tests.sh | 1 + tests/tmux_helpers.sh | 4 ++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/gruvbox-main.sh b/src/gruvbox-main.sh index aac1460..0773393 100755 --- a/src/gruvbox-main.sh +++ b/src/gruvbox-main.sh @@ -18,9 +18,24 @@ get_theme() { } main() { - local theme - theme=$(get_theme "$THEME_OPTION" "$DEFAULT_THEME") - tmux source-file "$CURRENT_DIR/tmux-gruvbox-${theme}.conf" + local _theme _path + _theme=$(get_theme "$THEME_OPTION" "$DEFAULT_THEME") + case "$_theme" in + light-transparent) + _theme="light-transparent" + ;; + dark-transparent) + _theme="dark-transparent" + ;; + light | light256) + _theme="light" + ;; + dark | dark256 | *) + _theme="dark" + ;; + esac + + tmux source-file "${CURRENT_DIR}/tmux-gruvbox-${_theme}.conf" } main "$@" diff --git a/tests/run_all_linux_tests.sh b/tests/run_all_linux_tests.sh index 317a2a0..85a9c25 100755 --- a/tests/run_all_linux_tests.sh +++ b/tests/run_all_linux_tests.sh @@ -12,6 +12,7 @@ main() { printf "\n==============================================" printf "\n %s" "$test" printf "\n==============================================" + printf "" bash -c "$test" # run all and count failures diff --git a/tests/tmux_helpers.sh b/tests/tmux_helpers.sh index 3a6128a..c07f217 100644 --- a/tests/tmux_helpers.sh +++ b/tests/tmux_helpers.sh @@ -28,8 +28,8 @@ helper_print_fail() { local _current_val="${2}" local _expected_val="${3}" printf "FAIL. %s\n" "${_msg}" - printf "current value:\t%s" "$_current_val" - printf "expected value:\t%s" "$_expected_val" + printf "current value:\t%s\n" "$_current_val" + printf "expected value:\t%s\n" "$_expected_val" } helper_print_success() {