aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2017-06-02 19:13:03 +0300
committerGitHub <noreply@github.com>2017-06-02 19:13:03 +0300
commitb81d2cb2f29114a1dc5e466d4fad1c267a58c7b8 (patch)
treebe6fb9608198c083c0c845eda2a11117c03213a9 /powerlevel9k.zsh-theme
parentd6a14a9a010009866c60a2f4d52d0aefac93e876 (diff)
parente09d4ae92600bc4c567d0c0d19dfc5139416561a (diff)
Merge pull request #539 from golgoth31/next
add vpn ip to prompt
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme11
1 files changed, 11 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 668748d2..dc7f0388 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -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"