feat(status, window): add option to make overwrite status background … (#170)
* feat(status, window): add option to make overwrite status background color, add option to set the separator between windows * feat(window): update documentation * feat(window): update documentation
This commit is contained in:
parent
e80cb735bb
commit
809361f5c2
2 changed files with 74 additions and 43 deletions
|
@ -301,12 +301,18 @@ load_modules() {
|
|||
}
|
||||
|
||||
main() {
|
||||
local theme
|
||||
theme="$(get_tmux_option "@catppuccin_flavour" "mocha")"
|
||||
|
||||
# Aggregate all commands in one array
|
||||
local tmux_commands=()
|
||||
|
||||
# module directories
|
||||
local custom_path="$(get_tmux_option "@catppuccin_custom_plugin_dir" "${PLUGIN_DIR}/custom")"
|
||||
local modules_custom_path=$custom_path
|
||||
local modules_status_path=$PLUGIN_DIR/status
|
||||
local modules_window_path=$PLUGIN_DIR/window
|
||||
local modules_pane_path=$PLUGIN_DIR/pane
|
||||
|
||||
# load local theme
|
||||
local theme="$(get_tmux_option "@catppuccin_flavour" "mocha")"
|
||||
# NOTE: Pulling in the selected theme by the theme that's being set as local
|
||||
# variables.
|
||||
# shellcheck source=catppuccin-frappe.tmuxtheme
|
||||
|
@ -321,23 +327,30 @@ main() {
|
|||
eval "local $key"="$val"
|
||||
done < "${PLUGIN_DIR}/catppuccin-${theme}.tmuxtheme"
|
||||
|
||||
# module directories
|
||||
local custom_path="$(get_tmux_option "@catppuccin_custom_plugin_dir" "${PLUGIN_DIR}/custom")"
|
||||
local modules_custom_path=$custom_path
|
||||
local modules_status_path=$PLUGIN_DIR/status
|
||||
local modules_window_path=$PLUGIN_DIR/window
|
||||
local modules_pane_path=$PLUGIN_DIR/pane
|
||||
|
||||
# status
|
||||
# status general
|
||||
local status_default=$(get_tmux_option "@catppuccin_status_default" "on")
|
||||
local status_justify=$(get_tmux_option "@catppuccin_status_justify" "left")
|
||||
|
||||
set status "$status_default"
|
||||
|
||||
local status_justify=$(get_tmux_option "@catppuccin_status_justify" "left")
|
||||
set status-justify "$status_justify"
|
||||
set status-bg "${thm_bg}"
|
||||
|
||||
local status_background=$(get_tmux_option "@catppuccin_status_background" "theme")
|
||||
if [ "${status_background}" = "theme" ];
|
||||
then
|
||||
set status-bg "${thm_bg}"
|
||||
else
|
||||
if [ "${status_background}" = "default" ]
|
||||
then
|
||||
set status-style bg=default
|
||||
else
|
||||
set status-bg "${status_background}"
|
||||
fi
|
||||
fi
|
||||
|
||||
set status-left-length "100"
|
||||
set status-right-length "100"
|
||||
|
||||
|
||||
# messages
|
||||
set message-style "fg=${thm_cyan},bg=${thm_gray},align=centre"
|
||||
set message-command-style "fg=${thm_cyan},bg=${thm_gray},align=centre"
|
||||
|
@ -361,14 +374,13 @@ main() {
|
|||
setw pane-border-style "$pane_border_style"
|
||||
setw pane-border-format "$pane_format"
|
||||
|
||||
# window
|
||||
local window_status_separator=$(get_tmux_option "@catppuccin_window_separator" "")
|
||||
setw window-status-separator "$window_status_separator"
|
||||
|
||||
# windows
|
||||
setw window-status-activity-style "fg=${thm_fg},bg=${thm_bg},none"
|
||||
setw window-status-separator ""
|
||||
setw window-status-style "fg=${thm_fg},bg=${thm_bg},none"
|
||||
|
||||
# --------=== Statusline
|
||||
|
||||
local window_left_separator=$(get_tmux_option "@catppuccin_window_left_separator" "█")
|
||||
local window_right_separator=$(get_tmux_option "@catppuccin_window_right_separator" "█")
|
||||
local window_middle_separator=$(get_tmux_option "@catppuccin_window_middle_separator" "█ ")
|
||||
|
@ -376,28 +388,27 @@ main() {
|
|||
local window_status_enable=$(get_tmux_option "@catppuccin_window_status_enable" "no") # right, left
|
||||
|
||||
local window_format=$(load_modules "window_default_format" "$modules_custom_path" "$modules_window_path")
|
||||
local window_current_format=$(load_modules "window_current_format" "$modules_custom_path" "$modules_window_path")
|
||||
|
||||
setw window-status-format "$window_format"
|
||||
|
||||
local window_current_format=$(load_modules "window_current_format" "$modules_custom_path" "$modules_window_path")
|
||||
setw window-status-current-format "$window_current_format"
|
||||
|
||||
# status module
|
||||
local status_left_separator=$(get_tmux_option "@catppuccin_status_left_separator" "")
|
||||
local status_right_separator=$(get_tmux_option "@catppuccin_status_right_separator" "█")
|
||||
local status_right_separator_inverse=$(get_tmux_option "@catppuccin_status_right_separator_inverse" "no")
|
||||
local status_connect_separator=$(get_tmux_option "@catppuccin_status_connect_separator" "yes")
|
||||
local status_fill=$(get_tmux_option "@catppuccin_status_fill" "icon")
|
||||
|
||||
local status_modules_right=$(get_tmux_option "@catppuccin_status_modules_right" "application session")
|
||||
local loaded_modules_right=$(load_modules "$status_modules_right" "$modules_custom_path" "$modules_status_path")
|
||||
|
||||
local status_modules_left=$(get_tmux_option "@catppuccin_status_modules_left" "")
|
||||
local loaded_modules_left=$(load_modules "$status_modules_left" "$modules_custom_path" "$modules_status_path")
|
||||
|
||||
set status-left "$loaded_modules_left"
|
||||
|
||||
local status_modules_right=$(get_tmux_option "@catppuccin_status_modules_right" "application session")
|
||||
local loaded_modules_right=$(load_modules "$status_modules_right" "$modules_custom_path" "$modules_status_path")
|
||||
set status-right "$loaded_modules_right"
|
||||
|
||||
# --------=== Modes
|
||||
#
|
||||
# modes
|
||||
setw clock-mode-colour "${thm_blue}"
|
||||
setw mode-style "fg=${thm_pink} bg=${thm_black4} bold"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue