1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-13 16:40:08 +00:00

add new icons and add remote_sudo

This commit is contained in:
Michael Louwrens 2018-02-12 11:28:00 +02:00
parent 3893785873
commit 7fff5bd7a6
2 changed files with 14 additions and 6 deletions

View file

@ -27,6 +27,7 @@ case $POWERLEVEL9K_MODE in
RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # 
CARRIAGE_RETURN_ICON $'\u21B5' # ↵ CARRIAGE_RETURN_ICON $'\u21B5' # ↵
ROOT_ICON $'\uE801' #  ROOT_ICON $'\uE801' # 
SUDO_ICON $'\uF09C' # 
RUBY_ICON $'\uE847 ' #  RUBY_ICON $'\uE847 ' # 
AWS_ICON $'\uE895' #  AWS_ICON $'\uE895' # 
AWS_EB_ICON $'\U1F331 ' # 🌱 AWS_EB_ICON $'\U1F331 ' # 🌱
@ -105,6 +106,7 @@ case $POWERLEVEL9K_MODE in
RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # 
CARRIAGE_RETURN_ICON $'\u21B5' # ↵ CARRIAGE_RETURN_ICON $'\u21B5' # ↵
ROOT_ICON $'\uF201' #  ROOT_ICON $'\uF201' # 
SUDO_ICON $'\uF09C' # 
RUBY_ICON $'\uF219 ' #  RUBY_ICON $'\uF219 ' # 
AWS_ICON $'\uF270' #  AWS_ICON $'\uF270' # 
AWS_EB_ICON $'\U1F331 ' # 🌱 AWS_EB_ICON $'\U1F331 ' # 🌱
@ -188,6 +190,7 @@ case $POWERLEVEL9K_MODE in
RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # 
CARRIAGE_RETURN_ICON $'\u21B5' # ↵ CARRIAGE_RETURN_ICON $'\u21B5' # ↵
ROOT_ICON '\u'$CODEPOINT_OF_OCTICONS_ZAP #  ROOT_ICON '\u'$CODEPOINT_OF_OCTICONS_ZAP # 
SUDO_ICON '\u'$CODEPOINT_OF_AWESOME_UNLOCK # 
RUBY_ICON '\u'$CODEPOINT_OF_OCTICONS_RUBY' ' #  RUBY_ICON '\u'$CODEPOINT_OF_OCTICONS_RUBY' ' # 
AWS_ICON '\u'$CODEPOINT_OF_AWESOME_SERVER #  AWS_ICON '\u'$CODEPOINT_OF_AWESOME_SERVER # 
AWS_EB_ICON $'\U1F331 ' # 🌱 AWS_EB_ICON $'\U1F331 ' # 🌱
@ -258,7 +261,7 @@ case $POWERLEVEL9K_MODE in
RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' #  RIGHT_SUBSEGMENT_SEPARATOR $'\uE0B3' # 
CARRIAGE_RETURN_ICON $'\u21B5' # ↵ CARRIAGE_RETURN_ICON $'\u21B5' # ↵
ROOT_ICON $'\uE614 ' #  ROOT_ICON $'\uE614 ' # 
SUDO_ICON $'\uE0A2' #  SUDO_ICON $'\uF09C' # 
RUBY_ICON $'\uF219 ' #  RUBY_ICON $'\uF219 ' # 
AWS_ICON $'\uF270' #  AWS_ICON $'\uF270' # 
AWS_EB_ICON $'\UF1BD ' #  AWS_EB_ICON $'\UF1BD ' # 

View file

@ -589,10 +589,11 @@ prompt_context() {
local current_state="DEFAULT" local current_state="DEFAULT"
typeset -AH context_states typeset -AH context_states
context_states=( context_states=(
"ROOT" "yellow" "ROOT" "yellow"
"SUDO" "yellow" "SUDO" "yellow"
"DEFAULT" "yellow" "DEFAULT" "yellow"
"REMOTE" "yellow" "REMOTE" "yellow"
"REMOTE_SUDO" "yellow"
) )
local content="" local content=""
@ -608,7 +609,11 @@ prompt_context() {
if [[ $(print -P "%#") == '#' ]]; then if [[ $(print -P "%#") == '#' ]]; then
current_state="ROOT" current_state="ROOT"
elif [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then 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 elif sudo -n true 2>/dev/null; then
current_state="SUDO" current_state="SUDO"
fi fi