aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2017-10-18 04:33:40 +0300
committerBen Hilburn <bhilburn@gmail.com>2017-10-18 04:33:40 +0300
commitf46617acd366b0aab249821ab97c6a955f7b4445 (patch)
treeb9ecdeb165c9f4352ba696c48ba2fab862ec8618 /powerlevel9k.zsh-theme
parent01893a015b2a4ce982069e9e27621911d3b98a60 (diff)
parent1f88c289b521a00dc6dede7591de18860d4ce6f6 (diff)
Merge branch 'master' into next
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme6
1 files changed, 5 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index db73e436..1bfd348d 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -507,7 +507,11 @@ prompt_public_ip() {
if [[ -f $POWERLEVEL9K_PUBLIC_IP_FILE ]]; then
typeset -i timediff
# if saved IP is more than
- timediff=$(($(date +%s) - $(date -r $POWERLEVEL9K_PUBLIC_IP_FILE +%s)))
+ if [[ "$OS" == "OSX" ]]; then
+ timediff=$(($(date +%s) - $(stat -f "%m" $POWERLEVEL9K_PUBLIC_IP_FILE)))
+ else
+ timediff=$(($(date +%s) - $(date -r $POWERLEVEL9K_PUBLIC_IP_FILE +%s)))
+ fi
[[ $timediff -gt $POWERLEVEL9K_PUBLIC_IP_TIMEOUT ]] && refresh_ip=true
# If tmp file is empty get a fresh IP
[[ -z $(cat $POWERLEVEL9K_PUBLIC_IP_FILE) ]] && refresh_ip=true