Skip to content

Instantly share code, notes, and snippets.

@lummie
Last active July 14, 2022 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lummie/76a2e8da260e2440afd383cf1f438e1a to your computer and use it in GitHub Desktop.
Save lummie/76a2e8da260e2440afd383cf1f438e1a to your computer and use it in GitHub Desktop.
k8s, git, full path PS1 bash prompt
# install kube-ps1 from https://github.com/jonmosco/kube-ps1
alias sn="kubectl config set-context --current --namespace" # switch namespace
# setup bash prompt
source "/usr/local/opt/kube-ps1/share/kube-ps1.sh" && k8s='$(kube_ps1)' # k8s cluster
export PS1="\n\n πŸ¦”" # headgehog
export PS1="$PS1\n┏━━━━━┯━ πŸ•° \t ━━━━━━━━━━━━━━━━━━━━━━━━━" # headgehog
export PS1="$PS1\n┃ git β”‚ \$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/')" # git branch
export PS1="$PS1\n┃ k8s β”‚ $k8s" # k8s info
export PS1="$PS1\n┃ dir β”‚ \w" # full dir \n dir
export PS1="$PS1\nβ”—β”β”β”β”β”β”·β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”β”πŸ¦”\n" # headgehog
export PS1="$PS1\n :\$ \[$(tput sgr0)\]" # :$ prompt then reset tput formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment