From 954faf2695e138570f41ba368c02b992e9d607ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=A9rence=20Clastres?= Date: Sat, 7 Oct 2017 19:16:06 +0200 Subject: [PATCH 1/4] Fix incomplete vpn segment name The segment function is called *prompt_vpn_ip()* thus the segment needs to be called "vpn_ip". --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d0ba2be..18c9acc3 100644 --- a/README.md +++ b/README.md @@ -451,7 +451,7 @@ specify the correct network interface by setting: |----------|---------------|-------------| |`POWERLEVEL9K_IP_INTERFACE`|None|The NIC for which you wish to display the IP address. Example: `eth0`.| -##### vpn +##### vpn_ip This segment tries to extract the VPN related IP addresses from nmcli, based on the NIC type: From 20b69370a679b6c3a8a2084615206d78fe0ae542 Mon Sep 17 00:00:00 2001 From: sbutler2901 Date: Thu, 12 Oct 2017 02:02:45 -0400 Subject: [PATCH 2/4] Bug fix for prompt_public_ip. The OSX date command does not have the -r option for getting the last modification time of a file. The stat command is being used instead --- powerlevel9k.zsh-theme | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 97d13a3c..f6646c63 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 From 8d653c9320151817129dd5d90e0b264d4963d667 Mon Sep 17 00:00:00 2001 From: Clay Anderson Date: Tue, 17 Oct 2017 14:45:07 -0600 Subject: [PATCH 3/4] Add *.swp to ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8f6423fa..8bebd352 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ test-vm/.vagrant +*.swp From b582a60adcf47c7967c3cb3cd43337b3a74e1f7c Mon Sep 17 00:00:00 2001 From: Clay Anderson Date: Tue, 17 Oct 2017 14:52:46 -0600 Subject: [PATCH 4/4] Add documentation for VCS hooks config --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 9d0ba2be..6178adad 100644 --- a/README.md +++ b/README.md @@ -582,6 +582,9 @@ customization is provided via: |`POWERLEVEL9K_CHANGESET_HASH_LENGTH`|`12`|How many characters of the hash / changeset to display in the segment.| |`POWERLEVEL9K_VCS_SHOW_SUBMODULE_DIRTY`|`true`|Set to `false` to not reflect submodule status in the top-level repository prompt.| |`POWERLEVEL9K_VCS_HIDE_TAGS`|`false`|Set to `true` to stop tags being displayed in the segment.| +|`POWERLEVEL9K_VCS_GIT_HOOKS`|`(vcs-detect-changes git-untracked git-aheadbehind git-stash git-remotebranch git-tagname)`|Layout of the segment for git repositories.| +|`POWERLEVEL9K_VCS_HG_HOOKS`|`(vcs-detect-changes)`|Layout of the segment for Mercurial repositories.| +|`POWERLEVEL9K_VCS_SVN_HOOKS`|`(vcs-detect-changes svn-detect-changes)`|Layout of the segment for SVN repositories.| ##### vcs symbols