Skip to content

Commit

Permalink
feat: Allow customizing the window title string
Browse files Browse the repository at this point in the history
Added:
- @theme_active_window_title
- @theme_inactive_window_title
  • Loading branch information
jeffglover committed Oct 25, 2024
1 parent 7101c44 commit e064b37
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function generate_inactive_window_string() {
zoomed_window_icon=$(get_tmux_option "@theme_plugin_zoomed_window_icon" "")
left_separator=$(get_tmux_option "@theme_left_separator" "")
transparent=$(get_tmux_option "@theme_transparent_status_bar" "false")
inactive_window_title=$(get_tmux_option "@theme_inactive_window_title" "#W ")

if [ "$transparent" = "true" ]; then
left_separator_inverse=$(get_tmux_option "@theme_transparent_left_separator_inverse" "")
Expand All @@ -46,7 +47,7 @@ function generate_inactive_window_string() {
local separator_end="#[bg=${PALLETE[bg_highlight]},fg=${PALLETE['dark3']}]${left_separator:?}#[none]"
fi

echo "${separator_start}#[fg=${PALLETE[white]}]#I${separator_internal}#[fg=${PALLETE[white]}] #{?window_zoomed_flag,$zoomed_window_icon,$inactive_window_icon}#W ${separator_end}"
echo "${separator_start}#[fg=${PALLETE[white]}]#I${separator_internal}#[fg=${PALLETE[white]}] #{?window_zoomed_flag,$zoomed_window_icon,$inactive_window_icon}${inactive_window_title}${separator_end}"
}

function generate_active_window_string() {
Expand All @@ -56,6 +57,7 @@ function generate_active_window_string() {
pane_synchronized_icon=$(get_tmux_option "@theme_plugin_pane_synchronized_icon" "")
left_separator=$(get_tmux_option "@theme_left_separator" "")
transparent=$(get_tmux_option "@theme_transparent_status_bar" "false")
active_window_title=$(get_tmux_option "@theme_active_window_title" "#W ")

if [ "$transparent" = "true" ]; then
left_separator_inverse=$(get_tmux_option "@theme_transparent_left_separator_inverse" "")
Expand All @@ -69,5 +71,5 @@ function generate_active_window_string() {
separator_end="#[bg=${PALLETE[bg_highlight]},fg=${PALLETE['purple']}]${left_separator:?}#[none]"
fi

echo "${separator_start}#[fg=${PALLETE[white]}]#I${separator_internal}#[fg=${PALLETE[white]}] #{?window_zoomed_flag,$zoomed_window_icon,$active_window_icon}#W #{?pane_synchronized,$pane_synchronized_icon,}${separator_end}#[none]"
echo "${separator_start}#[fg=${PALLETE[white]}]#I${separator_internal}#[fg=${PALLETE[white]}] #{?window_zoomed_flag,$zoomed_window_icon,$active_window_icon}${active_window_title}#{?pane_synchronized,$pane_synchronized_icon,}${separator_end}#[none]"
}

0 comments on commit e064b37

Please sign in to comment.