From 57d37e0701aef5db772a587a251aac7eaa6bde7d Mon Sep 17 00:00:00 2001 From: wujtruj Date: Wed, 13 Mar 2013 20:08:29 +0100 Subject: [PATCH] Added ability to hide username or hostname --- README.md | 6 ++++++ powerline.zsh-theme | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 53680fb..d4d9c27 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,12 @@ If you don't want to display your username (the green or red (root) colors are s POWERLINE_HIDE_USER_NAME="true" ``` +If you don't want to display your hostname (the green or red (root) colors are still there): + +``` +POWERLINE_HIDE_HOST_NAME="true" +``` + If you don't want the blank line before the prompt: ``` diff --git a/powerline.zsh-theme b/powerline.zsh-theme index 1916d51..a92dc49 100644 --- a/powerline.zsh-theme +++ b/powerline.zsh-theme @@ -14,7 +14,11 @@ else POWERLINE_RIGHT_A="" fi -if [ "$POWERLINE_HIDE_USER_NAME" = "" ]; then +if [ "$POWERLINE_HIDE_USER_NAME" = "" ] && [ "$POWERLINE_HIDE_HOST_NAME" = "" ]; then + POWERLINE_USER_NAME="%n@%M" +elif [ "$POWERLINE_HIDE_USER_NAME" != "" ] && [ "$POWERLINE_HIDE_HOST_NAME" = "" ]; then + POWERLINE_USER_NAME="@%M" +elif [ "$POWERLINE_HIDE_USER_NAME" = "" ] && [ "$POWERLINE_HIDE_HOST_NAME" != "" ]; then POWERLINE_USER_NAME="%n" else POWERLINE_USER_NAME=""