Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I dynamically set the context #8

Open
tao12345666333 opened this issue Dec 11, 2018 · 3 comments
Open

How can I dynamically set the context #8

tao12345666333 opened this issue Dec 11, 2018 · 3 comments

Comments

@tao12345666333
Copy link
Contributor

I have multiple clusters.

I can connect each other by seting KUBECONFIG environment variable.

The script can get correct output, like this:

(MoeLove) ➜  ~ echo $KUBECONFIG
/home/tao/.kube/kind-config-1
(MoeLove) ➜  ~ sh ~/workspace/kube-tmux/kube.tmux 
#[fg=blue]⎈ #[fg=colour]#[fg=]kubernetes-admin@kind-1#[fg=colour250]:#[fg=]default
(MoeLove) ➜  ~ KUBECONFIG=/home/tao/.kube/config 
(MoeLove) ➜  ~ sh ~/workspace/kube-tmux/kube.tmux 
#[fg=blue]⎈ #[fg=colour]#[fg=]minikube#[fg=colour250]:#[fg=]default

But the tmux status bar can not get correct result.
I know that it did not get the correct environment variable when it executed.
And I want to know how can I do this?
Thanks!

@jonmosco
Copy link
Owner

jonmosco commented Jan 2, 2019

Hmm, what does your .tmux.conf look like where you are calling the script? Can you paste it here?

@tao12345666333
Copy link
Contributor Author

Thanks for your reply. I just put the script to my local path $HOME/workspace/kube-tmux/kube.tmux .


set -g status-left '[#(whoami)]'
set -g status-right '[#(date +" %m-%d %H:%M ") #(getbat.sh) #(/bin/bash $HOME/workspace/kube-tmux/kube.tmux 250 red cyan)]'
set -g status-justify "centre"

set -g pane-active-border-fg '#55ff53'
set -g pane-border-fg '#7fcfee'

@mcadam
Copy link

mcadam commented May 20, 2020

Having the same issue, any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants