add vpn ip to prompt
This commit is contained in:
parent
92264124a9
commit
5eec2e28d0
3 changed files with 30 additions and 6 deletions
|
@ -914,6 +914,17 @@ prompt_ip() {
|
|||
"$1_prompt_segment" "$0" "$2" "cyan" "$DEFAULT_COLOR" "$ip" 'NETWORK_ICON'
|
||||
}
|
||||
|
||||
set_default POWERLEVEL9K_VPN_IP_INTERFACE "tun"
|
||||
# prompt if vpn active
|
||||
prompt_vpn_ip() {
|
||||
for vpn_iface in $(ip tuntap | grep -e ^"$POWERLEVEL9K_VPN_IP_INTERFACE" | cut -d":" -f1)
|
||||
do
|
||||
ip=$(ip -4 a show "$vpn_iface" | grep -o "inet\s*[0-9.]*" | grep -o "[0-9.]*")
|
||||
"$1_prompt_segment" "$0" "$2" "cyan" "$DEFAULT_COLOR" "$ip" 'VPN_ICON'
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
prompt_load() {
|
||||
# The load segment can have three different states
|
||||
local current_state="unknown"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue