forked from niksingh710/minimal-tmux-status
-
Notifications
You must be signed in to change notification settings - Fork 0
/
minimal.tmux
executable file
·58 lines (47 loc) · 2.22 KB
/
minimal.tmux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
get_tmux_option() {
local option=$1
local default_value="$2"
# shellcheck disable=SC2155
local option_value=$(tmux show-options -gqv "$option")
if [ -n "$option_value" ]; then
echo "$option_value"
return
fi
echo "$default_value"
}
bg=$(get_tmux_option "@minimal-tmux-bg" '#698DDA')
fg=$(get_tmux_option "@minimal-tmux-fg" '#000000')
status=$(get_tmux_option "@minimal-tmux-status" "bottom")
justify=$(get_tmux_option "@minimal-tmux-justify" "centre")
indicator_state=$(get_tmux_option "@minimal-tmux-indicator" true)
right_state=$(get_tmux_option "@minimal-tmux-right" true)
left_state=$(get_tmux_option "@minimal-tmux-left" true)
if [ "$indicator_state" = true ]; then
indicator=$(get_tmux_option "@minimal-tmux-indicator-str" " tmux ")
else
indicator=""
fi
window_status_format=$(get_tmux_option "@minimal-tmux-window-status-format" ' #I:#W ')
status_right=$(get_tmux_option "@minimal-tmux-status-right" "#S")
status_left=$(get_tmux_option "@minimal-tmux-status-left" "#[bg=default,fg=default,bold]#{?client_prefix,,${indicator}}#[bg=${bg},fg=${fg},bold]#{?client_prefix,${indicator},}#[bg=default,fg=default,bold]")
expanded_icon=$(get_tmux_option "@minimal-tmux-expanded-icon" ' ')
show_expanded_icon_for_all_tabs=$(get_tmux_option "@minimal-tmux-show-expanded-icon-for-all-tabs" false)
status_right_extra="$status_right$(get_tmux_option "@minimal-tmux-status-right-extra" '')"
status_left_extra="$status_left$(get_tmux_option "@minimal-tmux-status-left-extra" '')"
if [ "$right_state" = false ]; then
status_right_extra=""
fi
if [ "$left_state" = false ]; then
status_left_extra=""
fi
tmux set-option -g status-position "${status}"
tmux set-option -g status-style bg=default,fg=default
tmux set-option -g status-justify "${justify}"
tmux set-option -g status-left "${status_left_extra}"
tmux set-option -g status-right "${status_right_extra}"
tmux set-option -g window-status-format "${window_status_format}"
tmux set-option -g window-status-current-format "#[bg=${bg},fg=white] ${window_status_format}#{?window_zoomed_flag,${expanded_icon}, }"
if [ "$show_expanded_icon_for_all_tabs" = true ]; then
tmux set-option -g window-status-format " ${window_status_format}#{?window_zoomed_flag,${expanded_icon}, }"
fi