Compare commits
9 commits
v3.0.0.alp
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a3de748347 | |||
| da773f822c | |||
| 9fb90f451e | |||
|
|
afc9e26765 | ||
|
|
0c92a648ce |
||
| 3aaf5fa592 | |||
| ad41163634 | |||
| 721554725d | |||
| 5d8f9926b0 |
4 changed files with 2816 additions and 30 deletions
24
README.md
24
README.md
|
|
@ -7,13 +7,16 @@ It is an original prompt design, very carefully designed,
|
||||||
that will completely changes the way you imagine the prompt.
|
that will completely changes the way you imagine the prompt.
|
||||||
|
|
||||||
It is focused on *improving the user experience*,
|
It is focused on *improving the user experience*,
|
||||||
by vastly improving the ability of the user to immediatly spot
|
by vastly improving the ability of the user to immediately spot
|
||||||
what she should do following her system's state changes.
|
what she should do following her system's state changes.
|
||||||
|
|
||||||
Has such, you may find it a little bit disconcerting at first.
|
Has such, you may find it a little bit disconcerting at first.
|
||||||
But we believe that the advantages of this design makes it worth the effort.
|
But we believe that the advantages of this design makes it worth the effort.
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
Preview
|
Preview
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
@ -60,7 +63,7 @@ The prompt itself is designed in three lines:
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
For instance, in the following prompt, you can see that the user is in a Git repository and has some action waiting to be done:
|
For instance, in the following prompt, you can see that the user is in a Git repository and has some action waiting to be done:
|
||||||
- the rightmost blue "≠" indicates that there are some modifications waiting to be commited (hence the directional hint, from a diff to the branch).
|
- the rightmost blue "≠" indicates that there are some modifications waiting to be committed (hence the directional hint, from a diff to the branch).
|
||||||
- the leftmost blue segment indicates that there are some commits that may be pushed to the remote (hence the directional hint, from the branch to the VCS symbol).
|
- the leftmost blue segment indicates that there are some commits that may be pushed to the remote (hence the directional hint, from the branch to the VCS symbol).
|
||||||
|
|
||||||

|

