Add support to kube-tmux in status bar (#249)

* Add support to kube-tmux in status bar

---------

Co-authored-by: vdbe <44153531+vdbe@users.noreply.github.com>
This commit is contained in:
Iván Arjona Alonso 2024-07-15 17:07:52 +02:00 committed by GitHub
parent 49972658aa
commit 598e9e9193
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 44 additions and 0 deletions

View file

@ -497,6 +497,33 @@ set -g @catppuccin_status_modules_right "... pomodoro_plus ..."
```
### Kube module
#### Requirements
This module depends on [kube-tmux](https://github.com/jonmosco/kube-tmux).
#### Install
The preferred way to install kube-tmux is using [TPM](https://github.com/tmux-plugins/tpm).
#### Configure
```sh
set -g @plugin 'catppuccin/tmux'
...
set -g @plugin 'jonmosco/kube-tmux'
```
Add the tmux module to the status modules list.
```sh
set -g @catppuccin_status_modules_right "... kube ..."
```
Optionally override the kube-tmux colors
```sh
set -g @catppuccin_kube_context_color "#{thm_red}"
set -g @catppuccin_kube_namespace_color "#{thm_cyan}"
```
## Create a custom module
It is possible to add a new custom module or overwrite any of the existing modules.

17
status/kube.sh Normal file
View file

@ -0,0 +1,17 @@
# Requires https://github.com/jonmosco/kube-tmux
show_kube() {
local index icon color text context_color namespace_color symbol_enabled module
index=$1
icon=$(get_tmux_option "@catppuccin_kube_icon" "󱃾")
color=$(get_tmux_option "@catppuccin_kube_color" "$thm_blue")
context_color=$(get_tmux_option "@catppuccin_kube_context_color" "#{thm_red}")
namespace_color=$(get_tmux_option "@catppuccin_kube_namespace_color" "#{thm_cyan}")
symbol_enabled=${KUBE_TMUX_SYMBOL_ENABLE:-false}
text=$(get_tmux_option "@catppuccin_kube_text" "#(KUBE_TMUX_SYMBOL_ENABLE=$symbol_enabled ${TMUX_PLUGIN_MANAGER_PATH}kube-tmux/kube.tmux 250 '$context_color' '$namespace_color')")
module=$( build_status_module "$index" "$icon" "$color" "$text" )
echo "$module"
}