Skip to content

Commit

Permalink
fix: files according to shfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
egel committed Sep 14, 2024
1 parent a8d87fa commit 44afa4e
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions src/gruvbox-main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
Expand Down

0 comments on commit 44afa4e

Please sign in to comment.