From 5d8f9926b026b9100efa8676f787b2517162c89f Mon Sep 17 00:00:00 2001 From: nojhan Date: Mon, 1 Apr 2024 12:11:29 +0200 Subject: [PATCH 1/9] doc: add Jolly's emblem --- README.md | 3 + docs/jolly_emblem.svg | 2740 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2743 insertions(+) create mode 100644 docs/jolly_emblem.svg diff --git a/README.md b/README.md index ee38404..612a6fc 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,9 @@ 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. +![A ship with black sails, three of which are printed with the symbols "~", "$", and ">"; going out of a circling boat wheel with sun rays in her back; and navigating a blue wave with froth going over a banner that reads "Liquid Prompt". A large black flag is attached to the front shroud, showing a skull and two crossed bones, on top of a legend reading "jolly roger".](docs/jolly_emblem.svg) + + Preview ------- diff --git a/docs/jolly_emblem.svg b/docs/jolly_emblem.svg new file mode 100644 index 0000000..c6b6ccd --- /dev/null +++ b/docs/jolly_emblem.svg @@ -0,0 +1,2740 @@ + + + +Liquid Prompt — Jolly Roger Emblem + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + nojhan, dolmen, Rycieos & co~ https://github.com/ liquidprompt/liquidprompt + + + jollyrogerLiquid Prompt — Jolly Roger Emblem2024-04-01nojhanLiquid PromptBashZshAGPL~$>Jolly Rogeren_USA ship with black sails, three of which are printed with the symbols "~", "$", and ">"; going out of a circling boat wheel with sun rays in her back; and navigating a blue wave with froth going over a banner that reads "Liquid Prompt". A large black flag is attached to the front shroud, showing a skull and two crossed bones, on top of a legend reading "jolly roger".Mariana Ruiz "LadyofHats " Villarreal From 721554725def20ea7696fcf3bbe9df4b0b1d4edb Mon Sep 17 00:00:00 2001 From: nojhan Date: Mon, 1 Apr 2024 14:18:08 +0200 Subject: [PATCH 2/9] refactor: better emblem --- docs/jolly_emblem.svg | 109 +++++++++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 44 deletions(-) diff --git a/docs/jolly_emblem.svg b/docs/jolly_emblem.svg index c6b6ccd..3ecd7ff 100644 --- a/docs/jolly_emblem.svg +++ b/docs/jolly_emblem.svg @@ -33,9 +33,9 @@ inkscape:deskcolor="black" inkscape:document-units="mm" showgrid="false" - inkscape:zoom="1.3258182" - inkscape:cx="463.86449" - inkscape:cy="439.35133" + inkscape:zoom="1.6384291" + inkscape:cx="350.0304" + inkscape:cy="436.08845" inkscape:current-layer="g30972" showguides="true" />jollyroger Date: Mon, 1 Apr 2024 14:23:39 +0200 Subject: [PATCH 3/9] doc: link to LP + screenshot --- docs/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/README.md b/docs/README.md index c2ea1e0..4a94ac4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -149,6 +149,13 @@ States that rarely change or evolve slowly are less important. 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 ## 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. > Jolly always displays important segments, even in their default state, so that they are always located where the user expect them to be. +![](../screenshots/variant-chevron.png) + ## Sectioning From 3aaf5fa592705e1576432fb2544812155da3d19c Mon Sep 17 00:00:00 2001 From: nojhan Date: Mon, 1 Apr 2024 14:32:13 +0200 Subject: [PATCH 4/9] doc: more screenshots in design --- docs/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/README.md b/docs/README.md index 4a94ac4..65b50e3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -204,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. +![](../screenshots/variant-round.png) + ## Semantic Sequences @@ -215,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 > (e.g. "to be pushed" = local-to-remote = right-to-left). +![](../screenshots/git_commits.png) + ## Semantic Spaces @@ -243,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. > 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. +![](../screenshots/variant-chevron_colors-cyan-magenta.png) + ## Semantic Thresholds From 0c92a648ce167118947113322fc963b04fe85ee7 Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Tue, 7 Jan 2025 16:47:52 +0100 Subject: [PATCH 5/9] Some patches for README.md (#4) doc(README): fix typos and deprecated features - LP_ENABLE_VCS_DIFFSTATS no more exist and is not documented. - Remove LP_ENABLE_UNCOMMITED. --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 612a6fc..447d6f2 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ It is an original prompt design, very carefully designed, that will completely changes the way you imagine the prompt. 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. Has such, you may find it a little bit disconcerting at first. @@ -63,7 +63,7 @@ The prompt itself is designed in three lines: ### 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: -- 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). ![](screenshots/variant-chevron.png) @@ -100,7 +100,7 @@ For example: 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. You will either need a compatible font, or use a variant that does not need them, like "text" and "jolly". @@ -152,8 +152,6 @@ except for the ones defining colors, specific marks and disabling some features. The following options are honored: - [`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_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), @@ -176,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 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: -- `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-round.conf" (need a Nerd-fonts font), -- `source presets/variant-text.conf" (the one that works anywhere). +- `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-round.conf` (need a Nerd-fonts font), +- `source presets/variant-text.conf` (the one that works anywhere). A second set changes the colors: @@ -519,6 +517,7 @@ The color starting the gradient of the line of the middle section. Default is white. Valus being linearly interpolated up to `JOLLY_COLOR_LINE_END`, + it is recommended to stick to aligned ANSI values (i.e. greys) @@ -527,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. Default is black. + Valus being linearly interpolated from `JOLLY_COLOR_LINE_START`, + it is recommended to stick to aligned ANSI values (i.e. greys). From afc9e26765e5ce7de6b45ce9a816338de75bb522 Mon Sep 17 00:00:00 2001 From: steelman Date: Tue, 7 Jan 2025 16:52:06 +0100 Subject: [PATCH 6/9] fix: change scope of _lp_jolly_make_env_inline_right Make it visible outside of _lp_dotmatrix_make_env, as its left counterpart. --- jolly.theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jolly.theme b/jolly.theme index c8e6a0c..4e246b4 100644 --- a/jolly.theme +++ b/jolly.theme @@ -485,7 +485,7 @@ _lp_jolly_make_env() { fi # History section. - local _lp_jolly_make_env_inline_right= + _lp_jolly_make_env_inline_right= if _lp_os; then _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" From 9fb90f451edfe778b424777813ebf60e9ea187da Mon Sep 17 00:00:00 2001 From: nojhan Date: Sat, 11 Jan 2025 20:32:10 +0100 Subject: [PATCH 7/9] fix(hostname): was sometimes showing the username --- jolly.theme | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/jolly.theme b/jolly.theme index 4e246b4..64ca113 100644 --- a/jolly.theme +++ b/jolly.theme @@ -851,17 +851,18 @@ __jolly_activate_user() { __jolly_activate_hostname() { - local hostname + local hostname= if _lp_hostname; then case "$lp_connection" in 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" 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" else - hostname="$lp_hostname" + hostname="$hostname" fi # If we want a different color for each host if (( LP_ENABLE_SSH_COLORS )); then @@ -882,8 +883,11 @@ __jolly_activate_hostname() { hostname="${JOLLY_HOST_LOCAL}" fi - __jolly_make_field "$hostname" ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"} - _JOLLY_HOSTNAME="${jolly_field}" + if __jolly_make_field "$hostname" ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"} ; then + _JOLLY_HOSTNAME="${jolly_field}" + else + _JOLLY_HOSTNAME="${lp_hostname}" + fi } @@ -1224,7 +1228,8 @@ __jolly_join_fields() { } __jolly_make_field() { # string, color_array - local lp_terminal_format string="${1-}" + local string="${1-}" + local lp_terminal_format [[ -z $string ]] && return 1 shift From da773f822cc747e72cefcd65d678fde8f97a13c4 Mon Sep 17 00:00:00 2001 From: nojhan Date: Sat, 11 Jan 2025 20:49:33 +0100 Subject: [PATCH 8/9] feat(env): display env name before contents Remove container duplicate. --- jolly.theme | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/jolly.theme b/jolly.theme index 64ca113..fa6b870 100644 --- a/jolly.theme +++ b/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 local lp_join _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 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 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 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 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 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 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 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 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 if _lp_cmake ; then local lp_join _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" fi - if _lp_container; then - _lp_jolly_make_env_inline_left+="$d$lp_container$b" - fi if _lp_modules; then _lp_jolly_make_env_inline_left+="$d" _lp_join "$I" "${lp_modules[@]}" From a3de7483472d80048408886f6bc523002124a189 Mon Sep 17 00:00:00 2001 From: nojhan Date: Sat, 11 Jan 2025 20:50:14 +0100 Subject: [PATCH 9/9] fix(hostname): handle background color when failed --- jolly.theme | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jolly.theme b/jolly.theme index fa6b870..184b94e 100644 --- a/jolly.theme +++ b/jolly.theme @@ -883,7 +883,11 @@ __jolly_activate_hostname() { if __jolly_make_field "$hostname" ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"} ; then _JOLLY_HOSTNAME="${jolly_field}" else - _JOLLY_HOSTNAME="${lp_hostname}" + if __jolly_make_field "$lp_hostname" ${JOLLY_COLOR_LITE[@]+"${JOLLY_COLOR_LITE[@]}"} ; then + _JOLLY_HOSTNAME="${jolly_field}" + else + _JOLLY_HOSTNAME="${lp_hostname}" + fi fi }