Skip to content

Commit

Permalink
show the current kube context in tmux left bar
Browse files Browse the repository at this point in the history
  • Loading branch information
dmathieu committed Jan 5, 2018
1 parent 2a7371e commit cc13649
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/kube-context
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/zsh
context="${$(kubectl config current-context 2>/dev/null):-None}"
namespace="${$(kubectl config view --minify --output 'jsonpath={..namespace}'):-default}"
echo "${context}:${namespace}"
1 change: 1 addition & 0 deletions tmux/tmux.conf.symlink
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@ set -g status-left-length 40
set -g status-left ""

set-option -g status-right "📅 #(gcalcli agenda --nostarted --nocolor --calendar "dmathieu@salesforce.com" --nodeclined | head -2 | tail -1)#[default]"
set-option -g status-left "#(kube-context)"

if-shell "uname | grep -q Darwin" "source-file ~/.tmux-macosx" "source-file ~/.tmux-linux"

0 comments on commit cc13649

Please sign in to comment.