diff options
author | Michael Louwrens <mlouwrens@entersekt.com> | 2018-02-12 12:28:00 +0300 |
---|---|---|
committer | Michael Louwrens <mlouwrens@entersekt.com> | 2018-02-12 12:28:00 +0300 |
commit | 7fff5bd7a6c7c6d38c5984a1fa30571e89d14d1e (patch) | |
tree | aab767c66dfb896e54c4303f9a7d99ad61e0a887 | |
parent | 38937858736ff8a7483dbdd353c36aa190028aab (diff) |
add new icons and add remote_sudo
-rw-r--r-- | functions/icons.zsh | 5 | ||||
-rwxr-xr-x | powerlevel9k.zsh-theme | 15 |
2 files changed, 14 insertions, 6 deletions
diff --git a/functions/icons.zsh b/functions/icons.zsh index b29d0108..6000e108 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -27,6 +27,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # CARRIAGE_RETURN_ICON $'\u21B5' # ↵ ROOT_ICON $'\uE801' # + SUDO_ICON $'\uF09C' # RUBY_ICON $'\uE847 ' # AWS_ICON $'\uE895' # AWS_EB_ICON $'\U1F331 ' # 🌱 @@ -105,6 +106,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # CARRIAGE_RETURN_ICON $'\u21B5' # ↵ ROOT_ICON $'\uF201' # + SUDO_ICON $'\uF09C' # RUBY_ICON $'\uF219 ' # AWS_ICON $'\uF270' # AWS_EB_ICON $'\U1F331 ' # 🌱 @@ -188,6 +190,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # CARRIAGE_RETURN_ICON $'\u21B5' # ↵ ROOT_ICON '\u'$CODEPOINT_OF_OCTICONS_ZAP # + SUDO_ICON '\u'$CODEPOINT_OF_AWESOME_UNLOCK # RUBY_ICON '\u'$CODEPOINT_OF_OCTICONS_RUBY' ' # AWS_ICON '\u'$CODEPOINT_OF_AWESOME_SERVER # AWS_EB_ICON $'\U1F331 ' # 🌱 @@ -258,7 +261,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # CARRIAGE_RETURN_ICON $'\u21B5' # ↵ ROOT_ICON $'\uE614 ' # - SUDO_ICON $'\uE0A2' # + SUDO_ICON $'\uF09C' # RUBY_ICON $'\uF219 ' # AWS_ICON $'\uF270' # AWS_EB_ICON $'\UF1BD ' # diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 2267ce64..8eb13bde 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -589,10 +589,11 @@ prompt_context() { local current_state="DEFAULT" typeset -AH context_states context_states=( - "ROOT" "yellow" - "SUDO" "yellow" - "DEFAULT" "yellow" - "REMOTE" "yellow" + "ROOT" "yellow" + "SUDO" "yellow" + "DEFAULT" "yellow" + "REMOTE" "yellow" + "REMOTE_SUDO" "yellow" ) local content="" @@ -608,7 +609,11 @@ prompt_context() { if [[ $(print -P "%#") == '#' ]]; then current_state="ROOT" elif [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then - current_state="REMOTE" + if sudo -n true 2>/dev/null; then + current_state="REMOTE_SUDO" + else + current_state="REMOTE" + fi elif sudo -n true 2>/dev/null; then current_state="SUDO" fi |