diff --git a/src/gruvbox-main.sh b/src/gruvbox-main.sh index bfde3cd..5dbba7e 100755 --- a/src/gruvbox-main.sh +++ b/src/gruvbox-main.sh @@ -35,53 +35,53 @@ DEFAULT_RIGHT_STATUS_Y='%H:%M' DEFAULT_RIGHT_STATUS_Z='#h' main() { - TMUX_CMDS=() # clear + TMUX_CMDS=() # clear - # load proper palette for the theme asap to avoid additional variable interpolation - local _theme - _theme=$(tmux_get_option "${TMUX_GRUVBOX}" "${DEFAULT_THEME}") - _statusbar_alpha=$(tmux_get_option "${TMUX_GRUVBOX_STATUSBAR_ALPHA}" "${DEFAULT_STATUSBAR_ALPHA}") + # load proper palette for the theme asap to avoid additional variable interpolation + local _theme + _theme=$(tmux_get_option "${TMUX_GRUVBOX}" "${DEFAULT_THEME}") + _statusbar_alpha=$(tmux_get_option "${TMUX_GRUVBOX_STATUSBAR_ALPHA}" "${DEFAULT_STATUSBAR_ALPHA}") - case "$_theme" in - light | light256) - # shellcheck disable=1091 - source "${CURRENT_DIR}/src/palette_gruvbox_light.sh" - # shellcheck disable=1091 - source "${CURRENT_DIR}/src/theme_gruvbox_light256.sh" - ;; - dark | dark256 | *) - # shellcheck disable=1091 - source "${CURRENT_DIR}/src/palette_gruvbox_dark.sh" - # shellcheck disable=1091 - source "${CURRENT_DIR}/src/theme_gruvbox_dark256.sh" - ;; - esac + case "$_theme" in + light | light256) + # shellcheck disable=1091 + source "${CURRENT_DIR}/src/palette_gruvbox_light.sh" + # shellcheck disable=1091 + source "${CURRENT_DIR}/src/theme_gruvbox_light256.sh" + ;; + dark | dark256 | *) + # shellcheck disable=1091 + source "${CURRENT_DIR}/src/palette_gruvbox_dark.sh" + # shellcheck disable=1091 + source "${CURRENT_DIR}/src/theme_gruvbox_dark256.sh" + ;; + esac - local _status_left _status_right _window_status_current_format _window_status_format - _status_left_a=$(tmux_get_option "$TMUX_GRUVBOX_LEFT_STATUS_A" "$DEFAULT_LEFT_STATUS_A") - _status_right_x=$(tmux_get_option "$TMUX_GRUVBOX_RIGHT_STAUTS_X" "$DEFAULT_RIGHT_STATUS_X") - _status_right_y=$(tmux_get_option "$TMUX_GRUVBOX_RIGHT_STAUTS_Y" "$DEFAULT_RIGHT_STATUS_Y") - _status_right_z=$(tmux_get_option "$TMUX_GRUVBOX_RIGHT_STAUTS_Z" "$DEFAULT_RIGHT_STATUS_Z") + local _status_left _status_right _window_status_current_format _window_status_format + _status_left_a=$(tmux_get_option "$TMUX_GRUVBOX_LEFT_STATUS_A" "$DEFAULT_LEFT_STATUS_A") + _status_right_x=$(tmux_get_option "$TMUX_GRUVBOX_RIGHT_STAUTS_X" "$DEFAULT_RIGHT_STATUS_X") + _status_right_y=$(tmux_get_option "$TMUX_GRUVBOX_RIGHT_STAUTS_Y" "$DEFAULT_RIGHT_STATUS_Y") + _status_right_z=$(tmux_get_option "$TMUX_GRUVBOX_RIGHT_STAUTS_Z" "$DEFAULT_RIGHT_STATUS_Z") - theme_args=( - "$_status_left_a" - "$_status_right_x" - "$_status_right_y" - "$_status_right_z" - "$_statusbar_alpha" - ) + theme_args=( + "$_status_left_a" + "$_status_right_x" + "$_status_right_y" + "$_status_right_z" + "$_statusbar_alpha" + ) - case $_theme in - light | light256) - theme_set_light_256 "${theme_args[@]}" - ;; - dark | dark256 | *) - theme_set_dark_256 "${theme_args[@]}" - ;; - esac + case $_theme in + light | light256) + theme_set_light_256 "${theme_args[@]}" + ;; + dark | dark256 | *) + theme_set_dark_256 "${theme_args[@]}" + ;; + esac - # execute commands with tmux as array of options - tmux "${TMUX_CMDS[@]}" + # execute commands with tmux as array of options + tmux "${TMUX_CMDS[@]}" } main "$@"