diff --git a/README.md b/README.md index 28cfa90..b2c1e8e 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,15 @@ set -g @tmux2k-icons-only true set -g @tmux2k-duo-fg "#1688f0" # this will get you duo blue shown above set -g @tmux2k-duo-bg "#000000" # this will set the bg for duo theme -# to not show powerline glyphs +# to set powerline symbols +set -g @tmux2k-right-sep  # alternate right status bar sep +set -g @tmux2k-win-right-sep  # alternate window right sep + +# to not show powerline set -g @tmux2k-show-powerline false + +# set start icon, accpets: `session`, 'window`, or any string +set -g @tmux2k-start-icon "" ``` #### 🖌️ Customize Theme Colors @@ -94,9 +101,10 @@ To customize theme colors: set -g @tmux2k-text '#cdcdcd' # change text to white set -g @tmux2k-bg-main '#ffffff' # change bg to white set -g @tmux2k-yellow '#f8c800' # change yellow color - ``` +> You may have to restart `tmux` for some changes to reflect + ### 🧩 Available Plugins - `battery`: Show battery stats and percentage @@ -121,6 +129,21 @@ set -g @tmux2k-right-plugins "battery network time" # to customize plugin colors set -g @tmux2k-[plugin-name]-colors "[background] [foreground]" set -g @tmux2k-cpu-colors "red black" # set cpu plugin bg to red, fg to black + +# to enable compact window list size +set -g @tmux2k-compact-windows true + +# change refresh rate +set -g @tmux2k-refresh-rate 5 + +# weather scale +set -g @tmux2k-show-fahrenheit false + +# 24 hour time +set -g @tmux2k-military-time true + +# network interface to watch +set -g @tmux2k-network-name "wlo1" ``` #### 🪆 Add New Plugins @@ -154,38 +177,6 @@ set -g @plugin '2kabhishek/tmux2k' You can also directly clone the repo to your `~/.tmux/plugins/` folder. -## 🚀 Usage - -tmux2k to should automatically start after installation. Here's how you can customize it's features - -```bash -# Left and right status bar plugins -set -g @tmux2k-left-plugins "git cpu ram" -set -g @tmux2k-right-plugins "battery network time" - -# change refresh rate -set -g @tmux2k-refresh-rate 5 - -# weather scale -set -g @tmux2k-show-fahrenheit false - -# 24 hour time -set -g @tmux2k-military-time true - -# it can accept `session`, 'window`, or any string -set -g @tmux2k-start-icon "" - -# network interface to watch -set -g @tmux2k-network-name "wlo1" - -# update powerline symbols -set -g @tmux2k-right-sep  # alternate right status bar sep -set -g @tmux2k-win-right-sep  # alternate window right sep - -``` - -> You may have to restart `tmux` for some changes to reflect - ## 🏗️ What's Next - You tell me! diff --git a/scripts/tmux2k.sh b/scripts/tmux2k.sh index 171964a..a992b95 100755 --- a/scripts/tmux2k.sh +++ b/scripts/tmux2k.sh @@ -17,6 +17,7 @@ IFS=' ' read -r -a lplugins <<<"$(get_tmux_option '@tmux2k-left-plugins' 'git cp IFS=' ' read -r -a rplugins <<<"$(get_tmux_option '@tmux2k-right-plugins' 'battery network time')" theme=$(get_tmux_option "@tmux2k-theme" 'default') icons_only=$(get_tmux_option "@tmux2k-icons-only" false) +compact=$(get_tmux_option "@tmux2k-compact-windows" false) text=$(get_tmux_option "@tmux2k-text" '#282a36') bg_main=$(get_tmux_option "@tmux2k-bg-main" '#000000') @@ -239,6 +240,11 @@ window_list() { wbg=${!colors[0]} wfg=${!colors[1]} + spacer=" " + if $compact; then + spacer="" + fi + if $show_flags; then flags="#{?window_flags,#[fg=${light_red}]#{window_flags},}" current_flags="#{?window_flags,#[fg=${light_green}]#{window_flags},}" @@ -246,17 +252,17 @@ window_list() { if $show_powerline; then tmux set-window-option -g window-status-current-format \ - "#[fg=${wfg},bg=${wbg}]${wl_sep}#[bg=${wfg}]${current_flags}#[fg=${wbg}] #I:#W #[fg=${wfg},bg=${wbg}]${wr_sep}" + "#[fg=${wfg},bg=${wbg}]${wl_sep}#[bg=${wfg}]${current_flags}#[fg=${wbg}]${spacer}#I:#W${spacer}#[fg=${wfg},bg=${wbg}]${wr_sep}" tmux set-window-option -g window-status-format \ - "#[fg=${bg_alt},bg=${wbg}]${wl_sep}#[bg=${bg_alt}]${flags}#[fg=${white}] #I:#W #[fg=${bg_alt},bg=${wbg}]${wr_sep}" + "#[fg=${bg_alt},bg=${wbg}]${wl_sep}#[bg=${bg_alt}]${flags}#[fg=${white}]${spacer}#I:#W${spacer}#[fg=${bg_alt},bg=${wbg}]${wr_sep}" else - tmux set-window-option -g window-status-current-format "#[fg=${wbg},bg=${wfg}] #I:#W ${current_flags} " - tmux set-window-option -g window-status-format "#[fg=${white},bg=${bg_alt}] #I:#W ${flags} " + tmux set-window-option -g window-status-current-format "#[fg=${wbg},bg=${wfg}] #I:#W${spacer}${current_flags} " + tmux set-window-option -g window-status-format "#[fg=${white},bg=${bg_alt}] #I:#W${spacer}${flags} " fi if $icons_only; then - tmux set-window-option -g window-status-current-format "#[fg=${wbg},bg=${wfg}] #I:#W " - tmux set-window-option -g window-status-format "#[fg=${white},bg=${wfg}] #I:#W " + tmux set-window-option -g window-status-current-format "#[fg=${wbg},bg=${wfg}]${spacer}#I:#W${spacer}" + tmux set-window-option -g window-status-format "#[fg=${white},bg=${wfg}]${spacer}#I:#W${spacer}" fi }