diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2018-01-06 23:28:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-06 23:28:05 +0300 |
commit | 4718458c756cae632b75d377ec73243674208cba (patch) | |
tree | dcb3fe926cdd283104e98dfde6ae1a9c289f5792 | |
parent | 58fc02f152d4f6a7d2714ddbb038cd39393f7280 (diff) | |
parent | 42a0125f4cb38c781d9da1511b6d0042eea9dc84 (diff) |
Merge pull request #677 from lemaral/POWERLEVEL9K_PUBLIC_IP_VPN_INTERFACE
Replace PUBLIC_IP_ICON with VPN_ICON if VPN is up
-rwxr-xr-x | powerlevel9k.zsh-theme | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index f38c8b6b..d5b3ef75 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -557,7 +557,16 @@ prompt_public_ip() { # Draw the prompt segment if [[ -n $public_ip ]]; then - $1_prompt_segment "$0" "$2" "$DEFAULT_COLOR" "$DEFAULT_COLOR_INVERTED" "${public_ip}" 'PUBLIC_IP_ICON' + icon='PUBLIC_IP_ICON' + # Check VPN is on if VPN interface is set + if [[ -n $POWERLEVEL9K_PUBLIC_IP_VPN_INTERFACE ]]; then + for vpn_iface in $(/sbin/ifconfig | grep -e ^"$POWERLEVEL9K_PUBLIC_IP_VPN_INTERFACE" | cut -d":" -f1) + do + icon='VPN_ICON' + break + done + fi + $1_prompt_segment "$0" "$2" "$DEFAULT_COLOR" "$DEFAULT_COLOR_INVERTED" "${public_ip}" "$icon" fi } |