aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2017-02-14 06:07:23 +0300
committerBen Hilburn <bhilburn@gmail.com>2017-02-14 06:07:23 +0300
commit3de352b29627e39dc58ffa5b834e0e23531d95dc (patch)
tree561691120a4a7f7fcd1d682ce83964cf0d9be6ec
parentf68e055f3bf0403cb4c4a9b3b79adb8471fe3872 (diff)
Adding `ssh` segment back with some minor changes.
-rw-r--r--README.md2
-rw-r--r--functions/icons.zsh3
-rwxr-xr-xpowerlevel9k.zsh-theme6
3 files changed, 10 insertions, 1 deletions
diff --git a/README.md b/README.md
index d6de6843..22608cce 100644
--- a/README.md
+++ b/README.md
@@ -102,7 +102,7 @@ The segments that are currently available are:
* `swap` - Prints the current swap size.
* [`time`](#time) - System time.
* [`vi_mode`](#vi_mode)- Your prompt's Vi editing mode (NORMAL|INSERT).
-* `SSH` - Additional Identifier for SSH Sessions.
+* `ssh` - Indicates whether or not you are in an SSH session.
**Development Environment Segments:**
* [`vcs`](#vcs) - Information about this `git` or `hg` repository (if you are in one).
diff --git a/functions/icons.zsh b/functions/icons.zsh
index 44d99095..3000f4a6 100644
--- a/functions/icons.zsh
+++ b/functions/icons.zsh
@@ -79,6 +79,7 @@ case $POWERLEVEL9K_MODE in
SWIFT_ICON ''
PUBLIC_IP_ICON ''
LOCK_ICON $'\UE138' # 
+ SSH_ICON '(ssh)'
)
;;
'awesome-fontconfig')
@@ -140,6 +141,7 @@ case $POWERLEVEL9K_MODE in
SWIFT_ICON ''
PUBLIC_IP_ICON ''
LOCK_ICON $'\UE138' # 
+ SSH_ICON '(ssh)'
)
;;
*)
@@ -201,6 +203,7 @@ case $POWERLEVEL9K_MODE in
SWIFT_ICON 'Swift'
PUBLIC_IP_ICON ''
LOCK_ICON $'\UE0A2'
+ SSH_ICON '(ssh)'
)
;;
esac
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 49fdaf09..10b2b011 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -933,6 +933,12 @@ prompt_rvm() {
fi
}
+prompt_ssh() {
+ if [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_TTY" ]]; then
+ "$1_prompt_segment" "$0" "$2" "$DEFAULT_COLOR" "yellow" "" 'SSH_ICON'
+ fi
+}
+
# Status: return code if verbose, otherwise just an icon if an error occurred
set_default POWERLEVEL9K_STATUS_VERBOSE true
set_default POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE false