Merge branch 'main' into more-themes

This commit is contained in:
Abhishek Keshri 2024-04-03 07:43:35 +05:30 committed by GitHub
commit 05d62b07b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 37 additions and 40 deletions

View file

@ -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-fg "#1688f0" # this will get you duo blue shown above
set -g @tmux2k-duo-bg "#000000" # this will set the bg for duo theme 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 -g @tmux2k-show-powerline false
# set start icon, accpets: `session`, 'window`, or any string
set -g @tmux2k-start-icon ""
``` ```
#### 🖌️ Customize Theme Colors #### 🖌️ Customize Theme Colors
@ -94,9 +101,10 @@ To customize theme colors:
set -g @tmux2k-text '#cdcdcd' # change text to white set -g @tmux2k-text '#cdcdcd' # change text to white
set -g @tmux2k-bg-main '#ffffff' # change bg to white set -g @tmux2k-bg-main '#ffffff' # change bg to white
set -g @tmux2k-yellow '#f8c800' # change yellow color set -g @tmux2k-yellow '#f8c800' # change yellow color
``` ```
> You may have to restart `tmux` for some changes to reflect
### 🧩 Available Plugins ### 🧩 Available Plugins
- `battery`: Show battery stats and percentage - `battery`: Show battery stats and percentage
@ -121,6 +129,21 @@ set -g @tmux2k-right-plugins "battery network time"
# 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
# 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 #### 🪆 Add New Plugins
@ -154,38 +177,6 @@ set -g @plugin '2kabhishek/tmux2k'
You can also directly clone the repo to your `~/.tmux/plugins/` folder. 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 ## 🏗️ What's Next
- You tell me! - You tell me!

View file

@ -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')" IFS=' ' read -r -a rplugins <<<"$(get_tmux_option '@tmux2k-right-plugins' 'battery network time')"
theme=$(get_tmux_option "@tmux2k-theme" 'default') theme=$(get_tmux_option "@tmux2k-theme" 'default')
icons_only=$(get_tmux_option "@tmux2k-icons-only" false) icons_only=$(get_tmux_option "@tmux2k-icons-only" false)
compact=$(get_tmux_option "@tmux2k-compact-windows" false)
text=$(get_tmux_option "@tmux2k-text" '#282a36') text=$(get_tmux_option "@tmux2k-text" '#282a36')
bg_main=$(get_tmux_option "@tmux2k-bg-main" '#000000') bg_main=$(get_tmux_option "@tmux2k-bg-main" '#000000')
@ -239,6 +240,11 @@ window_list() {
wbg=${!colors[0]} wbg=${!colors[0]}
wfg=${!colors[1]} wfg=${!colors[1]}
spacer=" "
if $compact; then
spacer=""
fi
if $show_flags; then if $show_flags; then
flags="#{?window_flags,#[fg=${light_red}]#{window_flags},}" flags="#{?window_flags,#[fg=${light_red}]#{window_flags},}"
current_flags="#{?window_flags,#[fg=${light_green}]#{window_flags},}" current_flags="#{?window_flags,#[fg=${light_green}]#{window_flags},}"
@ -246,17 +252,17 @@ window_list() {
if $show_powerline; then if $show_powerline; then
tmux set-window-option -g window-status-current-format \ 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 \ 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 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-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 ${flags} " tmux set-window-option -g window-status-format "#[fg=${white},bg=${bg_alt}] #I:#W${spacer}${flags} "
fi fi
if $icons_only; then 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-current-format "#[fg=${wbg},bg=${wfg}]${spacer}#I:#W${spacer}"
tmux set-window-option -g window-status-format "#[fg=${white},bg=${wfg}] #I:#W " tmux set-window-option -g window-status-format "#[fg=${white},bg=${wfg}]${spacer}#I:#W${spacer}"
fi fi
} }