|
||||||
|
|
@ -97,7 +100,7 @@ For example:
|
||||||
source ~/lp-jolly/jolly.theme && lp_theme jolly
|
source ~/lp-jolly/jolly.theme && lp_theme jolly
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: The recommended segment markers (the "chevron" variant) uses characters in the private section of unicode
|
NOTE: The recommended segment markers (the "chevron" variant) uses characters in the private section of Unicode
|
||||||
that are defined by the "Nerd-fonts" project.
|
that are defined by the "Nerd-fonts" project.
|
||||||
You will either need a compatible font, or use a variant that does not need them, like "text" and "jolly".
|
You will either need a compatible font, or use a variant that does not need them, like "text" and "jolly".
|
||||||
|
|
||||||
|
|
@ -149,8 +152,6 @@ except for the ones defining colors, specific marks and disabling some features.
|
||||||
The following options are honored:
|
The following options are honored:
|
||||||
|
|
||||||
- [`LP_ENABLE_PERM`](https://liquidprompt.readthedocs.io/en/stable/config.html#LP_ENABLE_PERM),
|
- [`LP_ENABLE_PERM`](https://liquidprompt.readthedocs.io/en/stable/config.html#LP_ENABLE_PERM),
|
||||||
- [`LP_ENABLE_VCS_DIFFSTATS`](https://liquidprompt.readthedocs.io/en/stable/config.html#LP_ENABLE_VCS_DIFFSTATS),
|
|
||||||
- [`LP_ENABLE_UNCOMMITED`](https://liquidprompt.readthedocs.io/en/stable/config.html#LP_ENABLE_UNCOMMITED),
|
|
||||||
- [`LP_MARK_BATTERY`](https://liquidprompt.readthedocs.io/en/stable/config.html#LP_MARK_BATTERY),
|
- [`LP_MARK_BATTERY`](https://liquidprompt.readthedocs.io/en/stable/config.html#LP_MARK_BATTERY),
|
||||||
- [`LP_MARK_LOAD`](https://liquidprompt.readthedocs.io/en/stable/config.html#LP_MARK_LOAD),
|
- [`LP_MARK_LOAD`](https://liquidprompt.readthedocs.io/en/stable/config.html#LP_MARK_LOAD),
|
||||||
- [`LP_MARK_TEMP`](https://liquidprompt.readthedocs.io/en/stable/config.html#LP_MARK_TEMP),
|
- [`LP_MARK_TEMP`](https://liquidprompt.readthedocs.io/en/stable/config.html#LP_MARK_TEMP),
|
||||||
|
|
@ -173,13 +174,13 @@ Note: the order in which you load the presets may be important.
|
||||||
When changing the colors of the first line, presets needs to be loaded
|
When changing the colors of the first line, presets needs to be loaded
|
||||||
from your shell configuration and not just sourced in the prompt.
|
from your shell configuration and not just sourced in the prompt.
|
||||||
|
|
||||||
A first set is are called "variants" and mainly change the segment joints,
|
A first set is called "variants" and mainly change the segment joints,
|
||||||
but can also impact the icons on some variants:
|
but can also impact the icons on some variants:
|
||||||
|
|
||||||
- `source presets/variant-chevron.conf" (the *recommended*, need a Nerd-fonts font),
|
- `source presets/variant-chevron.conf` (the *recommended*, need a Nerd-fonts font),
|
||||||
- `source presets/variant-slant.conf" (need a Nerd-fonts font),
|
- `source presets/variant-slant.conf` (need a Nerd-fonts font),
|
||||||
- `source presets/variant-round.conf" (need a Nerd-fonts font),
|
- `source presets/variant-round.conf` (need a Nerd-fonts font),
|
||||||
- `source presets/variant-text.conf" (the one that works anywhere).
|
- `source presets/variant-text.conf` (the one that works anywhere).
|
||||||
|
|
||||||
A second set changes the colors:
|
A second set changes the colors:
|
||||||
|
|
||||||
|
|
@ -516,6 +517,7 @@ The color starting the gradient of the line of the middle section.
|
||||||
Default is white.
|
Default is white.
|
||||||
|
|
||||||
Valus being linearly interpolated up to `JOLLY_COLOR_LINE_END`,
|
Valus being linearly interpolated up to `JOLLY_COLOR_LINE_END`,
|
||||||
|
|
||||||
it is recommended to stick to aligned ANSI values (i.e. greys)
|
it is recommended to stick to aligned ANSI values (i.e. greys)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -524,7 +526,9 @@ it is recommended to stick to aligned ANSI values (i.e. greys)
|
||||||
The color ending the gradient of the line of the middle section.
|
The color ending the gradient of the line of the middle section.
|
||||||
Default is black.
|
Default is black.
|
||||||
|
|
||||||
|
|
||||||
Valus being linearly interpolated from `JOLLY_COLOR_LINE_START`,
|
Valus being linearly interpolated from `JOLLY_COLOR_LINE_START`,
|
||||||
|
|
||||||
it is recommended to stick to aligned ANSI values (i.e. greys).
|
it is recommended to stick to aligned ANSI values (i.e. greys).
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,13 @@ States that rarely change or evolve slowly are less important.
|
||||||
Each aspect of theming should have a related configuration variable.
|
Each aspect of theming should have a related configuration variable.
|
||||||
|
|
||||||
|
|
||||||
|
## More details
|
||||||
|
|
||||||
|
If you want to know more, check our
|
||||||
|
[opinionated prompt systems comparison](https://github.com/liquidprompt/liquidprompt/wiki/Why)
|
||||||
|
that goes into more details and give examples across various other prompt systems.
|
||||||
|
|
||||||
|
|
||||||
# Jolly's Design Principles
|
# Jolly's Design Principles
|
||||||
|
|
||||||
## Stability
|
## Stability
|
||||||
|
|
@ -164,6 +171,8 @@ change too much the location of information previously displayed.
|
||||||
> Sections are thus organized from left to right, in decreasing order of stability.
|
> Sections are thus organized from left to right, in decreasing order of stability.
|
||||||
> Jolly always displays important segments, even in their default state, so that they are always located where the user expect them to be.
|
> Jolly always displays important segments, even in their default state, so that they are always located where the user expect them to be.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
## Sectioning
|
## Sectioning
|
||||||
|
|
||||||
|
|
@ -195,6 +204,8 @@ To ease the visual browsing of those segments, it uses the visual separators int
|
||||||
|
|
||||||
> While Jolly can theoretically use many of the "powerline" characters as separators, it recommends using the "arrow" one, which fits better the *semantic sequence* principle.
|
> While Jolly can theoretically use many of the "powerline" characters as separators, it recommends using the "arrow" one, which fits better the *semantic sequence* principle.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
## Semantic Sequences
|
## Semantic Sequences
|
||||||
|
|
||||||
|
|
@ -206,6 +217,8 @@ For instance from the more generic to the more specific, from a natural order of
|
||||||
> Spaced reverse arrows in the VCS sections actually show the direction of the expected action
|
> Spaced reverse arrows in the VCS sections actually show the direction of the expected action
|
||||||
> (e.g. "to be pushed" = local-to-remote = right-to-left).
|
> (e.g. "to be pushed" = local-to-remote = right-to-left).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
## Semantic Spaces
|
## Semantic Spaces
|
||||||
|
|
||||||
|
|
@ -234,6 +247,8 @@ Important information may be displayed using two other colors: one for informati
|
||||||
> Its default is set to blue/yellow, following the most classical recommendation to bypass the most common colorblindness issues.
|
> Its default is set to blue/yellow, following the most classical recommendation to bypass the most common colorblindness issues.
|
||||||
> The basic segments use tones of dark and light greys with AAA contrast between them, appearing as black and white on many classical terminal backgrounds.
|
> The basic segments use tones of dark and light greys with AAA contrast between them, appearing as black and white on many classical terminal backgrounds.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
## Semantic Thresholds
|
## Semantic Thresholds
|
||||||
|
|
||||||
|
|
|
||||||
2761
docs/jolly_emblem.svg
Normal file
2761
docs/jolly_emblem.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 399 KiB |
46
jolly.theme
46
jolly.theme
|
|
@ -444,40 +444,37 @@ _lp_jolly_make_env() {
|
||||||
if _lp_env_vars "${LP_COLOR_ENV_VARS_SET}" "${LP_COLOR_ENV_VARS_UNSET}"; then
|
if _lp_env_vars "${LP_COLOR_ENV_VARS_SET}" "${LP_COLOR_ENV_VARS_UNSET}"; then
|
||||||
local lp_join
|
local lp_join
|
||||||
_lp_join "$I" ${lp_env_vars[@]}
|
_lp_join "$I" ${lp_env_vars[@]}
|
||||||
_lp_jolly_make_env_inline_left+="$d${lp_join}$b"
|
_lp_jolly_make_env_inline_left+="${d}${lp_join}$b"
|
||||||
fi
|
fi
|
||||||
if _lp_software_collections ; then
|
if _lp_software_collections ; then
|
||||||
_lp_jolly_make_env_inline_left+="$d${lp_software_collections}$b"
|
_lp_jolly_make_env_inline_left+="${d}sc:${lp_software_collections}$b"
|
||||||
fi
|
fi
|
||||||
if _lp_python_env ; then
|
if _lp_python_env ; then
|
||||||
_lp_jolly_make_env_inline_left+="$d${lp_python_env}$b"
|
_lp_jolly_make_env_inline_left+="${d}py:${lp_python_env}$b"
|
||||||
fi
|
fi
|
||||||
if _lp_node_env ; then
|
if _lp_node_env ; then
|
||||||
_lp_jolly_make_env_inline_left+="$d${lp_node_env}$b"
|
_lp_jolly_make_env_inline_left+="${d}node:${lp_node_env}$b"
|
||||||
fi
|
fi
|
||||||
if _lp_ruby_env ; then
|
if _lp_ruby_env ; then
|
||||||
_lp_jolly_make_env_inline_left+="$d${lp_ruby_env}$b"
|
_lp_jolly_make_env_inline_left+="${d}ruby:${lp_ruby_env}$b"
|
||||||
fi
|
fi
|
||||||
if _lp_container ; then
|
if _lp_container ; then
|
||||||
_lp_jolly_make_env_inline_left+="$d${lp_container}$b"
|
_lp_jolly_make_env_inline_left+="${d}c:${lp_container}$b"
|
||||||
fi
|
fi
|
||||||
if _lp_kubernetes_context ; then
|
if _lp_kubernetes_context ; then
|
||||||
_lp_jolly_make_env_inline_left+="$d${lp_kubernetes_context}$b"
|
_lp_jolly_make_env_inline_left+="${d}kub:${lp_kubernetes_context}$b"
|
||||||
fi
|
fi
|
||||||
if _lp_terraform_env ; then
|
if _lp_terraform_env ; then
|
||||||
_lp_jolly_make_env_inline_left+="$d${lp_terraform_env}$b"
|
_lp_jolly_make_env_inline_left+="${d}tf:${lp_terraform_env}$b"
|
||||||
fi
|
fi
|
||||||
if _lp_aws_profile ; then
|
if _lp_aws_profile ; then
|
||||||
_lp_jolly_make_env_inline_left+="$d${lp_aws_profile}$b"
|
_lp_jolly_make_env_inline_left+="${d}aws:${lp_aws_profile}$b"
|
||||||
fi
|
fi
|
||||||
if _lp_cmake ; then
|
if _lp_cmake ; then
|
||||||
local lp_join
|
local lp_join
|
||||||
_lp_join "$I" ${lp_cmake_c_compiler} ${lp_cmake_cxx_compiler} ${lp_cmake_generator} ${lp_cmake_buildtype}
|
_lp_join "$I" ${lp_cmake_c_compiler} ${lp_cmake_cxx_compiler} ${lp_cmake_generator} ${lp_cmake_buildtype}
|
||||||
_lp_jolly_make_env_inline_left+="$d${lp_join}$b"
|
_lp_jolly_make_env_inline_left+="$d${lp_join}$b"
|
||||||
fi
|
fi
|
||||||
if _lp_container; then
|
|
||||||
_lp_jolly_make_env_inline_left+="$d$lp_container$b"
|
|
||||||
fi
|
|
||||||
if _lp_modules; then
|
if _lp_modules; then
|
||||||
_lp_jolly_make_env_inline_left+="$d"
|
_lp_jolly_make_env_inline_left+="$d"
|
||||||
_lp_join "$I" "${lp_modules[@]}"
|
_lp_join "$I" "${lp_modules[@]}"
|
||||||
|
|
@ -485,7 +482,7 @@ _lp_jolly_make_env() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# History section.
|
# History section.
|
||||||
local _lp_jolly_make_env_inline_right=
|
_lp_jolly_make_env_inline_right=
|
||||||
if _lp_os; then
|
if _lp_os; then
|
||||||
_lp_join "$I" ${lp_os_arch} ${lp_os_family} ${lp_os_kernel} ${lp_os_distrib} ${lp_os_version}
|
_lp_join "$I" ${lp_os_arch} ${lp_os_family} ${lp_os_kernel} ${lp_os_distrib} ${lp_os_version}
|
||||||
_lp_jolly_make_env_inline_right+="$d${lp_join}$b"
|
_lp_jolly_make_env_inline_right+="$d${lp_join}$b"
|
||||||
|
|
@ -851,17 +848,18 @@ __jolly_activate_user() {
|
||||||
|
|
||||||
|
|
||||||
__jolly_activate_hostname() {
|
__jolly_activate_hostname() {
|
||||||
local hostname
|
local hostname=
|
||||||
if _lp_hostname; then
|
if _lp_hostname; then
|
||||||
case "$lp_connection" in
|
case "$lp_connection" in
|
||||||
ssh)
|
ssh)
|
||||||
local client_ip client_port server_ip server_port hostname=
|
hostname="$lp_hostname"
|
||||||
|
local client_ip client_port server_ip server_port
|
||||||
IFS=" " read -r client_ip client_port server_ip server_port <<<"$SSH_CONNECTION"
|
IFS=" " read -r client_ip client_port server_ip server_port <<<"$SSH_CONNECTION"
|
||||||
local username=${USER:-${USERNAME:-${LOGNAME-}}}
|
local username=${USER:-${USERNAME:-${LOGNAME-}}}
|
||||||
if _lp_create_link "ssh://${username}@${server_ip}:${server_port}" "$lp_hostname"; then
|
if _lp_create_link "ssh://${username}@${server_ip}:${server_port}" "$hostname"; then
|
||||||
hostname="$link"
|
hostname="$link"
|
||||||
else
|
else
|
||||||
hostname="$lp_hostname"
|
hostname="$hostname"
|
||||||
fi
|
fi
|
||||||
# If we want a different color for each host
|
# If we want a different color for each host
|
||||||
if (( LP_ENABLE_SSH_COLORS )); then
|
if (( LP_ENABLE_SSH_COLORS )); then
|
||||||
|
|
@ -882,8 +880,15 @@ __jolly_activate_hostname() {
|
||||||
hostname="${JOLLY_HOST_LOCAL}"
|
hostname="${JOLLY_HOST_LOCAL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
__jolly_make_field "$hostname" ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"}
|
if __jolly_make_field "$hostname" ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"} ; then
|
||||||
_JOLLY_HOSTNAME="${jolly_field}"
|
_JOLLY_HOSTNAME="${jolly_field}"
|
||||||
|
else
|
||||||
|
if __jolly_make_field "$lp_hostname" ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"} ; then
|
||||||
|
_JOLLY_HOSTNAME="${jolly_field}"
|
||||||
|
else
|
||||||
|
_JOLLY_HOSTNAME="${lp_hostname}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1224,7 +1229,8 @@ __jolly_join_fields() {
|
||||||
}
|
}
|
||||||
|
|
||||||
__jolly_make_field() { # string, color_array
|
__jolly_make_field() { # string, color_array
|
||||||
local lp_terminal_format string="${1-}"
|
local string="${1-}"
|
||||||
|
local lp_terminal_format
|
||||||
[[ -z $string ]] && return 1
|
[[ -z $string ]] && return 1
|
||||||
|
|
||||||
shift
|
shift
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue