-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkali-theme-with-ip.zsh-theme
30 lines (23 loc) · 1.22 KB
/
kali-theme-with-ip.zsh-theme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
VPN=$(ps -ef | grep 'openvpn [eu|au|us|sg]'|tail -1| rev| awk '{print $1}'|rev |sed 's/\..*$//g')
OS_NAME=$(uname -a | awk '{print $1}')
case "$OS_NAME" in
"Darwin")
DEFAULT_INTERFACE=$(route get 0.0.0.0 | grep 'interface' | awk '{print $2}')
IP=$(ifconfig | grep -A 1 $DEFAULT_INTERFACE | grep 'inet ' | tr -s ' ' | cut -d ' ' -f 2)
;;
"Linux")
DEFAULT_INTERFACE=$(route | grep '^default' | grep -o '[^ ]*$')
IP=$(ifconfig | grep -A 1 $DEFAULT_INTERFACE | grep 'inet ' | tr -s ' ' | cut -d ' ' -f 3)
;;
esac
if [ ! -z "$VPN" ]; then
IP=$(ifconfig | grep -A 1 tun0 | grep 'inet ' | tr -s ' ' | cut -d ' ' -f 2)
fi
NEWLINE=$'\n'
#PROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ ) %{$fg[cyan]%}%c%{$reset_color%}"
PROMPT="${NEWLINE}%F{%(#.blue.green)}┌──%F{magenta}[$IP] %F{green}- (%B%F{%(#.red.blue)}%n@%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]${NEWLINE}└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} "
PROMPT+=' $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"