feat: add window-list-alignment option

You can now set the window lists alignment, available options are: left,
centre (default) and right

closes #19
This commit is contained in:
Abhishek Keshri 2024-07-29 17:04:21 +05:30
parent 5810f28b16
commit 74c6c25a28
No known key found for this signature in database
2 changed files with 5 additions and 1 deletions

View file

@ -126,6 +126,9 @@ To use plugins:
set -g @tmux2k-left-plugins "git cpu ram" set -g @tmux2k-left-plugins "git cpu ram"
set -g @tmux2k-right-plugins "battery network time" set -g @tmux2k-right-plugins "battery network time"
# to set window list alignment (centre by default)
set -g @tmux2k-window-list-alignment 'left'
# to customize plugin colors # to customize plugin colors
set -g @tmux2k-[plugin-name]-colors "[background] [foreground]" set -g @tmux2k-[plugin-name]-colors "[background] [foreground]"
set -g @tmux2k-cpu-colors "red black" # set cpu plugin bg to red, fg to black set -g @tmux2k-cpu-colors "red black" # set cpu plugin bg to red, fg to black

View file

@ -6,6 +6,7 @@ current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$current_dir"/utils.sh source "$current_dir"/utils.sh
show_powerline=$(get_tmux_option "@tmux2k-show-powerline" true) show_powerline=$(get_tmux_option "@tmux2k-show-powerline" true)
window_list_alignment=$(get_tmux_option "@tmux2k-window-list-alignment" 'centre')
refresh_rate=$(get_tmux_option "@tmux2k-refresh-rate" 60) refresh_rate=$(get_tmux_option "@tmux2k-refresh-rate" 60)
start_icon=$(get_tmux_option "@tmux2k-start-icon" '') start_icon=$(get_tmux_option "@tmux2k-start-icon" '')
l_sep=$(get_tmux_option "@tmux2k-left-sep") l_sep=$(get_tmux_option "@tmux2k-left-sep")
@ -177,7 +178,7 @@ set_options() {
tmux set-option -g pane-border-style "fg=${bg_main}" tmux set-option -g pane-border-style "fg=${bg_main}"
tmux set-option -g message-style "bg=${bg_main},fg=${blue}" tmux set-option -g message-style "bg=${bg_main},fg=${blue}"
tmux set-option -g status-style "bg=${bg_main},fg=${white}" tmux set-option -g status-style "bg=${bg_main},fg=${white}"
tmux set -g status-justify absolute-centre tmux set -g status-justify "$window_list_alignment"
tmux set-window-option -g window-status-activity-style "bold" tmux set-window-option -g window-status-activity-style "bold"
tmux set-window-option -g window-status-bell-style "bold" tmux set-window-option -g window-status-bell-style "bold"