Merge pull request #1445 from davidpfarrell/soft-separator
Adds soft-separator support to powerline main + multiline themespull/1442/head
commit
1383af0ca8
|
|
@ -43,6 +43,10 @@ export THEME_CLOCK_FORMAT="%H:%M:%S"
|
|||
|
||||
The time/date is printed by the `date` command, so refer to its man page to change the format.
|
||||
|
||||
### Soft Separators
|
||||
|
||||
Adjacent segments having the same background color will use a less-pronouced (i.e. soft) separator between them.
|
||||
|
||||
### Segment Order
|
||||
|
||||
The contents of both prompt sides can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:
|
||||
|
|
|
|||
|
|
@ -9,14 +9,20 @@ function __powerline_right_segment {
|
|||
local params=( $1 )
|
||||
IFS="${OLD_IFS}"
|
||||
local separator_char="${POWERLINE_RIGHT_SEPARATOR}"
|
||||
local separator_char_soft="${POWERLINE_RIGHT_SEPARATOR_SOFT}"
|
||||
local padding="${POWERLINE_PADDING}"
|
||||
local separator_color=""
|
||||
|
||||
if [[ "${SEGMENTS_AT_RIGHT}" -eq 0 ]]; then
|
||||
separator_char="${POWERLINE_RIGHT_END}"
|
||||
separator_color="$(set_color ${params[1]} -)"
|
||||
else
|
||||
if [[ "${LAST_SEGMENT_COLOR}" -eq "${params[1]}" ]]; then
|
||||
separator_color="$(set_color - ${LAST_SEGMENT_COLOR})"
|
||||
separator_char=${separator_char_soft}
|
||||
else
|
||||
separator_color="$(set_color ${params[1]} ${LAST_SEGMENT_COLOR})"
|
||||
fi
|
||||
(( padding += 1 ))
|
||||
fi
|
||||
RIGHT_PROMPT+="${separator_color}${separator_char}${normal}$(set_color - ${params[1]}) ${params[0]} ${normal}$(set_color - ${COLOR})${normal}"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@
|
|||
|
||||
PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:="❯"}
|
||||
POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""}
|
||||
POWERLINE_LEFT_SEPARATOR_SOFT=${POWERLINE_LEFT_SEPARATOR_SOFT:=""}
|
||||
POWERLINE_RIGHT_SEPARATOR=${POWERLINE_RIGHT_SEPARATOR:=""}
|
||||
POWERLINE_RIGHT_SEPARATOR_SOFT=${POWERLINE_RIGHT_SEPARATOR_SOFT:=""}
|
||||
POWERLINE_LEFT_END=${POWERLINE_LEFT_END:=""}
|
||||
POWERLINE_RIGHT_END=${POWERLINE_RIGHT_END:=""}
|
||||
POWERLINE_PADDING=${POWERLINE_PADDING:=2}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@ You can change the format using the following variable:
|
|||
|
||||
The time/date is printed by the `date` command, so refer to its man page to change the format.
|
||||
|
||||
### Soft Separators
|
||||
|
||||
Adjacent segments having the same background color will use a less-pronouced (i.e. soft) separator between them.
|
||||
|
||||
### Segment Order
|
||||
|
||||
The contents of the prompt can be "reordered", all the "segments" (every piece of information) can take any place. The currently available segments are:
|
||||
|
|
|
|||
|
|
@ -175,11 +175,16 @@ function __powerline_left_segment {
|
|||
local params=( $1 )
|
||||
IFS="${OLD_IFS}"
|
||||
local separator_char="${POWERLINE_LEFT_SEPARATOR}"
|
||||
local separator_char_soft="${POWERLINE_LEFT_SEPARATOR_SOFT}"
|
||||
local separator=""
|
||||
|
||||
if [[ "${SEGMENTS_AT_LEFT}" -gt 0 ]]; then
|
||||
if [[ "${LAST_SEGMENT_COLOR}" -eq "${params[1]}" ]]; then
|
||||
separator="$(set_color - ${LAST_SEGMENT_COLOR})${separator_char_soft}${normal}"
|
||||
else
|
||||
separator="$(set_color ${LAST_SEGMENT_COLOR} ${params[1]})${separator_char}${normal}"
|
||||
fi
|
||||
fi
|
||||
LEFT_PROMPT+="${separator}$(set_color - ${params[1]}) ${params[0]} ${normal}"
|
||||
LAST_SEGMENT_COLOR=${params[1]}
|
||||
(( SEGMENTS_AT_LEFT += 1 ))
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""}
|
||||
POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""}
|
||||
POWERLINE_LEFT_SEPARATOR_SOFT=${POWERLINE_LEFT_SEPARATOR_SOFT:=""}
|
||||
|
||||
USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:=" "}
|
||||
USER_INFO_THEME_PROMPT_COLOR=${POWERLINE_USER_INFO_COLOR:=32}
|
||||
|
|
|
|||
Loading…
Reference in New Issue