pax_global_header00006660000000000000000000000064146405504550014522gustar00rootroot0000000000000052 comment=3310822ebbc431abfc4aecb7b816a88c966658a0 liquidprompt-2.2.1/000077500000000000000000000000001464055045500142555ustar00rootroot00000000000000liquidprompt-2.2.1/.editorconfig000066400000000000000000000012251464055045500167320ustar00rootroot00000000000000# EditorConfig configuration for liquidprompt # http://EditorConfig.org # Top-most EditorConfig file root = true [*] charset = utf-8 indent_style = space trim_trailing_whitespace = true insert_final_newline = true spelling_language = en-US [liquidprompt,*.theme,*.bashrc,.*.conf,*.ps1,*.css,/tools/config-from-doc.sh] indent_size = 4 max_line_length = 120 [*.sh,*.zsh,PKGBUILD] indent_size = 2 max_line_length = 120 [*.py] indent_size = 4 [*.md] # Apparently trailing whitspaces are meaningfull in Markdown trim_trailing_whitespace = false [*.yml] indent_size = 2 [*.bat] indent_size = 8 indent_style = tab [*.rst] indent_size = 3 max_line_length = 80 liquidprompt-2.2.1/.github/000077500000000000000000000000001464055045500156155ustar00rootroot00000000000000liquidprompt-2.2.1/.github/ISSUE_TEMPLATE/000077500000000000000000000000001464055045500200005ustar00rootroot00000000000000liquidprompt-2.2.1/.github/ISSUE_TEMPLATE/bug.md000066400000000000000000000013471464055045500211040ustar00rootroot00000000000000--- name: Bug report about: Create a report to help us improve Liquid Prompt title: '' labels: 'bug' assignees: '' --- Bug report file: ### Steps to Reproduce 1. 2. 3. ### Expected Behavior ### Current Behavior ### Possible Solution liquidprompt-2.2.1/.github/ISSUE_TEMPLATE/config.yml000066400000000000000000000000341464055045500217650ustar00rootroot00000000000000blank_issues_enabled: false liquidprompt-2.2.1/.github/ISSUE_TEMPLATE/enhancement.md000066400000000000000000000007301464055045500226070ustar00rootroot00000000000000--- name: Feature request about: Suggest an idea for Liquid Prompt title: '' labels: 'enhancement' assignees: '' --- ### Description ### How will this be useful? ### Example prompt liquidprompt-2.2.1/.github/workflows/000077500000000000000000000000001464055045500176525ustar00rootroot00000000000000liquidprompt-2.2.1/.github/workflows/docs-lint.yml000066400000000000000000000007441464055045500222760ustar00rootroot00000000000000name: Lint Documentation on: push: paths: - 'docs/**' pull_request: jobs: docs-lint: name: Lint Documentation runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 1 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.x' - name: Lint run: | cd docs/ python3 -m pip install -r requirements.txt ./docs-lint.sh liquidprompt-2.2.1/.github/workflows/release.yml000066400000000000000000000023231464055045500220150ustar00rootroot00000000000000on: push: tags: - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 name: Create Release With Assets jobs: build: name: Upload Release Asset runs-on: ubuntu-latest permissions: contents: write steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.x' - name: Install Python dependencies working-directory: ./docs run: python3 -m pip install -r requirements.txt - name: Build manual pages working-directory: ./docs run: make man - name: Create output directory run: mkdir -v ./.output - name: Create release tarball run: tar --exclude-vcs --exclude='./.*' --transform 's/^\./liquidprompt/' -zcvf ./.output/liquidprompt-${{ github.ref_name }}.tar.gz . - name: Create release and upload release asset uses: softprops/action-gh-release@v2 with: name: Version ${{ github.ref }} body_path: CHANGELOG.md draft: true prerelease: false files: | liquidprompt ./.output/liquidprompt-${{ github.ref_name }}.tar.gz liquidprompt-2.2.1/.github/workflows/shellcheck.yml000066400000000000000000000004571464055045500225100ustar00rootroot00000000000000name: ShellCheck on: push: paths-ignore: - 'docs/**' pull_request: jobs: shellcheck: runs-on: ubuntu-latest container: image: koalaman/shellcheck-alpine:stable steps: - uses: actions/checkout@v3 with: fetch-depth: 1 - run: ./shellcheck.sh liquidprompt-2.2.1/.github/workflows/tests.yml000066400000000000000000000007261464055045500215440ustar00rootroot00000000000000name: tests on: push: paths-ignore: - 'docs/**' pull_request: jobs: tests: strategy: matrix: os: - ubuntu-latest - macos-latest - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 with: fetch-depth: 1 - name: Install zsh run: sudo apt-get --yes install zsh if: runner.os == 'Linux' - run: ./tests.sh shell: bash liquidprompt-2.2.1/.mailmap000066400000000000000000000030351464055045500156770ustar00rootroot00000000000000nojhan nojhan Alexander Belaev (alexbel) Alex Prengère Alex Prengère Aurélien Requiem Aurélien Requiem Clément Mathieu Christophe Drevet (dr4Ke) François Schmidts (jaesivsm) François Schmidts (jaesivsm) François Schmidts (jaesivsm) Frédéric Lepied Étienne Deparis Felix Chern (dryman) Jean-Sébastien Leroy Joris Dedieu Joris Dedieu Julien Pecqueur Julien Pecqueur Ludovic Rousseau Matthew Micene (nzwulfin) Nicolas Lacourte Olivier Dupuis Ying Li (cyli) Poil Thomas Debesse Rolf Morel (polyphemus) Wilson Maravilha (algaerhythm) Brad Beyenhof liquidprompt-2.2.1/.readthedocs.yml000066400000000000000000000004621464055045500173450ustar00rootroot00000000000000# Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details version: 2 sphinx: configuration: docs/conf.py formats: - htmlzip - pdf build: os: ubuntu-22.04 tools: python: "3" python: install: - requirements: docs/requirements.txt liquidprompt-2.2.1/CHANGELOG.md000066400000000000000000002260461464055045500161000ustar00rootroot00000000000000# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ## [2.2.1] - 2024-07-01 ### Added - **general**: editorconfig file ([#840], [f47a7cd]) - **tools**: bug-report.sh ([3d24865]) ### Fixed - **general**: Bump version number ([2121394]) - **general**: `_lp_version_greatereq` crash on release version with set -u enabled ([2121394]) - **disk**: Error on file system with no space ([#841]) - **perl**: `plenv` and `perlbrew` source displaying "system" ([#834]) - **ruby**: `rbenv` and `rvm-prompt` source displaying "system" ([#834]) - **tmux**: Wrong `LP_TITLE_OPEN` for tmux ([#839]) - **tools**: Remove sprunge.us recommendation ([#837]) - **tools**: Update external-tool-tester.sh with new tools ([6868057]) ### Changed - **disk**: Now will never displays if file system is smaller than `LP_DISK_THRESHOLD` ([#841]) - **docs**: Improve docs around .bashrc ordering ([1139de1]) ## [2.2.0] - 2024-05-22 ### Deprecated - **theme**: Powerline themes deprecated. Use split off project [liquidprompt/liquidprompt-powerline](https://github.com/liquidprompt/liquidprompt-powerline) instead ([#830]) ### Added - **general**: `_lp_fill()` function for use by themes ([#738], [#803]) - **general**: `_lp_join()` function for use by themes ([67a4221]) - **general**: `_lp_version_greatereq()` function for use by themes ([#752]) - **general**: `_lp_version_string()` function for use by themes ([#752]) - **general**: `config-from-doc.sh` script ([#772]) - **general**: Multple config presets ([#755], [#772]) - **chroot**: `LP_ENABLE_CHROOT` config option ([#801]) - **cmake**: CMake option display ([d8254c6]) - **disk**: Disk space display ([#771]) - **display**: `LP_ENABLE_DISPLAY` config option ([#801]) - **docs**: List features disabled by default ([#750]) - **docs**: Spell checking workflow ([787e03e]) - **env**: User defined env variables section ([#722], [#754], [#829]) - **env**: `end_color` paramater to `_lp_env_vars()` ([#798]) - **env**: `LP_SHLVL_THRESHOLD` config option ([#821]) - **error**: Display meaning of exit code ([#729], [#745]) - **git**: Display of remote for branch ([#784]) - **jobs**: Configurable jobs separator ([#743]) - **modules**: Environment modules support ([#763], [#766]) - **multiplexer**: `LP_ENABLE_MUX` config option ([#801]) - **os**: Display OS data ([#724], [#756]) - **path**: Option to disable path display ([#775]) - **path**: Path sections as hyperlinks ([#659], [#668]) - **perl**: Support for Perlbrew and plenv display ([#812]) - **ram**: Display available RAM ([#770], [#788]) - **ruby**: Tests for rvm support ([#815]) - **temp**: `LP_TEMP_SYSFS_IGNORE_FILES` config option ([#807]) - **theme**: Dev env section ([67a4221]) - **theme**: Extra optional parameters to `theme-preview.sh` ([#805]) - **theme**: New Unfold theme ([#746], [#795], [#805]) - **theme**: Status bar example scripts ([#775], [#816]) - **theme**: `LP_THEME` variable to set current theme ([#792]) - **theme**: `templates/minimal/minimal.ps1`; replacing `liquid.ps1` ([#767], [#805]) - **theme**: `_lp__theme_version_check()` hook for themes ([046d830]) - **tmux**: `LP_ENABLE_TMUX_TITLE_PANES` option ([c74a9e4]) ### Fixed - **general**: Some error messages printing to stdout instead of stderr ([#826]) - **bash**: Avoid running `__lp_set_prompt()` multiple times ([#824]) - **bash**: Avoid running hooks on empty command line ([436b1b5]) - **bash**: Runtime of the previous command was still showed on subsequent prompts ([436b1b5]) - **bash**: Command timing incorrect on Bash 5.1+ when not last to init ([6f2ca7e]) - **bash**: Slow `__lp_strip_escapes()` in deep directory hierarchy ([#831]) - **docs**: Improved docs on theme switching ([#765], [#767]) - **docs**: Incorrect reference to test script in developer docs ([#811]) - **docs**: Reword Arch Linux install instructions ([#822], [#823]) - **git**: Printed error if error during interactive rebase ([#758], [#759]) - **hostname**: Hostname hash on systems without `hostname` binary ([#776]) - **load**: Load display on Android systems ([#587]) - **multiplexer**: `_lp_multiplexer()` return variable incorrectly named `lp_mulitplexer` ([#748]) - **python**: Poetry virtualenvs showing "prompt =" ([#760]) - **tests**: Bash preexec tests not working in screen/tmux ([#773]) - **tests**: Shellcheck not checking `liquidprompt` file ([ff44057]) - **theme**: Avoid costly strip escape on filling sequence ([#803]) - **theme-preview**: Set SSH context for display ([#769]) - **theme-preview**: Stop indenting prompts to fix multiline prompts ([#744]) - **zsh**: errors when `ksh_arrays` set ([708635b]) ### Changed - **general**: Move project to "liquidprompt" GitHub organization. - **docs**: Improve marketing ([#731]) - **docs**: Unify project name as "Liquid Prompt" ([#677]) - **docs**: Update docs with new features in v2.2 ([#795]) - **error**: Avoid showing the 130 error code after hitting Ctrl-C or empty command line ([#827]) - **tests**: Print name of failed tests at end of script ([9992fce]) - **theme**: `liquid.ps1` reworked and moved to `templates/minimal/minimal.ps1` ([#805]) ### Removed - **theme**: `liquid.ps1`; replaced with `templates/minimal/minimal.ps1` ([#767], [#805]) ## [2.1.2] - 2022-06-08 ### Fixed - **bash**: `PROMPT_COMMAND` not saved and respected on first load ([#715]) ## [2.1.1] - 2022-05-26 ### Fixed - **battery**: Error messages printed with buggy driver with sysfs backend ([#713]) - **temp**: Error messages printed with buggy driver with sysfs backend ([#713]) ## [2.1.0] - 2022-05-25 ### Deprecated - **env**: `LP_ENABLE_FQDN` replaced with `LP_HOSTNAME_METHOD=full` ([#472]) - **utils**: `_lp_as_text()` replaced with `__lp_strip_escapes()` ([6085cd2]) ### Added - **aws**: AWS profile display ([#496], [#679], [4c8ac92]) - **bash**: Compatibility with bash-preexec ([#672]) - **battery**: Linux sysfs backend ([#689]) - **container**: Container status data source ([#569], [#612], [#709]) - **env**: `LP_HOSTNAME_METHOD=fqdn` displays true FQDN ([#472]) - **env**: `LP_HOSTNAME_METHOD=pretty` shows display name ([#596]) - **env**: Nested shell level data source ([#606]) - **hg**: `LP_HG_COMMAND` config option to customize `hg` binary ([#701]) - **k8s**: kubectl current context display ([#578], [#673], [#681], [#695], [d41b5c8]) - **multiplexer**: Custom prompt brackets in multiplexers ([#453]) - **node**: Node.js environment display ([#298]) - **path**: Return unescaped path in *lp_path* in `_lp_path_format()` ([a23af79]) - **ruby**: Ruby environment display ([#628], [239a574], [#676], [59078f0]) - **temp**: Linux sysfs backend ([#623]) - **terraform**: Terraform workspace support ([#669]) - **title**: Title command feature ([#609], [#665], [0c23a33], [a23af79]) - **vcsh**: Print the VCSH directory name in the custom prompt mark ([#363]) - **wifi**: Wireless signal strength data source ([#139]) ### Fixed - **bash**: Support for Bash 5.1+ `PROMPT_COMMAND` as array ([#684]) - **color**: `LP_COLORMAP` reverting to default value ([145f146]) - **docs**: Outdated link to Symbola font project page ([#662]) - **docs**: Small typos and license clarification ([#664], [#678], [66d1d2b]) - **git**: Git worktrees would never detect repo states ([1be52e0]) - **git**: Respect environment variable `GIT_DIR` ([1be52e0]) - **path**: Add `__lp_escape()` calls to `_lp_path_format()` ([36ab8fa], [a23af79]) - **powerline**: First character color issue in Zsh and Bash-3.2 ([70ce708]) - **powerline**: Array issues in Bash-3.2 ([77dc561]) - **ruby**: Zsh crash on rbenv output parse ([#667]) - **temp**: High temp values would stick ([#686]) - **term**: Some terminal emulators being detected as Telnet connections ([#483]) - **term**: Early exit on `TERM=unknown` ([#688]) - **zsh**: `local` bugs in Zsh-5.0 ([7db4ada]) ### Changed - **general**: Directly generate prompt mark instead of escape code ([#665], [1a22e1e]) - **general**: Refactor internal shell hooking implementation ([0ce7646]) - **bash**: Avoid setting any shell options ([#663], [a1d0a54]) - **env**: Lookup hostname instead of escape code ([#665], [0368523]) - **env**: Lookup username instead of escape code ([#665], [61df03a]) - **hg**: `_lp_hg_commits_off_remote()` returns `2` instead of `3` ([#696]) - **python**: Load virtualenv name from venv config first ([#708]) - **sudo**: Use the `--validate` flag instead of running `true` ([#702]) - **sudo**: Make `_lp_sudo_active()` a no-op if user has NOPASSWD ([#344]) - **time**: Call `date` to generate time instead of escape code ([#665], [dd1f8f8]) - **tests**: All included themes run through theme-preview tester ([3b75185]) - **tests**: test.sh accepts shells as arguments ([9a2c067]) - **vcs**: Unsupported VCS functions defined as empty functions ([#696]) - **zsh**: Avoid setting any shell options except for promptpercent ([58969b2]) ## [2.0.5] - 2022-04-24 ### Fixed - **temp**: High temp values would stick ([#686], [df5b88a]) ## [2.0.4] - 2022-02-07 ### Changed - **hg**: `_lp_hg_commits_off_remote()` returns `2` instead of `3` ([#696]) - **vcs**: Unsupported VCS functions defined as empty functions ([#696]) ## [2.0.3] - 2021-05-30 ### Fixed - **hg**: Stash count erroring with no function defined ([#671]) - **fossil**: Stash count erroring with no function defined ([#671]) - **fossil**: Uncommited files erroring with no function defined ([#671]) - **fossil**: Untracked files erroring with no function defined ([#671]) - **svn**: Uncommited files erroring with no function defined ([#671]) - **temp**: Temperature erroring if tool returns no data with `set -u` ([#670]) ## [2.0.2] - 2021-02-22 ### Fixed - **git**: Git worktrees not being detected ([#658]) ## [2.0.1] - 2021-02-07 ### Added - **docs**: Example for `lp_terminal_format()` ([#657], [954bace]) - **tests**: Tests for tools/theme-preview.sh and tools/external-tool-tester.sh ([e121179]) ### Fixed - **general**: Unset errors in liquidprompt and theme-preview on Bash-3.2 ([#656], [e121179]) - **general**: Unset errors in liquidprompt in Zsh when no terminal attached ([dc11eb4]) - **general**: Unset errors in liquidprompt on Windows ([461f0ee]) - **color**: Background of path always black, ignoring terminal background setting ([#657], [58693b0]) - **tools**: Make theme-preview.sh work in Zsh ([e121179]) ### Changed - **color**: `LP_COLOR_PATH` changed to `$NO_COL`, to follow terminal default foreground ([58693b0]) - **color**: `LP_COLOR_PATH_SEPARATOR` and 'LP_COLOR_PATH_SHORTENED` changed from light grey to grey, to be neutral on both light and dark backgrounds ([58693b0]) - **color**: `LP_COLOR_PATH_LAST_DIR` and 'LP_COLOR_PATH_VCS_ROOT` changed from bold white to `$BOLD`, to follow terminal default foreground ([58693b0]) ## [2.0.0] - 2021-02-05 ### BREAKING CHANGES Note: these breaking changes are the only reason that this version is so much faster. They are also on private functions and variables, which the end user was not supposed to use. If you were using them, see the [upgrade notes](https://liquidprompt.readthedocs.io/en/stable/upgrading/v2.0.html) for help. - **general**: `$_LP_SHELL_bash` and `$_LP_SHELL_zsh` contain `1` or `0` instead of `true` or `false` ([f681cdf]) - **general**: `_lp_color_map()` return changed from stdout to `$ret` ([e843ccf]) - **general**: `_lp_escape()` renamed to `__lp_escape()` and return changed from stdout to `$ret` ([f3404f9]) - **general**: `_lp_set_prompt()` renamed to `__lp_set_prompt()` ([decaece]) - **general**: `_lp_source_config()` renamed to `__lp_source_config()` ([decaece]) - **battery**: `_lp_battery()` return changed from stdout to `$lp_battery` ([3f57231]) - **battery**: `_lp_battery_color()` return changed from stdout to `$lp_battery_color` ([3f57231]) - **env**: `$lp_err` renamed to `$lp_error` ([63b9f73]) - **env**: `_lp_connection()` return changed from stdout to `$lp_connection` ([edc490f]) - **git**: `_lp_git_head_status()` return changed from stdout to `$lp_vcs_head_status` ([7c21470]) - **jobs**: `_lp_jobcount_color()` return changed from stdout to `$lp_jobcount_color` ([73f2057]) - **load**: `_lp_load_color()` return changed from stdout to `$lp_load_color` ([8a987f4]) - **path**: `_lp_get_home_tilde_collapsed()` renamed to `__lp_pwd_tilde()` and return changed from stdout to `$lp_pwd_tilde` ([28c13f2]) - **path**: `_lp_set_dirtrim()` removed ([ae769dc]) - **path**: `_lp_shorten_path()` replaced by `_lp_path_format()` ([decaece], [a35032f], [ae769dc]) - **runtime**: `_lp_runtime()` renamed to `_lp_runtime_color()` and return changed from stdout to `$lp_runtime_color` ([0f0fd37]) - **runtime**: `_lp_runtime_after()` renamed to `__lp_runtime_after()` ([decaece]) - **runtime**: `_lp_runtime_before()` renamed to `__lp_runtime_before()` ([decaece]) - **temperature**: `_lp_temp_acpi()` renamed to `__lp_temp_acpi()` and return changed from `$temperature` to `$lp_temperature` ([69c75a3]) - **temperature**: `_lp_temp_detect()` renamed to `__lp_temp_detect()` ([69c75a3]) - **temperature**: `_lp_temp_sensors()` renamed to `__lp_temp_sensors()` and return changed from `$temperature` to `$lp_temperature` ([69c75a3]) - **temperature**: `_lp_temperature()` changed to data function, replaced by `_lp_temperature_color()` and return changed from stdout to `$lp_temperature_color` ([69c75a3]) - **time**: `_lp_time()` split into `_lp_time()`, `_lp_time_color()`, `_lp_analog_time()`, and `_lp_analog_time_color()` ([8cb609d]) - **vcs**: `_lp__branch()` return changed from stdout to `$lp_vcs_branch` ([f3404f9]) - **vcs**: `_lp__branch_color()` functions removed, replaced by `_lp_vcs_details_color()` ([cafb8b2], [bf2b9c6], [1a9fcd0], [4fff496], [b523025]) - **vcs**: `_lp_smart_mark()` return changed from stdout to `$lp_smart_mark` ([9c6d073]) - **vcs**: `_lp_upwards_find()` removed, replaced by `_lp_find_vcs()` ([f434b6d]) ### Deprecated - **path**: `LP_PATH_DEFAULT` is replaced by `LP_PATH_METHOD` ([ae769dc]) - **title**: `_lp_title()` is replaced by `_lp_formatted_title()` ([46df995], [9604203], [#581]) - **utils**: `_lp_bool()` is replaced by manually storing return codes ([82ee823]). - **utils**: `_lp_sb()` is replaced by data functions indicating if they returned data or not ([82ee823]). - **utils**: `_lp_sl()` is replaced by data functions indicating if they returned data or not ([82ee823]). - **utils**: `_lp_sr()` is replaced by data functions indicating if they returned data or not ([82ee823]). - **vcs**: `$LP_DISABLED_VCS_PATH` variable is replaced by a `$LP_DISABLED_VCS_PATHS` array variable. A warning will be displayed at startup if your config still uses the old variable, but a compatibility shim is active. See the upgrade notes for help ([cad6286]) ### Added - **general**: Sphinx documentation ([0d420d2], [c7b5003], [b523025], [f9fd12e]) - **general**: Manual pages built from documentation ([#637], [13e128b]) - **general**: Command line flag `--no-activate` to skip auto shell activation when sourcing liquidprompt ([e122d21]) - **general**: `lp_activate()` function to reload config without needing to re-source liquidprompt ([e1f8bd5], [22dd760]) - **bzr**: `_lp_bzr_active()` data function ([b523025]) - **bzr**: `_lp_bzr_commit_id()` data function ([b523025]) - **bzr**: `_lp_bzr_stash_count()` data function ([b523025]) - **bzr**: `_lp_bzr_tag()` data function ([b523025]) - **bzr**: `_lp_bzr_uncommitted_files()` data function ([b523025]) - **bzr**: `_lp_bzr_uncommitted_lines()` data function ([b523025]) - **bzr**: `_lp_bzr_untracked_files()` data function ([b523025]) - **color**: `lp_terminal_format()` util function ([#486], [09cfced]) - **cpu**: Internal function `__lp_cpu_count()` to count CPU cores ([e5047c0]) - **dirstack**: Directory stack data source ([#625], [f35d9ac]) - **env**: `$LP_ENABLE_ERROR` config option ([#543], [63b9f73]) - **env**: `_lp_chroot()` data function ([c946155]) - **env**: `_lp_connected_display()` data function ([c946155]) - **env**: `_lp_error()` data function ([63b9f73]) - **env**: `_lp_hostname()` data function ([8de1a72], [6ea54e9]) - **env**: `_lp_hostname_color()` theme function ([c946155], [8de1a72], [b1a3145]) - **env**: `_lp_http_proxy()` data function ([78dee3c]) - **env**: `_lp_http_proxy_color()` theme function ([78dee3c]) - **env**: `_lp_multiplexer()` data function ([0200b99], [230c9d7]) - **env**: `_lp_python_env()` data function ([03434d3]) - **env**: `_lp_python_env_color()` theme function ([03434d3]) - **env**: `_lp_software_collections()` data function ([f4afc5d]) - **env**: `_lp_software_collections_color()` theme function ([f4afc5d]) - **env**: `_lp_sudo_active()` data function ([9ba5d28]) - **env**: `_lp_sudo_active_color()` theme function ([9ba5d28]) - **env**: `_lp_user()` data function ([9ba5d28]) - **env**: `_lp_username()` data function ([debb794]) - **env**: `_lp_username_color()` theme function ([afe3195]) - **fossil**: `_lp_fossil_active()` data function ([bf2b9c6]) - **fossil**: `_lp_fossil_commit_id()` data function ([bf2b9c6]) - **fossil**: `_lp_fossil_head_status()` data function ([bf2b9c6]) - **fossil**: `_lp_fossil_stash_count()` data function ([bf2b9c6]) - **fossil**: `_lp_fossil_uncommitted_files()` data function ([bf2b9c6]) - **fossil**: `_lp_fossil_uncommitted_lines()` data function ([bf2b9c6]) - **fossil**: `_lp_fossil_untracked_files()` data function ([bf2b9c6]) - **git**: `_lp_git_active()` data function ([70b4ef6]) - **git**: `_lp_git_commit_id()` data function ([70b4ef6]) - **git**: `_lp_git_commits_off_remote()` data function ([309b443]) - **git**: `_lp_git_staged_files()` data function ([#644], [9038ec8]) - **git**: `_lp_git_staged_lines()` data function ([#644], [9038ec8]) - **git**: `_lp_git_stash_count()` data function ([fe9919f], [bb19836]) - **git**: `_lp_git_tag()` data function ([70b4ef6], [#506]) - **git**: `_lp_git_uncommitted_files()` data function ([67dc0a9]) - **git**: `_lp_git_uncommitted_lines()` data function ([70b4ef6]) - **git**: `_lp_git_unstaged_files()` data function ([67dc0a9]) - **git**: `_lp_git_unstaged_lines()` data function ([70b4ef6]) - **git**: `_lp_git_untracked_files()` data function ([fe9919f]) - **git**: Caching for diff data functions that share targets (`files()` + `lines()`) ([8bf1772]) - **hg**: `_lp_hg_active()` data function ([1a9fcd0]) - **hg**: `_lp_hg_bookmark()` data function ([f4636e6]) - **hg**: `_lp_hg_commit_id()` data function ([1a9fcd0]) - **hg**: `_lp_hg_head_status()` data function ([1a9fcd0]) - **hg**: `_lp_hg_stash_count()` data function ([1a9fcd0]) - **hg**: `_lp_hg_tag()` data function ([1a9fcd0]) - **hg**: `_lp_hg_uncommitted_files()` data function ([1a9fcd0]) - **hg**: `_lp_hg_uncommitted_lines()` data function ([1a9fcd0]) - **hg**: `_lp_hg_untracked_files()` data function ([1a9fcd0]) - **hostname**: `__lp_hostname_hash()` internal function ([8f730c8]) - **jobs**: `$LP_ENABLE_DETACHED_SESSIONS` config option, separate from jobs ([f9038e0], [862dcfb], [#552]) - **jobs**: `_lp_detached_sessions()` data function ([73f2057], [862dcfb]) - **jobs**: `_lp_jobcount()` data function ([73f2057]) - **load**: `LP_LOAD_CAP` config option ([#650], [#530], [e058b61]) - **load**: `_lp_load()` data function ([8a987f4]) - **path**: `LP_COLOR_PATH_LAST_DIR` config option ([ae769dc]) - **path**: `LP_COLOR_PATH_SEPARATOR` config option ([ae769dc]) - **path**: `LP_COLOR_PATH_SHORTENED` config option ([ae769dc]) - **path**: `LP_COLOR_PATH_VCS_ROOT` config option ([ae769dc]) - **path**: `LP_PATH_CHARACTER_KEEP` config option ([ae769dc]) - **path**: `LP_PATH_METHOD` config option ([ae769dc]) - **path**: `LP_PATH_VCS_ROOT` config option ([ae769dc]) - **path**: `_lp_path_format()` data function ([#648], [#349], [#149], [ae769dc]) - **path**: `__lp_end_path_left_shortening()` internal function ([ae769dc]) - **path**: `__lp_get_unique_directory()` internal function ([ae769dc]) - **runtime**: `_lp_runtime_format()` data function ([0f0fd37]) - **svn**: `_lp_svn_active()` data function ([4fff496]) - **svn**: `_lp_svn_commit_id()` data function ([4fff496]) - **svn**: `_lp_svn_uncommitted_files()` data function ([4fff496]) - **svn**: `_lp_svn_uncommitted_lines()` data function ([4fff496]) - **svn**: `_lp_svn_untracked_files()` data function ([4fff496]) - **temperature**: `_lp_temperature()` as data function ([69c75a3]) - **terminal**: `_lp_terminal_device()` data function ([5076dbe]) - **tests**: Shunit2 testing suite ([#469], [46918f6], [44e3a6f], [1fe1559]) - **tests**: Tests to check if a shell supports all features that Liquid Prompt needs ([46918f6], [5a9293d], [1fe1559]) - **tests**: Tests for `_lp_as_text()` ([6cdb860]) - **tests**: Tests for `_lp_battery()`/`acpi` ([cef9cb1]) - **tests**: Tests for `_lp_battery()`/`pmset` ([c0e74b8], [9e205f5], [37db052]) - **tests**: Tests for `_lp_connection()`/`who`+`ps` ([23eb3f2], [37db052], [cef9cb1]) - **tests**: Tests for `__lp_cpu_count()`/`ncpu` ([37db052]) - **tests**: Tests for `_lp_cpu_load()`/`sysctl` ([37db052]) - **tests**: Tests for `_lp_detached_sessions()`/`screen`+`tmux` ([23eb3f2], [37db052], [cef9cb1]) - **tests**: Tests for `__lp_hostname_hash()` internal function ([8f730c8], [37db052]) - **tests**: Tests for `__lp_is_function()` util function ([9b40ca1]) - **tests**: Tests for `__lp_line_count()` util function ([a314677]) - **tests**: Tests for `__lp_pwd_tilde()` path function ([28c13f2]) - **tests**: Tests for `__lp_temp_sensors()`/`sensors` ([23eb3f2], [cef9cb1]) - **tests**: Tests for `_lp_terminal_device()` data function ([5076dbe], [37db052], [cef9cb1]) - **tests**: Github Actions build file ([#469], [05e0a50]) - **tests**: Github Actions documentation linting ([#649], [30f977b]) - **theme**: `__lp_theme_bash_complete()` to complete themes in Bash for `lp_theme()` ([884c069]) - **theme**: `__lp_theme_list()` to list themes loaded in function memory ([884c069]) - **theme**: `__lp_theme_zsh_complete()` to complete themes in Zsh for `lp_theme()` ([884c069]) - **theme**: `_lp_default_theme_activate()` theme function ([40c4331], [45f8091]) - **theme**: `_lp_default_theme_directory()` theme function ([40c4331], [45f8091]) - **theme**: `_lp_default_theme_prompt()` theme function ([40c4331], [45f8091], [acb5430]) - **theme**: `_lp_default_theme_prompt_data()` theme function ([acb5430]) - **theme**: `_lp_default_theme_prompt_template()` theme function ([acb5430]) - **theme**: `lp_theme()` to switch themes without resourcing any files ([45f8091], [884c069], [#592]) - **theme**: `alternate_vcs`, the default theme with modified VCS display ([#635], [#524], [2d659f0]) - **theme**: `powerline_full`, the default theme order in Powerline style ([bcefaf3]) - **theme**: `powerline`, a clone of the Powerline prompt ([af8382b], [8de1a72], [5ef795d], [#520]) - **time**: `_lp_analog_time()` data function ([8cb609d], [bc120d5]) - **time**: `_lp_analog_time_color()` theme function ([8cb609d], [bc120d5]) - **time**: `_lp_time()` data function ([bc120d5]) - **time**: `_lp_time_color()` theme function ([bc120d5]) - **title**: `lp_formatted_title()` sets persistent title stripping terminal formatting sequences ([46df995], [9604203]) - **title**: `_lp_raw_title()` sets persistent title without stripping terminal formatting sequences ([46df995]) - **title**: `lp_title()` sets a manual title that overrides the theme set title ([46df995], [#609]) - **tools**: `external-tool-tester.sh` script to generate test data ([b699dea], [9a00ead], [4b7fd88]) - **tools**: `theme-preview.sh` script to generate standard prompt previews ([0b94b74]) - **utils**: `__lp_is_function()` util function ([9b40ca1]) - **utils**: `__lp_line_count()` util function ([a314677]) - **vcs**: `_lp_find_vcs()` to quickly find nearest VCS repo ([f434b6d], [#524]) - **vcs**: `_lp_vcs_active()` data function ([cafb8b2], [#524]) - **vcs**: `_lp_vcs_bookmark()` data function ([f4636e6], [#524]) - **vcs**: `_lp_vcs_branch()` data function ([cafb8b2], [#524]) - **vcs**: `_lp_vcs_commit_id()` data function ([cafb8b2], [#524]) - **vcs**: `_lp_vcs_commits_off_remote()` data function ([cafb8b2], [#524]) - **vcs**: `_lp_vcs_details_color()` to format VCS details regardless of VCS type ([cafb8b2], [f4636e6], [5c56e65], [#524]) - **vcs**: `_lp_vcs_head_status()` data function ([cafb8b2], [#524]) - **vcs**: `_lp_vcs_stash_count()` data function ([cafb8b2], [#524]) - **vcs**: `_lp_vcs_tag()` data function ([cafb8b2], [#506], [#524]) - **vcs**: `_lp_vcs_uncommitted_files()` data function ([cafb8b2], [#524]) - **vcs**: `_lp_vcs_uncommitted_lines()` data function ([cafb8b2], [#524]) - **vcs**: `_lp_vcs_unstaged_files()` data function ([cafb8b2], [#524]) - **vcs**: `_lp_vcs_unstaged_lines()` data function ([cafb8b2], [#524]) - **vcs**: `_lp_vcs_untracked_files()` data function ([cafb8b2], [#524]) ### Fixed - **general**: Issues with custom `$IFS` ([e48856b], [4ebc26e]) - **general**: Liquid Prompt is now `set -u` compatible ([#354], [a8aa8c9], [cb9d71b]) - **acpi**: Temperature check printed each temp twice, slowing down check ([cf8bf97]) - **acpi**: Temperature check used extended sed syntax without declaring extended language ([eb30942]) - **battery**: Color display would break with custom `$LP_COLORMAP` array ([f3f20ec]) - **runtime**: DEBUG trap was not unset if `$LP_ENABLE_RUNTIME_BELL` was disabled ([cb9d71b]) - **sensors**: Redirect sensors error output to `/dev/null` ([#445], [4a52696]) - **time**: Add default value for `$LP_TIME_ANALOG` ([f8c1c47]) - **vcs**: VCS display for new VCS works without needing to change directories ([f434b6d]) ### Changed - **general**: Exit if shell is in interactive mode ([f2276fc]) - **general**: Load all functions at source time, not only ones enabled by the config ([e1f8bd5], [8cb609d]) - **general**: Remove subshells to improve speed ([#607], [9ba6e86], [e2ba86e]) - **general**: Remove uses of eval improve speed and security ([4fff496], [1a56d58]) - **color**: Better handling when `tput` is not found ([09cfced]) - **fossil**: Remove `sed` call in `_lp_fossil_branch()` ([6d94db6]) - **git**: `_lp_git_branch()` only returns a matching branch, not a fallback commit ID. Use `_lp_git_commit_id()` instead ([70b4ef6]) - **git**: `_lp_git_head_status()` add more matches from official git prompt, as well as details for partial rebases ([#527], [5c56e65]) - **jobs**: Use `__lp_line_count()` instead of `wc -l` for data function ([fb123f4]) - **load**: Display actual load average instead of normalized ([#650], [#530], [e058b61]) - **load**: `LP_LOAD_THRESHOLD` accepts floats of actual load average instead of integer centiload ([#650], [#530], [e058b61]) - **load**: Default color scale cap from 1.0 to 2.0 ([#650], [#530], [5069c22]) - **path**: `LP_COLOR_PATH` default changed from `$BOLD` to `lp_terminal_format 255 0 0 0 7` (no longer bold) ([ae769dc]) - **runtime**: Save bell escape sequence on startup to save time when sending bell to terminal with runtime bell ([3e615cd]) - **svn**: `_lp_svn_branch()` prefixes tag with "tag/", no longer returns current directory if no match found ([4fff496]) - **zsh**: Add check for Zsh >= 5.0, the versions now officially supported ([5bd80ce]) ### Removed - **tests**: `pmset-simulator` file, now integrated into `pmset` tests above ([c0e74b8]) - **tests**: `test.sh` file, unit tests integrated into `acpi` tests above ([f445eff]) - **vcsh**: `$LP_ENABLE_VCSH` config option, which did nothing ([f86a097]) ## [1.12.1] - 2020-10-25 ### Fixed - **fossil**: fossil 2.11+ matching any directory as a valid repo and printing 3 error messages ([#626]) ## [1.12.0] - 2020-07-17 ### Added - **color**: Add `$MAGENTA`, `$BOLD_PURPLE`, and `$BOLD_MAGENTA` ([3fadce9]) - **color**: Add warning when `tput` is not available ([#615]) - **path**: Allow to customize the symbol before the path that shows if the directory is writable: `$LP_MARK_PERM` ([#430]) - **runtime**: `$LP_RUNTIME_BELL` and `$LP_RUNTIME_BELL_THRESHOLD` to ring bell for slow commands ([#571]) ### Fixed - **general**: use `LC_ALL=C` everywhere parsable output is needed ([#548], [#549]) - **general**: set specific `IFS` everywhere it is used ([#613]) - **bash**: workaround broken .bashrc that export `$PROMPT_COMMAND`, we now unexport it on startup ([#450], [#463], [#474]) - **bash**: handle unset `$_LP_RUNTIME_LAST_SECONDS` when `set -u` is set ([#605]) - **bash**: use `$BASH_VERSINFO` for when there is a non-numeric suffix ([#522], [0234a58]) - **battery/OS X**: newer versions of OS X failing to parse ([#476], [fefbe01]) - **color**: `$LP_COLORMAP` would break if customized with a different sized array ([a70e80f]) - **color**: `_lp_color_map()` would return nothing if the passed in value was outside the scale range ([a70e80f], [#455], [#499], [#604]) - **cpu/SunOS**: failing math operation on load average ([#479], [#480]) - **fossil**: improve branch name detection, don't match tags ([#497]) - **git**: remove `-E` from grep check for portablility ([#508]) - **git**: modifications incorrectly showing as untracked files ([#509]) - **git**: changed line check failing if file named "HEAD" existed ([#517]) - **hg**: modifications incorrectly showing as untracked files ([#509]) - **hostname**: regression in `$LP_ENABLE_FQDN` implementation ([#472]) - **hostname/SunOS**: `$LP_COLOR_HOST_HASH` erroring ([#461], [#462], [9c1c8a3]) - **jobs**: misspelled variable local declaration ([#564]) - **root**: `$LP_MARK_DEFAULT` being ignored if root ([#501], [5ee3c53]) - **runtime**: when runtime enabled, `$_` would evaluate as `_lp_runtime_before` ([#451]) - **runtime**: when running a multipart command line (with pipes or `;`), runtime would never show. Now shows runtime of whole pipeline ([#614]) - **tmux**: tmux not showing as multiplexer if custom `$TERM` set ([#563]) ### Changed - **battery**: hide battery symbol when neither charging nor discharging ([#582]) - **color**: optimize `tput` color gen ([d62bf31]) - **git**: faster `git stash` check ([#503], [93df016]) ## [1.11] - 2016-06-25 - dolmen (Olivier Mengué) ### Fixed - **OS X**: sudo feature fixed ([#443]) - **OS X**: battery level restored ([#444]) ## [1.10] - 2016-05-30 - dolmen (Olivier Mengué) ### BREAKING CHANGES - **config**: Many `$LP_ENABLE_*` settings are now static (their effect applies when liquidprompt is loaded, and changing them at the prompt does nothing) to improve speed. - **screen**: `$LP_SCREEN_TITLE_OPEN` and `$LP_SCREEN_TITLE_CLOSE` are now removed to simplify the code ([#371]) - **zsh**: option 'nopromptsubst' is enabled for security reasons. This will unfortunately also affect evaluations of other prompt contexts such as RPS1. ([282359a], [#432]) ### Deprecated - **color**: `$LP_COLORMAP_x` variables are replaced by a single `$LP_COLORMAP` array variable. A warning will be displayed at startup if your config still uses the old variables, but a compatibility shim is active (will be removed in v2.1). ([6961f99]) ### Added - **git**: show the number of commits behind the remote ([#110], [#269], [48f1b02]) - **git**: show the rebasing/merging/cherry-picking state ([#409], [5cfd2c2]) - **hostname**: `$LP_ENABLE_FQDN` to show the fully qualified domain name of the host ([#254], [#277], [695d629]) - **hostname**: `LP_HOSTNAME_ALWAYS=-1` to always hide the hostname ([#406], [d9cb55d]) - **python**: add support for Conda (CONDA_DEFAULT_ENV) ([#425], [07be967]) - **sudo**: the color of the prompt mark is now dynamic and changes to `$LP_COLOR_MARK_SUDO` (default: bold red) as long as your sudo credentials are cached. Requires sudo 1.7.0+. This feature must be enabled with `LP_ENABLE_SUDO=1`. Use `sudo -K` to revoke your credentials early. This feature is disabled by default as there is no way to detect if the user has sudo rights without triggering a security alert that will annoy the sysadmin ([#335], [#345], [a8571bb]) - **tty**: `$LP_TTYN`: the basename of the terminal ([#357], [a97c0da], [f436867]) - **zsh**: run duration of the last command (`LP_ENABLE_RUNTIME`) is now supported ([#404], [#355]) ### Fixed - **general**: last statement of liquidprompt did not return 0 ([#360], [#361]) - **general**: better support for `set -u` ([a8114dd]) - **bash**: bash 3 compatibility, remove `function` syntax ([#313], [3079299]) - **battery/OS X**: handle battery edge cases. We now have a pmset simulator to better detect regressions ([#326], [fabc775]) - **compat**: broken path inside Midnight Commander ([#288]) - **config**: Use $XDG_CONFIG_HOME to locate the config ([#415], [#420], [#427]) - **cpu**: fix the scale that was incorrectly 0-200 (not an ideal fix) ([#391], [e9c35dd]) - **examples**: example.bashrc major fixes ([fdbd7ca]) - **fossil/OS X**: tag regexp to work on darwin ([#390]) - **git**: broken git work directory detection caused by typo ([64029ad]) - **grep**: clear GREP_OPTIONS and skip `grep` aliases ([#340], [#372]) - **path**: issues when $PWD contains spaces or special chars ([#369], [0e0cc12]) - **path**: escaping of special chars from $PWD (well, almost, see [#389]) - **path**: fix path growing with extra color codes each time directory is changed ([b53e53b]) - **temp**: try each backend (acpi/sensors) once to check it works at startup and disable the feature if none works. ([#410], [#319], [#381], [#387]) - **temp**: the 'sensors' command now uses the '-u' option ("raw output") that is easier to parse. This format is at least 7 years old. ([#379], [#380]) - **temp**: fix failing regex on bash ([1fc0308]) - **term**: fix detection of connection source for tmux ([#304], [#407]) - **title**: terminal sequences that were sent in the title text (the escaping algorithm is rewritten and now just correct) ([#416], [8605378]) - **zsh**: enable word splitting to fix `$LP_DISABLED_VCS_PATH` ([#423]) - **zsh**: fix `LP_PATH_KEEP=-1` not working ([#433]) - **zsh**: fix title escapes in zsh inside tmux/screen ([#370], [#371]) - **zsh**: rename `$status` variable in `_lp_battery()` ([#334], [0f80162]) - **zsh**: save and restore a prompt set with zsh' promptinit ([02bc49e]) - **zsh**: use zsh style symbol when `prompt_OFF()` ([eb6dafc]) ### Changed - **bash**: disable parameter expansion in PS1 ([c3d4970]) - **clock**: complete rewrite of analog clock for speed and correctness ([#365], [0548290]) - **dist**: Move dist/ to contrib/dist/ as files there are unmaintained ([cf01d02]) - **jobs**: optimize job count, espceially when disabled ([aa870b5]) - **path**: optimize implementation in case of `LP_PATH_KEEP=-1`: `$LP_PWD` becomes static ([7602c09], [#256]) - **path**: optimize implementation in case `LP_ENABLE_SHORTEN_PATH=0` on bash with `$PROMPT_DIRTRIM` ([8da3314]) - **runtime**: refactor runtime system ([03c73fe], [d485ed1]) - **zsh**: disable `$PROMPT_COMMAND` hacks and only use zsh built in hooks ([5fa9054]) - **zsh**: disable existing hooks at startup ([454112f]) - **zsh**: explicitly set the shell options we need (instead of relying on the shell default settings) ([282359a]) ## [1.9] - 2014-11-12 - dolmen (Olivier Mengué) ### Added - **temp/linux** guard against any future language change of the `acpi` command ([1c65748]) - **vcsh**: vcsh support ([#148], [#287], [e927985]) - **venv**: support for Software Collections ([#299], [#300], [cc1be7e]) ### Fixed - **general**: lots of variable quoting fixes - **general**: save user IFS and restore it to avoid echo ([#267], [782fad0]) - **bash**: save and set shell option promptvars ([62f0270]) - **bash**: workaround broken pattern substitution in bash 4.2 ([#289], [#294], [#302], [5813a71]) - **battery**: general fixes ([#265]) - **battery/OS X**: fix for computers without battery (like iMacs) ([#317]) - **bazar**: `_lp_bzr_branch_color()` for zsh ([#301], [#303]) - **clock**: fix analog clock hour for 12AM and 12PM ([#273]) - **color**: fix `tput` usage on BSDs ([4572bd0]) - **git**: count merge commits when checking differences with remote branch ([7e7734e]) - **git**: use --porcelain for `git status` ([#270], [89540d3]) - **hostname**: fix colorization for SSH ([9633ac8]) - **jobs**: fix when screen/tmux are not installed ([#304], [07d18d4]) - **mark**: losing space when `$LP_MARK_DEFAULT` not quoted ([#268], [c9bdefe]) - **screen**: counting screen sessions running with extra parameters ([#261], [5f8fcc4]) - **svn**: fix branch/tag name extraction ([#117], [#237], [c98f16d]) - **svn**: support paths that are not branches or trunk ([#293], [5425a5e]) - **temp/linux** fix for negative temperature values ([#308], [7402f79]) - **term**: fix `$TERM` check ([#291], [dc7be25]) - **zsh**: make `$LP_OLD_PROMPT_COMMAND` work ([81b080e]) ### Changed - **general**: apply some shellcheck.com suggestions - **color**: optimize colormap when `LP_PERCENT_ALWAYS=1` ([ee63435]) - **fossil**: cleanup and optimization ([#274]) - **git**: minor optimization ([#266]) - **git**: simplify working tree detection ([0e0cc87]) - **hg**: disabled `hg outgoing` because it is slow ([#217]) - **hg**: general cleanup for speed and fixes ([dd9a024]) ### Removed - **general**: `$LP_LIQUIDPROMPT`, use `$LP_OLD_PS1` for the same check ([ed4f383]) ## [1.8] - 2014-01-15 - dolmen (Olivier Mengué) ## [1.7] - 2013-11-30 - nojhan ## [1.6] - 2013-05-14 - nojhan ## [1.5] - 2013-04-20 - nojhan ## [1.4] - 2013-04-11 - nojhan ## [1.3] - 2013-03-11 - nojhan ## [1.2] - 2013-01-16 - nojhan ## [1.1] - 2012-08-16 - nojhan ## [1.0] - 2012-08-10 - nojhan [Unreleased]: https://github.com/liquidprompt/liquidprompt/compare/v2.2.1...master [2.2.1]: https://github.com/liquidprompt/liquidprompt/releases/tag/v2.2.1 [2.2.0]: https://github.com/liquidprompt/liquidprompt/releases/tag/v2.2.0 [2.1.2]: https://github.com/liquidprompt/liquidprompt/releases/tag/v2.1.2 [2.1.1]: https://github.com/liquidprompt/liquidprompt/releases/tag/v2.1.1 [2.1.0]: https://github.com/liquidprompt/liquidprompt/releases/tag/v2.1.0 [2.0.5]: https://github.com/liquidprompt/liquidprompt/releases/tag/v2.0.5 [2.0.4]: https://github.com/liquidprompt/liquidprompt/releases/tag/v2.0.4 [2.0.3]: https://github.com/liquidprompt/liquidprompt/releases/tag/v2.0.3 [2.0.2]: https://github.com/liquidprompt/liquidprompt/releases/tag/v2.0.2 [2.0.1]: https://github.com/liquidprompt/liquidprompt/releases/tag/v2.0.1 [2.0.0]: https://github.com/liquidprompt/liquidprompt/releases/tag/v2.0.0 [1.12.1]: https://github.com/liquidprompt/liquidprompt/releases/tag/v1.12.1 [1.12.0]: https://github.com/liquidprompt/liquidprompt/releases/tag/v1.12.0 [1.11]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.11 [1.10]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.10 [1.9]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.9 [1.8]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.8 [1.7]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.7 [1.6]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.6 [1.5]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.5 [1.4]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.4 [1.3]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.3 [1.2]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.2 [1.1]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.1 [1.0]: https://github.com/liquidprompt/liquidprompt/releases/tag/v_1.0 [#110]: https://github.com/liquidprompt/liquidprompt/issues/110 [#117]: https://github.com/liquidprompt/liquidprompt/issues/117 [#139]: https://github.com/liquidprompt/liquidprompt/issues/139 [#148]: https://github.com/liquidprompt/liquidprompt/issues/148 [#149]: https://github.com/liquidprompt/liquidprompt/issues/149 [#217]: https://github.com/liquidprompt/liquidprompt/issues/217 [#237]: https://github.com/liquidprompt/liquidprompt/issues/237 [#254]: https://github.com/liquidprompt/liquidprompt/pull/254 [#256]: https://github.com/liquidprompt/liquidprompt/issues/256 [#261]: https://github.com/liquidprompt/liquidprompt/pull/261 [#265]: https://github.com/liquidprompt/liquidprompt/pull/265 [#266]: https://github.com/liquidprompt/liquidprompt/pull/266 [#267]: https://github.com/liquidprompt/liquidprompt/pull/267 [#268]: https://github.com/liquidprompt/liquidprompt/pull/268 [#269]: https://github.com/liquidprompt/liquidprompt/pull/269 [#270]: https://github.com/liquidprompt/liquidprompt/pull/270 [#273]: https://github.com/liquidprompt/liquidprompt/pull/273 [#274]: https://github.com/liquidprompt/liquidprompt/pull/274 [#277]: https://github.com/liquidprompt/liquidprompt/pull/277 [#287]: https://github.com/liquidprompt/liquidprompt/pull/287 [#288]: https://github.com/liquidprompt/liquidprompt/issues/288 [#289]: https://github.com/liquidprompt/liquidprompt/issues/289 [#291]: https://github.com/liquidprompt/liquidprompt/issues/291 [#293]: https://github.com/liquidprompt/liquidprompt/pull/293 [#294]: https://github.com/liquidprompt/liquidprompt/pull/294 [#298]: https://github.com/liquidprompt/liquidprompt/issues/298 [#299]: https://github.com/liquidprompt/liquidprompt/pull/299 [#300]: https://github.com/liquidprompt/liquidprompt/pull/300 [#301]: https://github.com/liquidprompt/liquidprompt/issues/301 [#302]: https://github.com/liquidprompt/liquidprompt/pull/302 [#303]: https://github.com/liquidprompt/liquidprompt/pull/303 [#304]: https://github.com/liquidprompt/liquidprompt/issues/304 [#308]: https://github.com/liquidprompt/liquidprompt/pull/308 [#313]: https://github.com/liquidprompt/liquidprompt/pull/313 [#317]: https://github.com/liquidprompt/liquidprompt/pull/317 [#319]: https://github.com/liquidprompt/liquidprompt/pull/319 [#326]: https://github.com/liquidprompt/liquidprompt/issues/326 [#334]: https://github.com/liquidprompt/liquidprompt/pull/334 [#335]: https://github.com/liquidprompt/liquidprompt/issues/335 [#340]: https://github.com/liquidprompt/liquidprompt/pull/340 [#344]: https://github.com/liquidprompt/liquidprompt/issues/344 [#345]: https://github.com/liquidprompt/liquidprompt/issues/345 [#349]: https://github.com/liquidprompt/liquidprompt/issues/349 [#354]: https://github.com/liquidprompt/liquidprompt/issues/354 [#355]: https://github.com/liquidprompt/liquidprompt/pull/355 [#357]: https://github.com/liquidprompt/liquidprompt/pull/357 [#360]: https://github.com/liquidprompt/liquidprompt/issues/360 [#361]: https://github.com/liquidprompt/liquidprompt/pull/361 [#363]: https://github.com/liquidprompt/liquidprompt/issues/363 [#365]: https://github.com/liquidprompt/liquidprompt/pull/365 [#369]: https://github.com/liquidprompt/liquidprompt/pull/369 [#370]: https://github.com/liquidprompt/liquidprompt/issues/370 [#371]: https://github.com/liquidprompt/liquidprompt/pull/371 [#372]: https://github.com/liquidprompt/liquidprompt/pull/372 [#379]: https://github.com/liquidprompt/liquidprompt/issues/379 [#380]: https://github.com/liquidprompt/liquidprompt/pull/380 [#381]: https://github.com/liquidprompt/liquidprompt/pull/381 [#387]: https://github.com/liquidprompt/liquidprompt/pull/387 [#389]: https://github.com/liquidprompt/liquidprompt/issues/389 [#390]: https://github.com/liquidprompt/liquidprompt/pull/390 [#391]: https://github.com/liquidprompt/liquidprompt/pull/391 [#404]: https://github.com/liquidprompt/liquidprompt/pull/404 [#406]: https://github.com/liquidprompt/liquidprompt/pull/406 [#407]: https://github.com/liquidprompt/liquidprompt/issues/407 [#409]: https://github.com/liquidprompt/liquidprompt/pull/409 [#410]: https://github.com/liquidprompt/liquidprompt/issues/410 [#415]: https://github.com/liquidprompt/liquidprompt/issues/415 [#416]: https://github.com/liquidprompt/liquidprompt/pull/416 [#420]: https://github.com/liquidprompt/liquidprompt/issues/420 [#423]: https://github.com/liquidprompt/liquidprompt/pull/423 [#425]: https://github.com/liquidprompt/liquidprompt/pull/425 [#427]: https://github.com/liquidprompt/liquidprompt/pull/427 [#430]: https://github.com/liquidprompt/liquidprompt/pull/430 [#432]: https://github.com/liquidprompt/liquidprompt/pull/432 [#433]: https://github.com/liquidprompt/liquidprompt/pull/433 [#443]: https://github.com/liquidprompt/liquidprompt/pull/443 [#444]: https://github.com/liquidprompt/liquidprompt/pull/444 [#445]: https://github.com/liquidprompt/liquidprompt/issues/445 [#450]: https://github.com/liquidprompt/liquidprompt/issues/450 [#451]: https://github.com/liquidprompt/liquidprompt/issues/451 [#453]: https://github.com/liquidprompt/liquidprompt/pull/453 [#455]: https://github.com/liquidprompt/liquidprompt/pull/455 [#461]: https://github.com/liquidprompt/liquidprompt/issues/461 [#462]: https://github.com/liquidprompt/liquidprompt/pull/462 [#463]: https://github.com/liquidprompt/liquidprompt/issues/463 [#469]: https://github.com/liquidprompt/liquidprompt/issues/469 [#472]: https://github.com/liquidprompt/liquidprompt/issues/472 [#472]: https://github.com/liquidprompt/liquidprompt/issues/472 [#474]: https://github.com/liquidprompt/liquidprompt/issues/474 [#476]: https://github.com/liquidprompt/liquidprompt/pull/476 [#479]: https://github.com/liquidprompt/liquidprompt/issues/479 [#480]: https://github.com/liquidprompt/liquidprompt/pull/480 [#483]: https://github.com/liquidprompt/liquidprompt/issues/483 [#486]: https://github.com/liquidprompt/liquidprompt/issues/486 [#496]: https://github.com/liquidprompt/liquidprompt/pull/496 [#497]: https://github.com/liquidprompt/liquidprompt/pull/497 [#499]: https://github.com/liquidprompt/liquidprompt/issues/499 [#501]: https://github.com/liquidprompt/liquidprompt/issues/501 [#503]: https://github.com/liquidprompt/liquidprompt/pull/503 [#506]: https://github.com/liquidprompt/liquidprompt/issues/506 [#508]: https://github.com/liquidprompt/liquidprompt/pull/508 [#509]: https://github.com/liquidprompt/liquidprompt/pull/509 [#517]: https://github.com/liquidprompt/liquidprompt/issues/517 [#520]: https://github.com/liquidprompt/liquidprompt/issues/520 [#522]: https://github.com/liquidprompt/liquidprompt/issues/522 [#523]: https://github.com/liquidprompt/liquidprompt/pull/523 [#524]: https://github.com/liquidprompt/liquidprompt/issues/524 [#524]: https://github.com/liquidprompt/liquidprompt/issues/524 [#527]: https://github.com/liquidprompt/liquidprompt/issues/527 [#530]: https://github.com/liquidprompt/liquidprompt/issues/530 [#543]: https://github.com/liquidprompt/liquidprompt/issues/543 [#548]: https://github.com/liquidprompt/liquidprompt/issues/548 [#549]: https://github.com/liquidprompt/liquidprompt/pull/549 [#552]: https://github.com/liquidprompt/liquidprompt/issues/552 [#563]: https://github.com/liquidprompt/liquidprompt/issues/563 [#564]: https://github.com/liquidprompt/liquidprompt/issues/564 [#569]: https://github.com/liquidprompt/liquidprompt/issues/569 [#571]: https://github.com/liquidprompt/liquidprompt/pull/571 [#578]: https://github.com/liquidprompt/liquidprompt/pull/578 [#581]: https://github.com/liquidprompt/liquidprompt/issues/581 [#582]: https://github.com/liquidprompt/liquidprompt/pull/582 [#587]: https://github.com/liquidprompt/liquidprompt/pull/587 [#592]: https://github.com/liquidprompt/liquidprompt/issues/592 [#596]: https://github.com/liquidprompt/liquidprompt/issues/596 [#604]: https://github.com/liquidprompt/liquidprompt/pull/604 [#605]: https://github.com/liquidprompt/liquidprompt/pull/605 [#606]: https://github.com/liquidprompt/liquidprompt/issues/606 [#607]: https://github.com/liquidprompt/liquidprompt/issues/607 [#609]: https://github.com/liquidprompt/liquidprompt/issues/609 [#612]: https://github.com/liquidprompt/liquidprompt/issues/612 [#613]: https://github.com/liquidprompt/liquidprompt/issues/613 [#614]: https://github.com/liquidprompt/liquidprompt/issues/614 [#615]: https://github.com/liquidprompt/liquidprompt/issues/615 [#623]: https://github.com/liquidprompt/liquidprompt/pull/623 [#625]: https://github.com/liquidprompt/liquidprompt/pull/625 [#626]: https://github.com/liquidprompt/liquidprompt/issues/626 [#628]: https://github.com/liquidprompt/liquidprompt/pull/628 [#635]: https://github.com/liquidprompt/liquidprompt/pull/635 [#637]: https://github.com/liquidprompt/liquidprompt/pull/637 [#644]: https://github.com/liquidprompt/liquidprompt/issues/644 [#648]: https://github.com/liquidprompt/liquidprompt/pull/648 [#649]: https://github.com/liquidprompt/liquidprompt/pull/649 [#650]: https://github.com/liquidprompt/liquidprompt/pull/650 [#656]: https://github.com/liquidprompt/liquidprompt/issues/656 [#657]: https://github.com/liquidprompt/liquidprompt/issues/657 [#658]: https://github.com/liquidprompt/liquidprompt/issues/658 [#659]: https://github.com/liquidprompt/liquidprompt/issues/659 [#662]: https://github.com/liquidprompt/liquidprompt/pull/662 [#663]: https://github.com/liquidprompt/liquidprompt/pull/663 [#664]: https://github.com/liquidprompt/liquidprompt/pull/664 [#665]: https://github.com/liquidprompt/liquidprompt/pull/665 [#667]: https://github.com/liquidprompt/liquidprompt/issues/667 [#668]: https://github.com/liquidprompt/liquidprompt/pull/668 [#669]: https://github.com/liquidprompt/liquidprompt/pull/669 [#670]: https://github.com/liquidprompt/liquidprompt/issues/670 [#671]: https://github.com/liquidprompt/liquidprompt/pull/671 [#672]: https://github.com/liquidprompt/liquidprompt/pull/672 [#673]: https://github.com/liquidprompt/liquidprompt/pull/673 [#676]: https://github.com/liquidprompt/liquidprompt/issues/676 [#677]: https://github.com/liquidprompt/liquidprompt/pull/677 [#678]: https://github.com/liquidprompt/liquidprompt/pull/678 [#679]: https://github.com/liquidprompt/liquidprompt/pull/679 [#681]: https://github.com/liquidprompt/liquidprompt/pull/681 [#684]: https://github.com/liquidprompt/liquidprompt/issues/684 [#686]: https://github.com/liquidprompt/liquidprompt/issues/686 [#688]: https://github.com/liquidprompt/liquidprompt/pull/688 [#689]: https://github.com/liquidprompt/liquidprompt/pull/689 [#690]: https://github.com/liquidprompt/liquidprompt/issues/690 [#695]: https://github.com/liquidprompt/liquidprompt/issues/695 [#696]: https://github.com/liquidprompt/liquidprompt/issues/696 [#701]: https://github.com/liquidprompt/liquidprompt/issues/701 [#702]: https://github.com/liquidprompt/liquidprompt/pull/702 [#708]: https://github.com/liquidprompt/liquidprompt/issues/708 [#709]: https://github.com/liquidprompt/liquidprompt/issues/709 [#713]: https://github.com/liquidprompt/liquidprompt/issues/713 [#715]: https://github.com/liquidprompt/liquidprompt/issues/715 [#722]: https://github.com/liquidprompt/liquidprompt/issues/722 [#724]: https://github.com/liquidprompt/liquidprompt/issues/724 [#729]: https://github.com/liquidprompt/liquidprompt/issues/729 [#731]: https://github.com/liquidprompt/liquidprompt/pull/731 [#738]: https://github.com/liquidprompt/liquidprompt/pull/738 [#743]: https://github.com/liquidprompt/liquidprompt/pull/743 [#744]: https://github.com/liquidprompt/liquidprompt/pull/744 [#745]: https://github.com/liquidprompt/liquidprompt/pull/745 [#746]: https://github.com/liquidprompt/liquidprompt/pull/746 [#748]: https://github.com/liquidprompt/liquidprompt/pull/748 [#750]: https://github.com/liquidprompt/liquidprompt/pull/750 [#752]: https://github.com/liquidprompt/liquidprompt/pull/752 [#754]: https://github.com/liquidprompt/liquidprompt/pull/754 [#755]: https://github.com/liquidprompt/liquidprompt/issues/755 [#756]: https://github.com/liquidprompt/liquidprompt/pull/756 [#758]: https://github.com/liquidprompt/liquidprompt/issues/758 [#759]: https://github.com/liquidprompt/liquidprompt/pull/759 [#760]: https://github.com/liquidprompt/liquidprompt/issues/760 [#763]: https://github.com/liquidprompt/liquidprompt/issues/763 [#765]: https://github.com/liquidprompt/liquidprompt/issues/765 [#766]: https://github.com/liquidprompt/liquidprompt/pull/766 [#767]: https://github.com/liquidprompt/liquidprompt/pull/767 [#769]: https://github.com/liquidprompt/liquidprompt/pull/769 [#770]: https://github.com/liquidprompt/liquidprompt/pull/770 [#771]: https://github.com/liquidprompt/liquidprompt/pull/771 [#772]: https://github.com/liquidprompt/liquidprompt/pull/772 [#773]: https://github.com/liquidprompt/liquidprompt/pull/773 [#775]: https://github.com/liquidprompt/liquidprompt/pull/775 [#776]: https://github.com/liquidprompt/liquidprompt/issues/776 [#784]: https://github.com/liquidprompt/liquidprompt/pull/784 [#788]: https://github.com/liquidprompt/liquidprompt/pull/788 [#792]: https://github.com/liquidprompt/liquidprompt/pull/792 [#795]: https://github.com/liquidprompt/liquidprompt/pull/795 [#798]: https://github.com/liquidprompt/liquidprompt/pull/798 [#801]: https://github.com/liquidprompt/liquidprompt/pull/801 [#803]: https://github.com/liquidprompt/liquidprompt/pull/803 [#805]: https://github.com/liquidprompt/liquidprompt/pull/805 [#807]: https://github.com/liquidprompt/liquidprompt/issues/807 [#811]: https://github.com/liquidprompt/liquidprompt/pull/811 [#812]: https://github.com/liquidprompt/liquidprompt/pull/812 [#815]: https://github.com/liquidprompt/liquidprompt/pull/815 [#816]: https://github.com/liquidprompt/liquidprompt/pull/816 [#821]: https://github.com/liquidprompt/liquidprompt/issues/821 [#822]: https://github.com/liquidprompt/liquidprompt/issues/822 [#823]: https://github.com/liquidprompt/liquidprompt/pull/823 [#824]: https://github.com/liquidprompt/liquidprompt/pull/824 [#826]: https://github.com/liquidprompt/liquidprompt/pull/826 [#827]: https://github.com/liquidprompt/liquidprompt/pull/827 [#829]: https://github.com/liquidprompt/liquidprompt/pull/829 [#830]: https://github.com/liquidprompt/liquidprompt/pull/830 [#831]: https://github.com/liquidprompt/liquidprompt/issues/831 [#834]: https://github.com/liquidprompt/liquidprompt/issues/834 [#837]: https://github.com/liquidprompt/liquidprompt/issues/837 [#839]: https://github.com/liquidprompt/liquidprompt/pull/839 [#840]: https://github.com/liquidprompt/liquidprompt/pull/840 [#841]: https://github.com/liquidprompt/liquidprompt/pull/841 [0200b99]: https://github.com/liquidprompt/liquidprompt/commit/0200b99ebd8485ba8ba2c91da7703e87c40ec15d [0234a58]: https://github.com/liquidprompt/liquidprompt/commit/0234a581d023fb6c40e5339f6dcbd619a33b4553 [02bc49e]: https://github.com/liquidprompt/liquidprompt/commit/02bc49edf306749c47d7a389dc916cb68e992cc8 [03434d3]: https://github.com/liquidprompt/liquidprompt/commit/03434d388686792b6ed2aa0bf0e09851c90a7479 [0368523]: https://github.com/liquidprompt/liquidprompt/commit/036852371680a9e92d7e341be604088e8dc0519b [03c73fe]: https://github.com/liquidprompt/liquidprompt/commit/03c73fe05e5a3b48252a9f527e6e62666afbd726 [046d830]: https://github.com/liquidprompt/liquidprompt/commit/046d8300b2e65337fcecc0f76add818b5f461fcf [0548290]: https://github.com/liquidprompt/liquidprompt/commit/05482901fe86788032ab4089525c415384937a24 [05e0a50]: https://github.com/liquidprompt/liquidprompt/commit/05e0a502e8ae4e2a4711f5222f39c2589c6f582f [07be967]: https://github.com/liquidprompt/liquidprompt/commit/07be96765bbd742c5c2846ef6adbb0c253948216 [07d18d4]: https://github.com/liquidprompt/liquidprompt/commit/07d18d4ca3f4a77377591d62dc054e00f4616cc7 [09cfced]: https://github.com/liquidprompt/liquidprompt/commit/09cfced24745dd7aea086a292ab042f070ce4fbb [0b94b74]: https://github.com/liquidprompt/liquidprompt/commit/0b94b74d02046077a21d3fb83842c6a1fe74f6e5 [0c23a33]: https://github.com/liquidprompt/liquidprompt/commit/0c23a33eacc6ced0febc1a750c748010c3a87ad5 [0ce7646]: https://github.com/liquidprompt/liquidprompt/commit/0ce764653a5f000598b6ad11c974fcefb65832da [0d420d2]: https://github.com/liquidprompt/liquidprompt/commit/0d420d2f3ac84a83e150110f9e09fc21e919df7f [0e0cc12]: https://github.com/liquidprompt/liquidprompt/commit/0e0cc12fabc474b6c0cfed7abf80c9f61efb68fc [0e0cc87]: https://github.com/liquidprompt/liquidprompt/commit/0e0cc870c2dcf3fbfed1b2e187e918d74dd6d3db [0f0fd37]: https://github.com/liquidprompt/liquidprompt/commit/0f0fd3739a8dd9821b34b78859de13b47b2d856d [0f80162]: https://github.com/liquidprompt/liquidprompt/commit/0f80162f1f22277e497b69f243894a87fcaec643 [1139de1]: https://github.com/liquidprompt/liquidprompt/commit/1139de199a2bc80da577453b8614776863297736 [13e128b]: https://github.com/liquidprompt/liquidprompt/commit/13e128bb320034a0303f7354fad66a5674c6b4da [145f146]: https://github.com/liquidprompt/liquidprompt/commit/145f146e9cb4fb3c30a22e6c35529120f4650a28 [1a22e1e]: https://github.com/liquidprompt/liquidprompt/commit/1a22e1ec54ad46a311ed9bdd65ed2bd1459e606e [1a56d58]: https://github.com/liquidprompt/liquidprompt/commit/1a56d58d4e63f395545fed820278c5b4561dfa95 [1a9fcd0]: https://github.com/liquidprompt/liquidprompt/commit/1a9fcd0944711ccab20045e5a3f3bde9d7f0ec59 [1be52e0]: https://github.com/liquidprompt/liquidprompt/commit/1be52e0d048f68db9ab0ffd2f4d2a4212b685f93 [1c65748]: https://github.com/liquidprompt/liquidprompt/commit/1c657481fd3481720b54187f9aa464df0e62a3f2 [1fc0308]: https://github.com/liquidprompt/liquidprompt/commit/1fc030813069ebc0cfc0542d049a9e4998100490 [1fe1559]: https://github.com/liquidprompt/liquidprompt/commit/1fe1559ebb18ae2ff39e1c4703a06d35f0f6538f [2121394]: https://github.com/liquidprompt/liquidprompt/commit/2121394b07d7102857ebc06229dc80f61cedd97d [22dd760]: https://github.com/liquidprompt/liquidprompt/commit/22dd760926c3a7b8e4f4fa28902d43b06e68e6a8 [230c9d7]: https://github.com/liquidprompt/liquidprompt/commit/230c9d7d45c10b8f319b9d5c64b4fd59261c8008 [239a574]: https://github.com/liquidprompt/liquidprompt/commit/239a5740866962a40a614057065188810830207d [23eb3f2]: https://github.com/liquidprompt/liquidprompt/commit/23eb3f23b633a8e849f91867948c96976108df6b [282359a]: https://github.com/liquidprompt/liquidprompt/commit/282359a4b7c80a6032ec043eddb1bf378084e64e [28c13f2]: https://github.com/liquidprompt/liquidprompt/commit/28c13f27e652b84373a7c73389cbd0a5a10b88c3 [2d659f0]: https://github.com/liquidprompt/liquidprompt/commit/2d659f04628a804409e6262733f0f909c3c2675b [3079299]: https://github.com/liquidprompt/liquidprompt/commit/3079299f816ee2d893c2b7c2284e9e6034164d16 [309b443]: https://github.com/liquidprompt/liquidprompt/commit/309b443461a25f552754663d3d67a5ee0f97571f [30f977b]: https://github.com/liquidprompt/liquidprompt/commit/30f977b09f6ee36c38e1ec07a272b5b0e621729f [36ab8fa]: https://github.com/liquidprompt/liquidprompt/commit/36ab8fa8ff7c27284163aebbfcb9f82fc2f572ac [37db052]: https://github.com/liquidprompt/liquidprompt/commit/37db052c18d99fc36f4c4a4ede798155e519e2ca [3b75185]: https://github.com/liquidprompt/liquidprompt/commit/3b751856bfe701f38f842e8ae96d803a3990f13d [3d24865]: https://github.com/liquidprompt/liquidprompt/commit/3d2486578855e92c7cf8c5dc05da5fc6568a1f43 [3e615cd]: https://github.com/liquidprompt/liquidprompt/commit/3e615cded01b583870a7e6e9529f341280eb40a6 [3f57231]: https://github.com/liquidprompt/liquidprompt/commit/3f57231d73112ea1090e3a607539e515f21de794 [3fadce9]: https://github.com/liquidprompt/liquidprompt/commit/3fadce962396d6d3a1f7c2c8e23c1d9fdc22c098 [40c4331]: https://github.com/liquidprompt/liquidprompt/commit/40c4331f6eda1cb836e8ae62426cb7755fdec371 [436b1b5]: https://github.com/liquidprompt/liquidprompt/commit/436b1b58a44ed8bf4210b6b955d7da6cf707470f [44e3a6f]: https://github.com/liquidprompt/liquidprompt/commit/44e3a6fe8ea9aa61f7cedb32286eb321fc93c6ed [454112f]: https://github.com/liquidprompt/liquidprompt/commit/454112f385c49e0bdf408ffd6123f8eaa39d0b0c [4572bd0]: https://github.com/liquidprompt/liquidprompt/commit/4572bd02fa289b989de3d24e246be187dbd25f65 [45f8091]: https://github.com/liquidprompt/liquidprompt/commit/45f80913da7aaf869a80288c5433c4d71ffc28c4 [461f0ee]: https://github.com/liquidprompt/liquidprompt/commit/461f0ee05e1466a0f14afebcbc2aaeabe711e38a [46918f6]: https://github.com/liquidprompt/liquidprompt/commit/46918f62ef80f26bec379a5542d669654e5e3280 [46df995]: https://github.com/liquidprompt/liquidprompt/commit/46df99503698c838ad6bb9c030a271e9fda87b15 [48f1b02]: https://github.com/liquidprompt/liquidprompt/commit/48f1b022dd078ce45f786a28dbe75a8acea37031 [4a52696]: https://github.com/liquidprompt/liquidprompt/commit/4a526965cba546978423a4d51bfbb0a2d1000246 [4b7fd88]: https://github.com/liquidprompt/liquidprompt/commit/4b7fd88da0777d005d67d28d285be9255f1666c7 [4c8ac92]: https://github.com/liquidprompt/liquidprompt/commit/4c8ac9219f4191a458a9d472360f54d24060f2d6 [4ebc26e]: https://github.com/liquidprompt/liquidprompt/commit/4ebc26e92be20ddf5d068fb25d2cecfcf479c1ea [4fff496]: https://github.com/liquidprompt/liquidprompt/commit/4fff49644a86fe93f1373825f09e1b1fdfb20f54 [5069c22]: https://github.com/liquidprompt/liquidprompt/commit/5069c22dbece5ef8726b1393df5ae91550a2b3fe [5076dbe]: https://github.com/liquidprompt/liquidprompt/commit/5076dbe68788586f317c4d0590e1ea60e4dec07a [5425a5e]: https://github.com/liquidprompt/liquidprompt/commit/5425a5eb56433d4332441d37eae69d159ab456c1 [5813a71]: https://github.com/liquidprompt/liquidprompt/commit/5813a710fc0feb2970e1d1e6615f822777b111c7 [58693b0]: https://github.com/liquidprompt/liquidprompt/commit/58693b0664964e2a06b46fa8d5bdffd23ada417f [58969b2]: https://github.com/liquidprompt/liquidprompt/commit/58969b205f484dbf9ac5c151db81a2cc4c3762d6 [59078f0]: https://github.com/liquidprompt/liquidprompt/commit/59078f04622ea7b1c658e214435724d46307a443 [5a9293d]: https://github.com/liquidprompt/liquidprompt/commit/5a9293db78cad4739f2b105e1c438d21372c25f1 [5bd80ce]: https://github.com/liquidprompt/liquidprompt/commit/5bd80ce1da07adc501a46c375eae0ca741f3960e [5c56e65]: https://github.com/liquidprompt/liquidprompt/commit/5c56e65888d92f9f0239096c02ac86e568d53ad1 [5cfd2c2]: https://github.com/liquidprompt/liquidprompt/commit/5cfd2c2e7a892d1435cfd7b61cce697d5658db5c [5ee3c53]: https://github.com/liquidprompt/liquidprompt/commit/5ee3c53cbbc95b5288fe5baf5a3c5b21d2a7212d [5ef795d]: https://github.com/liquidprompt/liquidprompt/commit/5ef795d262839e99183db00a3dc7572e06f9b610 [5f8fcc4]: https://github.com/liquidprompt/liquidprompt/commit/5f8fcc46eade20015291833118055b7cd76a5c0a [5fa9054]: https://github.com/liquidprompt/liquidprompt/commit/5fa905481c9c7c4579cadc0065648b6617b9c775 [6085cd2]: https://github.com/liquidprompt/liquidprompt/commit/6085cd21b958c16853c3bb5ea7bfdb7daf11e2cf [61df03a]: https://github.com/liquidprompt/liquidprompt/commit/61df03a02367e29f80d470196b4cc193729ef37a [62f0270]: https://github.com/liquidprompt/liquidprompt/commit/62f0270888ec668ec50df2af826727ca8ba9d6c6 [63b9f73]: https://github.com/liquidprompt/liquidprompt/commit/63b9f73d72218d4e72c0d43bc6a60a82ea0e15e8 [64029ad]: https://github.com/liquidprompt/liquidprompt/commit/64029ad75d108a0619958c337fd64fe18560988e [66d1d2b]: https://github.com/liquidprompt/liquidprompt/commit/66d1d2ba3baade138d7470317aca527c138732fe [67a4221]: https://github.com/liquidprompt/liquidprompt/commit/67a4221a955a83c00c44bca5eb276b9f02074d15 [67dc0a9]: https://github.com/liquidprompt/liquidprompt/commit/67dc0a9ae9eebf0c2b85b4ee6fc2d6b5562b6412 [6868057]: https://github.com/liquidprompt/liquidprompt/commit/68680573bc9f198e663587916760d59c98614dd4 [695d629]: https://github.com/liquidprompt/liquidprompt/commit/695d629dd5cf7109e8892075d4cf7fadd8c17d94 [6961f99]: https://github.com/liquidprompt/liquidprompt/commit/6961f998b83f491995ce731bd232c5170cf4be5f [69c75a3]: https://github.com/liquidprompt/liquidprompt/commit/69c75a3e6c4998d682e480fb3df935e4eb224444 [6cdb860]: https://github.com/liquidprompt/liquidprompt/commit/6cdb86006e4d2ad6dee06e60e229842144305594 [6d94db6]: https://github.com/liquidprompt/liquidprompt/commit/6d94db6de7de879c14da842df535163a57dce638 [6ea54e9]: https://github.com/liquidprompt/liquidprompt/commit/6ea54e91f84be1c491314c3680e82b06d769218e [6f2ca7e]: https://github.com/liquidprompt/liquidprompt/commit/6f2ca7e62d0281356bd984957a9c2da41dd228d6 [708635b]: https://github.com/liquidprompt/liquidprompt/commit/708635b938c643948e83e4f9855410a1a816b082 [70b4ef6]: https://github.com/liquidprompt/liquidprompt/commit/70b4ef65c034c5050173dbe70178b459e5acddc2 [70ce708]: https://github.com/liquidprompt/liquidprompt/commit/70ce708b8142d71647c14817cb40801c5dfdb756 [73f2057]: https://github.com/liquidprompt/liquidprompt/commit/73f205748fe6f09abcfe01ec150a456518aecc18 [7402f79]: https://github.com/liquidprompt/liquidprompt/commit/7402f79a7518e74e16d36c74e8b5943d11f390d7 [7602c09]: https://github.com/liquidprompt/liquidprompt/commit/7602c09fd7754f371db98bfad15bc075ef1ec93a [77dc561]: https://github.com/liquidprompt/liquidprompt/commit/77dc561c707a88ab9158f3f00231137f8f34c624 [782fad0]: https://github.com/liquidprompt/liquidprompt/commit/782fad08fd37cbf2144ea203430f37608b156ae8 [787e03e]: https://github.com/liquidprompt/liquidprompt/commit/787e03e9ee5dd09e146c58880e922d9e30c2585f [78dee3c]: https://github.com/liquidprompt/liquidprompt/commit/78dee3c70ab73eee04a5e869172e5f07ac916774 [7c21470]: https://github.com/liquidprompt/liquidprompt/commit/7c214708d72a4fa7d298678167450693a1ffbc00 [7db4ada]: https://github.com/liquidprompt/liquidprompt/commit/7db4ada711c5e9859ea79a11a1d03ca7d7311547 [7e7734e]: https://github.com/liquidprompt/liquidprompt/commit/7e7734e6247a1b32d636b5e39fe99d8d23dde669 [81b080e]: https://github.com/liquidprompt/liquidprompt/commit/81b080e2a6e6c24a3bab9348c187fb308c25ffe8 [82ee823]: https://github.com/liquidprompt/liquidprompt/commit/82ee823e9cd2fb8581b653b38c4ea501b795a607 [8605378]: https://github.com/liquidprompt/liquidprompt/commit/86053782d08b0d41ca69f4f45dde9ce619db1008 [862dcfb]: https://github.com/liquidprompt/liquidprompt/commit/862dcfbe6c82bf4e4125cf584a010161a533b917 [884c069]: https://github.com/liquidprompt/liquidprompt/commit/884c0697b71b0f87e2ea2a88159e08d33d3c6088 [89540d3]: https://github.com/liquidprompt/liquidprompt/commit/89540d312543b897b3c116370deabdfe9db15dcb [8a987f4]: https://github.com/liquidprompt/liquidprompt/commit/8a987f436ffc6144eab1dadaacad9c460b9bfa1f [8bf1772]: https://github.com/liquidprompt/liquidprompt/commit/8bf1772d771904bd2095a974b35795c9db2c96cc [8cb609d]: https://github.com/liquidprompt/liquidprompt/commit/8cb609d49cc1ba92f09adc87e3fbed243d04626e [8da3314]: https://github.com/liquidprompt/liquidprompt/commit/8da33144c89075dfd2309feaa718ccf3fe693ff6 [8de1a72]: https://github.com/liquidprompt/liquidprompt/commit/8de1a729f7190612d573218625dc1aaf4c2f78bf [8f730c8]: https://github.com/liquidprompt/liquidprompt/commit/8f730c8eb7b2488093db47045db1bcd239b02b9a [9038ec8]: https://github.com/liquidprompt/liquidprompt/commit/9038ec8884f11f7cf47fbfee1c86b9dbf6440307 [93df016]: https://github.com/liquidprompt/liquidprompt/commit/93df0169499c4ca8563add267e95dcd343d95f12 [954bace]: https://github.com/liquidprompt/liquidprompt/commit/954bace48637528795743785c4cc8cb42f204a7e [9604203]: https://github.com/liquidprompt/liquidprompt/commit/9604203fb9f90b44a8c806f32e7746588b70a83b [9633ac8]: https://github.com/liquidprompt/liquidprompt/commit/9633ac83cad5f5702c1e853940c0ab2e166961bf [9992fce]: https://github.com/liquidprompt/liquidprompt/commit/9992fce5faf8af2aeec9e6ca753ab9a3404b0785 [9a00ead]: https://github.com/liquidprompt/liquidprompt/commit/9a00eada113cb1d5e33aa177f5b9180c25d6a843 [9a2c067]: https://github.com/liquidprompt/liquidprompt/commit/9a2c06709544ce7609b432aa03d81f7cf4750283 [9b40ca1]: https://github.com/liquidprompt/liquidprompt/commit/9b40ca139a43e51b4d0fbdc780d0661bfffbf6ae [9ba5d28]: https://github.com/liquidprompt/liquidprompt/commit/9ba5d2824571d41c1aa7a3573a3cf17ed729f2bb [9ba6e86]: https://github.com/liquidprompt/liquidprompt/commit/9ba6e86f8200c08543502185447185a5a4089685 [9c1c8a3]: https://github.com/liquidprompt/liquidprompt/commit/9c1c8a378846c23e0a39be2aadd11531c2ecf196 [9c6d073]: https://github.com/liquidprompt/liquidprompt/commit/9c6d073e3cc7a49cfce209ce4307881d70340161 [9e205f5]: https://github.com/liquidprompt/liquidprompt/commit/9e205f51db459443e5c2ead0efa76f6a33c47c24 [a1d0a54]: https://github.com/liquidprompt/liquidprompt/commit/a1d0a54027dba5efc5acccc630b2be432e705f67 [a23af79]: https://github.com/liquidprompt/liquidprompt/commit/a23af79232fc3b716dc54bc3927b3e05bd777189 [a314677]: https://github.com/liquidprompt/liquidprompt/commit/a314677b8031804130c69de94d4604e9c319575a [a35032f]: https://github.com/liquidprompt/liquidprompt/commit/a35032fe03ab3d84093141c403a7c6615f7c38d9 [a70e80f]: https://github.com/liquidprompt/liquidprompt/commit/a70e80f0f501031ef97ea8baf88ca6d7ef56ad8a [a8114dd]: https://github.com/liquidprompt/liquidprompt/commit/a8114dd9550e2e7fd33b93eb7885de08b3e64933 [a8571bb]: https://github.com/liquidprompt/liquidprompt/commit/a8571bb2920d9f11006754e634304242d929db57 [a8aa8c9]: https://github.com/liquidprompt/liquidprompt/commit/a8aa8c94ca6b3d6486195a2d03cf7868d995f3a2 [a97c0da]: https://github.com/liquidprompt/liquidprompt/commit/a97c0da0e6a6f037a6038c427a51a9ee840b45f2 [aa870b5]: https://github.com/liquidprompt/liquidprompt/commit/aa870b54d27cd6deda50a24f2030511d8a23c45e [acb5430]: https://github.com/liquidprompt/liquidprompt/commit/acb54302d9711c6b7b8b68bc8a692ef232fb09d4 [ae769dc]: https://github.com/liquidprompt/liquidprompt/commit/ae769dc9a71df27c24025a6bd29e840f4d97ce08 [af8382b]: https://github.com/liquidprompt/liquidprompt/commit/af8382b56833e8ce08834c61c70c6eda805b413f [afe3195]: https://github.com/liquidprompt/liquidprompt/commit/afe319526a14e6ab73fba175c06e7a45188a37c4 [b1a3145]: https://github.com/liquidprompt/liquidprompt/commit/b1a3145ae5432e39ff85d144207eb490f3af341a [b523025]: https://github.com/liquidprompt/liquidprompt/commit/b523025221c2c9084a933cf545fa9cb999916323 [b53e53b]: https://github.com/liquidprompt/liquidprompt/commit/b53e53b6a5a5b783896b8fd75d341dbb1d7d5e5c [b699dea]: https://github.com/liquidprompt/liquidprompt/commit/b699dea7aec3b081292becf52fa1899fe82c3c8b [bb19836]: https://github.com/liquidprompt/liquidprompt/commit/bb198362d78310905ef213bbdedce1ace5002b99 [bc120d5]: https://github.com/liquidprompt/liquidprompt/commit/bc120d50c265ece6158317ddea0488919e0747dd [bcefaf3]: https://github.com/liquidprompt/liquidprompt/commit/bcefaf32e9e301e13706fc5c39de814c1a2630aa [bf2b9c6]: https://github.com/liquidprompt/liquidprompt/commit/bf2b9c60a788c32f38078f580b79ba80540d3bdf [c0e74b8]: https://github.com/liquidprompt/liquidprompt/commit/c0e74b8953db777e1ae84fa5faa3620af5247511 [c3d4970]: https://github.com/liquidprompt/liquidprompt/commit/c3d49708e598a79eca50caa0f96fca6230ce204e [c74a9e4]: https://github.com/liquidprompt/liquidprompt/commit/c74a9e4bdea7a4cf19ac368316ff724c42b3205e [c7b5003]: https://github.com/liquidprompt/liquidprompt/commit/c7b5003616d769ac1a4edc06d28ba6b84bfe0418 [c946155]: https://github.com/liquidprompt/liquidprompt/commit/c9461552d9618548d4a858b0153671cf0fdbdac3 [c98f16d]: https://github.com/liquidprompt/liquidprompt/commit/c98f16d52f9cc22723679124c3d64b06cbcb6e6e [c9bdefe]: https://github.com/liquidprompt/liquidprompt/commit/c9bdefe020c30bb053c0815a1633e5e3be25e4ef [cad6286]: https://github.com/liquidprompt/liquidprompt/commit/cad6286b6f923376a05ebe8c13a4302e91a9cfe3 [cafb8b2]: https://github.com/liquidprompt/liquidprompt/commit/cafb8b2e5388fd9336c316248908881a8d66a4a5 [cb9d71b]: https://github.com/liquidprompt/liquidprompt/commit/cb9d71b952954006ebedd66a7ea63de7562f9676 [cc1be7e]: https://github.com/liquidprompt/liquidprompt/commit/cc1be7e29d1b7fa6ef25e960e02da6612ff8bde9 [cef9cb1]: https://github.com/liquidprompt/liquidprompt/commit/cef9cb1581a419f7c7248954069fd0d4e5966284 [cf01d02]: https://github.com/liquidprompt/liquidprompt/commit/cf01d02445c38ee9504bad00f079af080a7bdfe2 [cf8bf97]: https://github.com/liquidprompt/liquidprompt/commit/cf8bf97b01a83a939eadc31b9da806172c91c444 [d41b5c8]: https://github.com/liquidprompt/liquidprompt/commit/d41b5c8361381fcc785494f5552a2b5319c3c9d1 [d485ed1]: https://github.com/liquidprompt/liquidprompt/commit/d485ed191fb6b896290a32848c4fefd0342e2046 [d62bf31]: https://github.com/liquidprompt/liquidprompt/commit/d62bf310d0d5a30fac6d047f03d832b81070c884 [d66f720]: https://github.com/liquidprompt/liquidprompt/commit/d66f7209591a733e55b10d715d58d259327b67f5 [d8254c6]: https://github.com/liquidprompt/liquidprompt/commit/d8254c646296ce864e8cd60eff5e860fa5356f5b [d9cb55d]: https://github.com/liquidprompt/liquidprompt/commit/d9cb55da834720ac3cd4893bb4a35808ab67d376 [dc11eb4]: https://github.com/liquidprompt/liquidprompt/commit/dc11eb48ecb133930355f396578e5c9b06b49afc [dc7be25]: https://github.com/liquidprompt/liquidprompt/commit/dc7be2540d677600a484dcd0c2d05dc0945382e5 [dd1f8f8]: https://github.com/liquidprompt/liquidprompt/commit/dd1f8f873e6d71b9dc9d9a820cd7fe1a3f313c67 [dd9a024]: https://github.com/liquidprompt/liquidprompt/commit/dd9a024b485d9c017aa935809bd20e7436dff46c [debb794]: https://github.com/liquidprompt/liquidprompt/commit/debb794bf2f99ab53d539e5080f0b28579333cb8 [decaece]: https://github.com/liquidprompt/liquidprompt/commit/decaece03b9bfe826d7f33a3fb56dfb33916884a [df5b88a]: https://github.com/liquidprompt/liquidprompt/commit/df5b88a93d51ae6da220fb23c8737b53b07a8e7c [e058b61]: https://github.com/liquidprompt/liquidprompt/commit/e058b619ce80918d3cdf924e07220a7028a8bb1b [e121179]: https://github.com/liquidprompt/liquidprompt/commit/e121179d1bb943ec3673e451deac2a0577adbb75 [e122d21]: https://github.com/liquidprompt/liquidprompt/commit/e122d21ba14f2bdfe5fa88b70083249456c67b5b [e1f8bd5]: https://github.com/liquidprompt/liquidprompt/commit/e1f8bd585d5dfc41d21d4bf88343f3a30fb3d071 [e2ba86e]: https://github.com/liquidprompt/liquidprompt/commit/e2ba86e0e5fc8bf5191cf8d8ac6aa1cd2b81a596 [e48856b]: https://github.com/liquidprompt/liquidprompt/commit/e48856b59e51731b7accab27e679154bcff53ed4 [e5047c0]: https://github.com/liquidprompt/liquidprompt/commit/e5047c0bbc1e95f811ae56265306851d3d5769e4 [e843ccf]: https://github.com/liquidprompt/liquidprompt/commit/e843ccfd7c719f84baf7e628697f78ff59703e5d [e927985]: https://github.com/liquidprompt/liquidprompt/commit/e9279856c4af191d501e8e46898dde3b4447e6dd [e9c35dd]: https://github.com/liquidprompt/liquidprompt/commit/e9c35ddeb473da1ac24eb27331b8974f3ba05237 [eb30942]: https://github.com/liquidprompt/liquidprompt/commit/eb309422009c8f8e2a105381317b71ace5d42e13 [eb6dafc]: https://github.com/liquidprompt/liquidprompt/commit/eb6dafc314a3dc1fc5ca560d79c408db81af0288 [ed4f383]: https://github.com/liquidprompt/liquidprompt/commit/ed4f3832fe2f7380ec1b7949777fffe2a7f63f34 [edc490f]: https://github.com/liquidprompt/liquidprompt/commit/edc490f3a3e92e9b0a94e9021a0589d64c6a7881 [ee63435]: https://github.com/liquidprompt/liquidprompt/commit/ee6343567d2178cd57daa89498868be6ea2ef156 [f2276fc]: https://github.com/liquidprompt/liquidprompt/commit/f2276fc29530fcba63bd5602364e20187a8d44c6 [f3404f9]: https://github.com/liquidprompt/liquidprompt/commit/f3404f99d3c08a5811eec0a8c326abe6763c6c14 [f35d9ac]: https://github.com/liquidprompt/liquidprompt/commit/f35d9acfddacc1f7f74174b45cf4c4aa9c84beca [f3f20ec]: https://github.com/liquidprompt/liquidprompt/commit/f3f20ecbe0309842ab43d36c006e75928cd5dae4 [f434b6d]: https://github.com/liquidprompt/liquidprompt/commit/f434b6dc663d704e9d616b8864908371862b9e23 [f436867]: https://github.com/liquidprompt/liquidprompt/commit/f4368670bf258257fece5611a9aad17e88f10b5a [f445eff]: https://github.com/liquidprompt/liquidprompt/commit/f445eff684558e8bf200df2f3f897c09374b7d6c [f4636e6]: https://github.com/liquidprompt/liquidprompt/commit/f4636e66455a80586f20bb1ea9624a15299cea58 [f47a7cd]: https://github.com/liquidprompt/liquidprompt/commit/f47a7cd482450a0898f8ad3a22dbe0f0ce84fd6d [f4afc5d]: https://github.com/liquidprompt/liquidprompt/commit/f4afc5d0a8f776c96308001fcdae4a5aa1dac2bd [f681cdf]: https://github.com/liquidprompt/liquidprompt/commit/f681cdf9d8dd1d847aaf5f0b69222606a181c648 [f86a097]: https://github.com/liquidprompt/liquidprompt/commit/f86a097d5eb9cab2a2fbca7629e9c2c389f1e12e [f8c1c47]: https://github.com/liquidprompt/liquidprompt/commit/f8c1c4770aab0a1c15f3e17b0b47a421f024f1b7 [f9038e0]: https://github.com/liquidprompt/liquidprompt/commit/f9038e0331df1dfedbeb442c84ec62d63a90c37d [f9fd12e]: https://github.com/liquidprompt/liquidprompt/commit/f9fd12eed963ce2d64762e09b04adb06e00692a4 [fabc775]: https://github.com/liquidprompt/liquidprompt/commit/fabc775cb8bfe1be5a39cf577d2d2187398881b0 [fb123f4]: https://github.com/liquidprompt/liquidprompt/commit/fb123f4c5eee08c265eb91cc5a4d3de7e9c6c75d [fdbd7ca]: https://github.com/liquidprompt/liquidprompt/commit/fdbd7ca545a2847fb3e862a6088740aa2a06c799 [fe9919f]: https://github.com/liquidprompt/liquidprompt/commit/fe9919f5e7dc01ba59cc85a128fea94e5b2163c4 [fefbe01]: https://github.com/liquidprompt/liquidprompt/commit/fefbe01d9830a9033bdb008c454c0d0590548638 [ff44057]: https://github.com/liquidprompt/liquidprompt/commit/ff44057280fa0ce8a559999fc7063c832a31abac liquidprompt-2.2.1/CONTRIBUTING.md000066400000000000000000000215271464055045500165150ustar00rootroot00000000000000# Contributing to Liquid Prompt ### I don't want to read this whole thing, I just have a question!!! Please don't file an issue to ask a question. You'll get faster results by using the resources below. ## Did you find a bug? * **Check the [FAQs](https://github.com/liquidprompt/liquidprompt/wiki/FAQ)**. We try to keep it updated with the latest hot questions. * **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/liquidprompt/liquidprompt/issues). If there is an open issue that matches your problem, you can add a comment to the issue if you have something new or helpful to add. If your comment would be ":+1:", please add that as a reaction on the issue instead. * **Ensure you can reproduce the issue on the latest version**. Not only the latest released version, but the latest commit on the `master` branch. While it might not be the version you are using right now, if the bug doesn't exist on the `master` branch, we have already fixed it. * If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/liquidprompt/liquidprompt/issues/new/choose). Be sure to include a **title and clear description**, as much relevant information as possible, such as shell version, and a **code sample** or a **test case** demonstrating the expected behavior that is not occurring. If we can't reproduce the bug, we can't fix it, so make sure to include as much information as possible. ## Enhancement / Feature request Same as with bugs, **check the [FAQs](https://github.com/liquidprompt/liquidprompt/wiki/FAQ) and open [Issues](https://github.com/liquidprompt/liquidprompt/issues)** so you don't duplicate a feature request. [Open a new Issue](https://github.com/liquidprompt/liquidprompt/issues/new/choose), and add as much detail as you can. Make sure to at least explain: 1. **Why** you want this feature. How will it be useful to users? 2. **What** tools it will interact with (ex: `git`). Provide links. 3. **An example** of what it would look like in the prompt. The more details you can give, the more likely someone will be inspired to work on it. ## Contributing a patch ### Your first contribution / what can I help with? If you just want to help, but don't have a specific issue in mind, you can look at the [help wanted](https://github.com/liquidprompt/liquidprompt/labels/help%20wanted) tagged issues. ### Code style and standards [Google's shell style guide](https://google.github.io/styleguide/shellguide.html) is our style guide, with the following modifications: * 4 spaces indentation * Don't always prefer `${var}` over `$var` (see standards) * Use `typeset`, not `local` or `declare` (see standards) See our [shell standards wiki page](https://github.com/liquidprompt/liquidprompt/wiki/Shell-standards) for our standards on shell language. ### How do I make a pull request?? $ git clone -o upstream git://github.com/liquidprompt/liquidprompt.git $ cd liquidprompt # Run Liquid Prompt and check that your issue is still on that branch $ source liquidprompt # Prepare a fix (include the issue number in the branch name if an issue # already exists) $ git checkout -b bugfix/my-fix # Prepare a new feature $ git checkout -b feature/my-feature # Hack, commit, hack, amend commit... # Fork the project on GitHub (if you haven't yet) # Add the remote target for pushes $ git remote add github git@github.com:$GITHUB_USER/liquidprompt.git # Check that your local repo is up to date $ git fetch upstream # Rebase your work on the latest state of `master` $ git rebase upstream/master # Push your commits $ git push github fix/my-fix $ git push github feature/my-feature # Create the pull request on GitHub. Check that Github chose the `master` # branch as the starting point for your branch. ### Technical checklist for adding a new prompt section Here is a list of technical details that will be checked when making any code change: - code follows our [shell standards](https://github.com/liquidprompt/liquidprompt/wiki/Shell-standards): - [ ] correct use of `IFS` - [ ] careful quoting - [ ] cautious array access - [ ] portable array indexing with `_LP_FIRST_INDEX` - [ ] functions/variable naming conventions - [ ] functions have local variables - [ ] data functions have optimization guards (early exits) - [ ] subshells are avoided as much as possible - tests and checks have been added, ran, and their warnings fixed: - [ ] unit tests have been updated (see `tests/test_*.sh` files) - [ ] ran `tests.sh` - [ ] ran `shellcheck.sh` (requires [shellcheck](https://github.com/koalaman/shellcheck#user-content-installing)). - documentation have been updated accordingly: - [ ] functions and attributes are documented in alphabetical order - [ ] tag `.. versionadded:: X.Y` or `.. versionchanged:: Y.Z` - [ ] functions signatures have arguments, returned code, and set value(s) - [ ] attributes have types and defaults - [ ] ran `docs/docs-lint.sh` (requires Python 3 and `requirements.txt` installed (`cd docs/; python3 -m venv venv; . venv/bin/activate; pip install -r requirements.txt`)) ### How do I make a good pull request? 1. Check that your Git authorship settings are correct: $ git config -l | grep ^user\. 2. All the commits in the pull request must be on the same topic. If instead you propose fixes on different topics, use separate branches in your repo and make a pull request for each. 3. Good commit message: - first line must be 50 chars max and is a summary of the commit. The first character should be capitalized, no ending period. Use the imperative mood ("fix thing", not "fixes thing" or "fixing thing" or "fixed thing") - second line must be empty - following lines (72 chars max) should describe the what, why, and how of your change. If your change is anything more than one line, this is probably not optional. Think about coming back to this patch in 6 months: if you won't remember why you made this change, you need to write it down. Use references to GitHub issues number (ex: `#432`) if applicable A good commit message isn't optional. If your commit message is bad (ex: "fix temp for thing"), your PR will be rejected. [See this post](https://chris.beams.io/posts/git-commit/) for even more details on the topic. 4. Use a good title for your pull request. 5. Put details, web links, Github issue numbers, in the pull request body. Use Markdown fully to format the content (see [Markdown syntax](https://guides.github.com/features/mastering-markdown/)). For example use triple backquotes for code blocks. Note that if information is important enough to put in the PR description, it is also important enough to put in the commit message. If your branch ever ends up "out of sync" or "conflicts" with the `master` branch of the main repo, never, ever, *merge* the `master` branch into your own branch. Instead, always *rebase* your own work on top of the `master` branch. ### Can I make a pull request without a separate issue for a bug/enhancement? Yes, **but**, in that case, the pull request **must have a full description of the bug or feature**. Just because you have fixed/implemented it already doesn't mean you can skip the details. The reviewers of the pull request still need to know all of the information you would normally put in the bug report or feature request. ### How my patch will be applied? Before being applied, your pull request will be reviewed by the maintainer and also by other users. You can also help the project by reviewing others pull requests. The reviewer will almost always ask for some changes. In that case, just push an additional commit implementing the requested changes, and then ask for a review update. At the end, the reviewer may ask you to "squash" all review commits in a single one. If your patch is accepted it will be applied either: - by "merging" your branch, - by cherry-picking your commit on top of the `master` branch. This makes the history linear, and so easier to track. In any case, your authorship will be preserved in the commit. ### What if my patch is not applied? If you don't even get a review, add a "ping" comment with increasing delay between pings: 1 week, 2 weeks, then every month. But I'm trying to do better on this than what was happening before. If a stable version is released while your pull request has still not been merged on any working branch of the main repo, it would be helpful to ease the maintainer's work by rebasing your branch on top of the latest `master` and push it again to your GitHub repo. Be careful (for example create a branch or a tag before your rebase) because your may lose all your work in that process. [@Rycieos](https://github.com/Rycieos), maintainer. liquidprompt-2.2.1/CONTRIBUTORS.md000066400000000000000000000172271464055045500165450ustar00rootroot00000000000000# Contributors Keeping this list in order of importance or size would be impossible, so it is in order of least recent to most recent contribution. We thank all our contributors, no matter the size of their contribution. Please do not open a new issue or pull request just for adding yourself to this file. If you made a contribution and got missed, please add a comment on the issue or pull request of your contribution, and we will add it. Thanks again to everyone for all of the help and support! ### Maintainers * @nojhan (Original author) * Olivier Mengué (@dolmen) (Former lead maintainer) * Mark Vander Stel (@Rycieos) (Current lead maintainer) ### Code contributions * @nojhan * Yann 'Ze' Richard (@Zeuh) * Aurélien Requiem (@aureq) * François Schmidts (@jaesivsm) * Joris Dedieu (@rmdir) * Florian Le Frioux (@floweb) * Ludovic Rousseau (@LudovicRousseau) * Thomas Debesse * @Poil * Michel Barret (@barmic) * Luc Didry (@ldidry) * Olivier Mengué (@dolmen) * Alex Prengère (@alexprengere) * Olivier Dupuis (@ojdupuis) * Frédéric Lepied (@flepied) * Christophe Drevet * Joris Vaillant (@jorisv) * Étienne Deparis (@milouse) * Clément Mathieu (@cykl) * David Loureiro (@dloureiro) * Nicolas Lacourte (@nlacourte) * Jonas Bengtsson (@jonasb) * Stéphane Pajot * Brad Beyenhof (@augmentedfourth) * Julien Pecqueur (@jpec) * Rolf Morel (@rolfmorel) * Jean-Sébastien Leroy (@jsleroy) * Joseph Bass (@jab416171) * Ying Li (@cyli) * Daniel Miranda (@danielkza) * Brendan Fahy (@f4hy) * Young King (@wayhome) * Dustin Knie (@nullpuppy) * @Cougar * Octavian Damiean (@mainerror) * Nicolas Pouillard (@np) * Olivier Le Thanh Duong (@olethanh) * Markus Dreseler (@mrks) * Kim Lidström (@dxtr) * Taahir Ahmed (@ahmedtd) * Ryan Wilson-Perkin (@ryanwilsonperkin) * George Macon (@gmacon) * Anthony Gelibert (@anthonygelibert) * @yannack * Felix Chern (@dryman) * Kyle P Davis (@KylePDavis) * Alexander Belyaev (@alexbel) * Cosmin L. Neagu (@clneagu) * Brett McBride (@brettmc) * Linus Wallgren (@ecksun) * Matthew Micene (@nzwulfin) * Panagiotis Kkolos (@pkkolos) * Chase Colman (@chase) * Wilson Maravilha (@wmv) * Vincent Lara (@l-vincent-l) * Bartosz Janda (@bartoszj) * Morgan Knicely (@morganizeit) * Austen Adler (@stonewareslord) * Jonathan Giddy (@jongiddy) * Jeremy Clement (@hexaJer) * Samuel Krieg (@SamK) * @hegedus * Erik Jacobs (@thoraxe) * Hagen Graf (@hcgraf) * Tener Hades (@clayboone) * Philipp Grogg (@gro-gg) * @Hotschke * Software Mechanic * Simon McVittie (@smcv) * Felix Schlitter (@felixSchl) * Mark Vander Stel (@Rycieos) * Philip Garrison (@pgarrison) * Matt Smith (@ncs-msmith) * @ste-fan * Peter van Dijk (@Habbie) * Nolan Leake (@nolanl) * Dmitry V. Drozdovich (@thrushcat) * Tristan Miller (@logological) * Markus Gebert (@mgeb) * Tore Anderson (@toreanderson) * Fabien MARTY (@thefab) * Alessio Garzi (@Ozzyboshi) * Mathieu MD (@mathieumd) * Romano Giannetti (@Rmano) * Paulo Cazarotto (@phcco) * Jürgen Weigert (@jnweiger) * Sven-Hendrik Haase (@svenstaro) * Sandro Jäckel (@SuperSandro2000) * David Pape (@zyzzyxdonta) * Aksel Sjögren (@akselsjogren) * Raina Otoni (@rotoni) * Munif Tanjim (@MunifTanjim) * Martin Schütte (@mschuett) * Sam Pearson (@sagepe) * Ken Crowell (@oeuftete) * Ian Smith (@ismith) * Emil Lerch (@elerch) * Michael Livshin (@cmm) * Slobodan Todorov (@todorowww) * Simon Chopin (@schopin-pro) * @Mice7R * Alan Hoyle (@alanhoyle) * David Caro (@Terseus) * Mark Korondi (@kmARC) * Thomas Guimbretiere (@ProfMobius) * Marco d'Itri (@rfc1036) * @go2null * Łukasz Stelmach (@steelman) * @slowpeek * TIAN Yuanhao (@tianyuanhao) * Michal Gawlik (@dex6) ### Code cleanup * Aurélien Requiem (@aureq) * Olivier Mengué (@dolmen) * Roy Wellington Ⅳ (@thanatos) * Roland van Laar (@rvanlaar) * Nicolás Alvarez (@nicolas17) * Frédéric Mahé (@frederic-mahe) * Kevin Yap (@iKevinY) * Matt Kelly (@mattkelly) * Colin Lieberman (@colinlieberman) * Bryce Jasmer (@b-jazz) * Jonas Brømsø (@jonasbn) ### Documentation changes / clarifications * Arturo Borrero Gonzalez (@aborrero) * Brad Beyenhof (@augmentedfourth) * John Hamelink (@johnhamelink) * @YouthfulIndiscretion * Imran Munshi (@imran27) * Dugan Chen (@duganchen) * Aleksey Tsalolikhin (@atsalolikhin-spokeo) * Otto Kekäläinen (@ottok) * Jonas Brømsø (@jonasbn) ### Bug reports / Feature requests * @skanx * Yann 'Ze' Richard (@Zeuh) * Michael Grosser (@grosser) * Ludovic Rousseau (@LudovicRousseau) * Matthias Bussonnier (@Carreau) * Guillaume (@Gui13) * Olivier Mengué (@dolmen) * Alex Prengère (@alexprengere) * @nojhan * Lorenzo Leonini (@lleonini) * @razcampagne * Christophe Drevet-Droguet (@dr4Ke) * David Loureiro (@dloureiro) * Clément Mathieu (@cykl) * Guillaume Denry (@Guid75) * @gpapia * Luc Didry (@ldidry) * Mathieu Roche (@mathieuroche) * Julien Pecqueur (@jpec) * Loïc Guitaut (@Flink) * @madmanu * @quent57 * @vicnet * Daniel Miranda (@danielkza) * Brendan Fahy (@f4hy) * Nicolas Pouillard (@np) * Richard Hartmann (@RichiH) * François Schmidts (@jaesivsm) * Anthony Carathimas (@acgreek) * Olivier Patry (@opatry) * @manitooo * Michael Cramer (@mikewebkist) * Octavian Damiean (@mainerror) * @Cougar * Brad Beyenhof (@augmentedfourth) * Florian Eitel (@nougad) * Kyle P Davis (@KylePDavis) * David Holm (@dholm) * Pat Ramsey (@patramsey) * Sébastien Sanoro (@dereckson) * Taahir Ahmed (@ahmedtd) * Emmett Butler (@emmett9001) * Zak B. Elep (@zakame) * André David (@adavidzh) * @N-Mi * @Cottser * José Alberto (@jalberto) * Guilherme Semente (@semente) * Brad Clements (@bkc) * Cosmin L. Neagu (@clneagu) * Brett McBride (@brettmc) * Andreas Böttger (@aboettger) * Chase Colman (@chase) * Stefan Wimmer (@wimstefan) * Oliver Jan Krylow (@bugabinga) * Chris Lasher (@gotgenes) * @cato- * Matt Fletcher (@MaffooBristol) * Bartosz Janda (@bartoszj) * Nicola Paolucci (@durdn) * Jeremy Clement (@hexaJer) * Brian May (@brianmay) * Arturo Borrero Gonzalez (@aborrero) * Toban Wiebe (@tobanw) * Daniel Serodio (@dserodio) * Peter VandeHaar (@pjvandehaar) * Dave Rigby (@daverigby) * Sebastian Bremicker (@sebrem) * Simon McVittie (@smcv) * Mark Vander Stel (@Rycieos) * Jon Garrison (@jpwgarrison) * Iain Hallam (@iainhallam) * Mathias Picker (@mathiasp) * Joey Liu (@liujoey) * Florian Pigorsch (@flopp) * Daniel Pinyol (@dpinol) * Alyssa Ross (@alyssais) * Gergo Szonyi (@gex) * Nolan Leake (@nolanl) * Éloi Rivard (@azmeuk) * Felix Eckhofer (@tribut) * Paul Lhussiez (@Depado) * Cyril Bouthors (@cyril-bouthors) * Felix Schlitter (@felixSchl) * Christoph Burschka (@cburschka) * @dreamcat4 * Munif Tanjim (@MunifTanjim) * @ilovezfs * Aleksey Tsalolikhin (@atsaloli) * Micah Silverman (@dogeared) * Rohan Kapadia (@kapad) * Jan Gorecki (@jangorecki) * Otto Kekäläinen (@ottok) * Mike Simonson (@mikeSimonson) * Viorel-Cosmin Miron (@uhlhosting) * Dimitrie Hoekstra (@dimitrieh) * Hynek Vychodil (@pichi) * Ned Batchelder (@nedbat) * Gary Wolfman (@OldCrow) * @Orgams * Andrei Matei (@andreimatei) * Tiziano Santoro (@tiziano88) * Michael Louis Thaler (@mithaler) * Michael Große (@micgro42) * Niko Storni (@nikooo777) * Chris Weyl (@rsrchboy) * Federico Stra (@FedericoStra) * Roman (@hatifnatt) * Alan Hoyle (@alanhoyle) * Janne Himanka (@jhimanka) * Peter van Dijk (@Habbie) * Martin Blanchard (@t-chaik) * François GUÉRIN (@frague59) * Florian "KopfKrieg" (@KopfKrieg) * @tsangal * František Trebuňa (@gortibaldik) * Pablo Mora (@kiteloopdesign) * @ShrykeWindgrace * Zach Callear (@Magotchi) * Tom Hoover (@tomhoover) * Maxime U Garcia (@maxulysse) * Mark Korondi (@kmARC) * Riccardo Mollo (@rm1984) * @webbb82 * Aurélien (@orel1) * Eugene Medvedev (@Mihara) * Christian Heusel (@christian-heusel) * Ross Patterson (@rpatterson) * Tomasz Kapias (@tkapias) liquidprompt-2.2.1/LICENSE000066400000000000000000001033301464055045500152620ustar00rootroot00000000000000 GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . liquidprompt-2.2.1/README.md000066400000000000000000000071571464055045500155460ustar00rootroot00000000000000

Liquid Prompt
A useful adaptive prompt for Bash & Zsh

Liquid Prompt gives you a carefully designed prompt with useful information. It shows you what you need when you need it. You will notice what changes when it changes, saving time and frustration. You can even use it with your favorite shell – Bash or zsh.

WebsiteOverviewInstall

## Examples Below are screenshots of typical states that you would see in everyday use. Using the default theme: ![Screenshot](https://raw.githubusercontent.com/liquidprompt/liquidprompt/master/docs/theme/default-med.png) Using the Powerline theme: ![Screenshot](https://raw.githubusercontent.com/liquidprompt/liquidprompt/master/docs/theme/included/powerline-med.png) Of course, Liquid Prompt may display much more information, depending on the status of your system. ## Why Liquidprompt? There are many prompts configurations out there, but here is what makes Liquid Prompt stand out: - **UX Design**: The Liquid Prompt was very carefully design from the beginning, to allow for the best user experience. That is, it displays *meaningful* information with *minimal visual clutter* and *maximum readability*. While most of the other prompts are focused on aligning as much colored "segments" as possible on top of each others to look fancy, Liquid Prompt focus on what really matters. - **Ease of use**: The Liquid Prompt is written in (*heavily optimized*) portable Shell, and its installation is as easy as copying files. It also provides pre-defined themes, enabled by a simple command in your shell configuration. Configuration is as simple as editing text file with key/value pairs. No complex format to learn. - **Shell features first**: The Liquid Prompt helps you being aware of all the powerfull features a modern shell can provide. While most of the other prompts focus on covering a lot of (boring) software version tags, Liquid Prompt shows you the features that are actually useful while you actually use the shell. - **Configurability**: All aspects of Liquid Prompt are configurable, down to the core. To see what that entails, see the [latest features overview](https://liquidprompt.readthedocs.io/en/latest/overview.html) (which also presents a comparison with other prompt systems). You may also take a closer look at this screenshot of a session showing various features, in the default theme: ![Screenshot](https://raw.github.com/liquidprompt/liquidprompt/master/demo.png) ## Documentation ![Tests](https://github.com/liquidprompt/liquidprompt/workflows/tests/badge.svg) [![Documentation Status](https://readthedocs.org/projects/liquidprompt/badge/?version=stable)](https://liquidprompt.readthedocs.io/) See the [Liquidprompt documentation](https://liquidprompt.readthedocs.io/) for details on installing and configuring Liquidprompt. ## License Liquid Prompt is distributed under the [GNU Affero General Public License version 3](LICENSE). ## Authors Current Maintainer: [Rycieos](https://github.com/Rycieos). Other main authors: [nojhan](https://github.com/nojhan) and [dolmen](https://github.com/dolmen). And many [contributors](CONTRIBUTORS.md)! liquidprompt-2.2.1/contrib/000077500000000000000000000000001464055045500157155ustar00rootroot00000000000000liquidprompt-2.2.1/contrib/README.md000066400000000000000000000017101464055045500171730ustar00rootroot00000000000000# liquidprompt/contrib Policy This directory contains files that have been contributed by contributors but that the core Liquid Prompt maintainers do not maintain. So they are probably outdated and possibly poor quality (because the maintainers may not have the knowledge to properly review them). So use them at your own risk, and do not open issues about them, just send patches. ## Contributing First check the project [Contributing document](../CONTRIBUTING.md). Second, make sure you include documentation with what you are adding. Just because we hold the content of this directory to a lower standard does not mean we allow missing documentation. Add a README.md file to the top-level directory that you are adding. Lastly, if you would like to voluteer as the maintainer for some content in here, please clearly document that in the README for your content. Make sure to add how you would like to be contacted: via email, Github issue, or whatever else. liquidprompt-2.2.1/contrib/dist/000077500000000000000000000000001464055045500166605ustar00rootroot00000000000000liquidprompt-2.2.1/contrib/dist/archlinux-aur/000077500000000000000000000000001464055045500214425ustar00rootroot00000000000000liquidprompt-2.2.1/contrib/dist/archlinux-aur/PKGBUILD000066400000000000000000000021311464055045500225630ustar00rootroot00000000000000# Maintainer: Julien Pecqueur (JPEC) pkgname=liquidprompt-git pkgver=20130314 pkgrel=3 pkgdesc="An intelligent and non intrusive prompt for bash and zsh" url="https://github.com/liquidprompt/liquidprompt" arch=('any') license=('AGPLv3') optdepends=('screen' 'acpi') makedepends=('git') md5sums=('SKIP') install=liquidprompt.install _gitroot="git://github.com/liquidprompt/liquidprompt.git" _gitname="liquidprompt" build() { cd ${srcdir}/ msg "Connecting to the GIT server...." if [[ -d ${srcdir}/${_gitname} ]] ; then cd ${_gitname} git reset --hard git pull origin msg "The local files are updated..." else msg "Cloning git repo..." git clone ${_gitroot} cd ${_gitname} fi git reset --hard msg "GIT checkout done." msg "Generate default config file..." ./tools/config-from-doc.sh > liquidpromptrc-dist msg "done." } package() { cd "${srcdir}/${_gitname}" # install files install -Dm755 liquidprompt "$pkgdir/usr/bin/liquidprompt" install -Dm644 liquidpromptrc-dist "$pkgdir/etc/liquidpromptrc" } # vim:set ts=2 sw=2 et: liquidprompt-2.2.1/contrib/dist/archlinux-aur/liquidprompt.install000066400000000000000000000001151464055045500255600ustar00rootroot00000000000000post_install() { echo "Use 'source liquidprompt' to enable the prompt." } liquidprompt-2.2.1/contrib/dist/debian/000077500000000000000000000000001464055045500201025ustar00rootroot00000000000000liquidprompt-2.2.1/contrib/dist/debian/create_deb.sh000077500000000000000000000011631464055045500225170ustar00rootroot00000000000000#!/bin/sh echo "Creating Debian's package..." nano ./liquidprompt/DEBIAN/control echo "Generating default config file" cd ../../.. ./tools/config-from-doc.sh > liquidpromptrc-dist cd contrib/dist/debian/ echo "Copying files..." mkdir -p ./liquidprompt/usr/bin/ cp ../../../liquidprompt ./liquidprompt/usr/bin/liquidprompt mkdir -p ./liquidprompt/etc/ cp ../../../liquidpromptrc-dist ./liquidprompt/etc/liquidpromptrc chmod a+x ./liquidprompt/usr/bin/liquidprompt echo "Building liquidprompt.deb..." dpkg-deb -b liquidprompt echo "Deleting files..." rm -f ./liquidprompt/etc/* rm -f ./liquidprompt/usr/bin/* echo "Done !" liquidprompt-2.2.1/contrib/dist/debian/liquidprompt/000077500000000000000000000000001464055045500226335ustar00rootroot00000000000000liquidprompt-2.2.1/contrib/dist/debian/liquidprompt/DEBIAN/000077500000000000000000000000001464055045500235555ustar00rootroot00000000000000liquidprompt-2.2.1/contrib/dist/debian/liquidprompt/DEBIAN/control000066400000000000000000000006001464055045500251540ustar00rootroot00000000000000Package: liquidprompt Version: 2.2.0 Section: base Priority: optional Architecture: all Depends: bash, coreutils Recommends: acpi Suggests: git, svn, fossil, mercurial, bzr, cmake, screen, tmux Maintainer: Julien Pecqueur Description: A full-featured & carefully designed adaptive prompt for Bash & Zsh. Homepage: http://github.com/liquidprompt/liquidprompt liquidprompt-2.2.1/contrib/presets/000077500000000000000000000000001464055045500174025ustar00rootroot00000000000000liquidprompt-2.2.1/contrib/presets/colors/000077500000000000000000000000001464055045500207035ustar00rootroot00000000000000liquidprompt-2.2.1/contrib/presets/colors/256-colors-dark.conf000066400000000000000000000170411464055045500243070ustar00rootroot00000000000000# Default themes, but with more nuanced colors. # Recall of lp_terminal_format usage: # fg, bg, bold, underline, fallback_fg, fallback_bg # -1 = none, -2 = previous, -3 = switch fg/g # COLORMAP lp_terminal_format 33 -1 0 0 14 -1 # light blue LP_CM_0="$lp_terminal_format" lp_terminal_format 27 -1 1 0 14 -1 # blue LP_CM_1="$lp_terminal_format" lp_terminal_format 21 -1 1 1 12 -1 # dark blue LP_CM_2="$lp_terminal_format" lp_terminal_format 57 -1 0 0 12 -1 # magenta LP_CM_3="$lp_terminal_format" lp_terminal_format 53 -1 1 0 5 -1 # bordeaux LP_CM_4="$lp_terminal_format" lp_terminal_format 129 -1 0 0 5 -1 # violet LP_CM_5="$lp_terminal_format" lp_terminal_format 125 -1 1 0 13 -1 # wine LP_CM_6="$lp_terminal_format" lp_terminal_format 160 -1 0 0 13 -1 # pink red LP_CM_7="$lp_terminal_format" lp_terminal_format 196 -1 1 0 9 -1 # red LP_CM_8="$lp_terminal_format" lp_terminal_format 9 -1 1 0 0 9 # bright red LP_CM_9="$lp_terminal_format" LP_COLORMAP=( ${LP_COLORMAP[@]+"${LP_COLORMAP[@]}"} ) if [[ ${#LP_COLORMAP[@]} == 0 ]]; then LP_COLORMAP=( "$LP_CM_0" "$LP_CM_1" "$LP_CM_2" "$LP_CM_3" "$LP_CM_4" "$LP_CM_5" "$LP_CM_6" "$LP_CM_7" "$LP_CM_8" "$LP_CM_9" ) fi # lp_terminal_format X -1 0 0 X -1 # # CLOCK: discreet lp_terminal_format 63 -1 0 0 4 -1 # slightly dimmed magenta LP_COLOR_TIME="$lp_terminal_format" # SENSORS: blue-magenta-red (subset of colormap) lp_terminal_format 33 -1 0 0 12 -1 # light blue LP_COLOR_CHARGING_ABOVE="$lp_terminal_format" lp_terminal_format 57 -1 0 0 12 -1 # magenta LP_COLOR_CHARGING_UNDER="$lp_terminal_format" lp_terminal_format 160 -1 1 0 13 -1 # pink red LP_COLOR_DISCHARGING_ABOVE="$lp_terminal_format" lp_terminal_format 196 -1 1 0 9 -1 # fancy red LP_COLOR_DISCHARGING_UNDER="$lp_terminal_format" # JOBS: yellow lp_terminal_format 214 -1 0 0 3 -1 # orangish yellow LP_COLOR_JOB_D="$lp_terminal_format" lp_terminal_format 220 -1 0 0 11 -1 # golden yellow LP_COLOR_JOB_R="$lp_terminal_format" lp_terminal_format 226 -1 0 0 11 -1 # citrus yellow LP_COLOR_JOB_Z="$lp_terminal_format" # Colored separator mark. lp_terminal_format 208 -1 0 0 3 -1 # dark orange LP_MARK_JOBS_SEPARATOR="${lp_terminal_format}/" # LOCATION lp_terminal_format 78 -1 1 0 14 -1 # light cyan LP_COLOR_IN_MULTIPLEXER="$lp_terminal_format" lp_terminal_format 148 -1 0 0 2 -1 # light kaki LP_COLOR_USER_LOGGED="$lp_terminal_format" lp_terminal_format 220 -1 1 0 11 -1 # light orange LP_COLOR_USER_ROOT="$lp_terminal_format" lp_terminal_format 156 -1 1 0 10 -1 # very light cyanish green LP_COLOR_X11_ON="$lp_terminal_format" lp_terminal_format 222 -1 0 0 11 -1 # orangish light pink LP_COLOR_X11_OFF="$lp_terminal_format" lp_terminal_format 114 -1 0 0 6 -1 # cyanish blue LP_COLOR_HOST="$lp_terminal_format" lp_terminal_format 226 -1 1 0 11 -1 # light yellow LP_COLOR_SU="$lp_terminal_format" lp_terminal_format 0 9 1 0 0 9 # bold black on red LP_COLOR_TELNET="$lp_terminal_format" lp_terminal_format 123 -1 0 0 14 -1 # quite light cyan LP_COLOR_WRITE="$lp_terminal_format" lp_terminal_format 214 -1 1 0 3 -1 # orange LP_COLOR_NOWRITE="$lp_terminal_format" lp_terminal_format 153 -1 0 0 7 -1 # light greyish blue LP_COLOR_PATH="$lp_terminal_format" lp_terminal_format 63 -1 0 0 8 -1 # magentish blue LP_COLOR_PATH_SEPARATOR="${lp_terminal_format}" lp_terminal_format 147 -1 0 0 8 -1 # light magenta LP_COLOR_PATH_SHORTENED="${lp_terminal_format}" lp_terminal_format 75 -1 1 0 8 -1 # light blue LP_COLOR_PATH_VCS_ROOT=${lp_terminal_format} lp_terminal_format 159 -1 1 0 8 -1 # very light blue LP_COLOR_PATH_LAST_DIR=${lp_terminal_format} lp_terminal_format 220 -1 1 0 11 -1 # bold yellow LP_COLOR_PATH_ROOT="$lp_terminal_format" # SESSION: magentas lp_terminal_format 105 -1 0 0 13 -1 # light purple LP_COLOR_DIRSTACK="$lp_terminal_format" lp_terminal_format 141 -1 0 0 13 -1 # lighter magenta LP_COLOR_PROXY="$lp_terminal_format" lp_terminal_format 135 -1 0 0 5 -1 # quite magenta LP_COLOR_SHLVL="$lp_terminal_format" lp_terminal_format 99 -1 0 0 5 -1 # frank magenta LP_COLOR_ENV_VARS_UNSET="$lp_terminal_format" lp_terminal_format 171 -1 0 0 5 -1 # orangish magenta LP_COLOR_ENV_VARS_SET="$lp_terminal_format" # DEV/ENVS: magentas/pinks lp_terminal_format 165 -1 0 0 5 -1 # frank purple LP_MARK_DEV_OPEN="${lp_terminal_format}<" lp_terminal_format 165 -1 0 0 5 -1 # frank purple LP_MARK_DEV_MID="${lp_terminal_format}|" lp_terminal_format 165 -1 0 0 5 -1 # frank purple LP_MARK_DEV_CLOSE="${lp_terminal_format}>" lp_terminal_format 135 -1 0 0 4 -1 # quite magenta LP_COLOR_OS_ARCH="$lp_terminal_format" lp_terminal_format 141 -1 0 0 4 -1 # lighter magenta LP_COLOR_OS_FAMILY="$lp_terminal_format" lp_terminal_format 147 -1 0 0 5 -1 # light magenta LP_COLOR_OS_KERNEL="$lp_terminal_format" lp_terminal_format 183 -1 0 0 5 -1 # light magentish pink LP_COLOR_OS_DISTRIB="$lp_terminal_format" lp_terminal_format 189 -1 0 0 13 -1 # light pinkish magenta LP_COLOR_OS_VERSION="$lp_terminal_format" # Colored separator mark. lp_terminal_format 93 -1 0 0 4 -1 # dark magenta LP_MARK_OS_SEP="${lp_terminal_format}:" lp_terminal_format 188 -1 0 0 5 -1 # very light lavish purple LP_COLOR_AWS_PROFILE="$lp_terminal_format" lp_terminal_format 182 -1 0 0 5 -1 # lavish purple LP_COLOR_CONTAINER="$lp_terminal_format" lp_terminal_format 176 -1 0 0 5 -1 # light orangish purple LP_COLOR_TERRAFORM="$lp_terminal_format" lp_terminal_format 170 -1 0 0 5 -1 # orangish purple LP_COLOR_KUBECONTEXT="$lp_terminal_format" lp_terminal_format 169 -1 0 0 13 -1 # orangish magenta LP_COLOR_SOFTCOL="$lp_terminal_format" lp_terminal_format 175 -1 0 0 13 -1 # light orangish magenta LP_COLOR_VIRTUALENV="$lp_terminal_format" lp_terminal_format 181 -1 0 0 13 -1 # pastel orangish magenta LP_COLOR_NODE_VENV="$lp_terminal_format" lp_terminal_format 187 -1 0 0 13 -1 # almost green light magenta LP_COLOR_RUBY_VENV="$lp_terminal_format" lp_terminal_format 219 -1 0 0 13 -1 # light pink LP_COLOR_CMAKE_C="$lp_terminal_format" lp_terminal_format 219 -1 0 0 13 -1 # pink LP_COLOR_CMAKE_CXX="$lp_terminal_format" lp_terminal_format 225 -1 0 0 13 -1 # light pink LP_COLOR_CMAKE_GEN="$lp_terminal_format" lp_terminal_format 201 -1 0 0 13 -1 # dark pink LP_COLOR_CMAKE_BUILD="$lp_terminal_format" lp_terminal_format 213 -1 0 0 13 -1 # quite pink LP_COLOR_CMAKE_DEBUG="$lp_terminal_format" lp_terminal_format 225 -1 0 0 13 -1 # light pink LP_COLOR_CMAKE_RWDI="$lp_terminal_format" lp_terminal_format 231 -1 0 0 13 -1 # very light pink LP_COLOR_CMAKE_RELEASE="$lp_terminal_format" # Colored separator mark. lp_terminal_format 93 -1 0 0 4 -1 # dark magenta LP_MARK_CMAKE="${lp_terminal_format}:" # VCS: mixed lp_terminal_format 84 -1 0 0 10 -1 # light cyan LP_COLOR_UP="$lp_terminal_format" lp_terminal_format 215 -1 0 0 11 -1 # pinkish orange LP_COLOR_COMMITS="$lp_terminal_format" lp_terminal_format 196 -1 0 0 1 -1 # redish pink LP_COLOR_CHANGES="$lp_terminal_format" lp_terminal_format 9 -1 1 0 9 -1 # bold red LP_COLOR_COMMITS_BEHIND="$lp_terminal_format" lp_terminal_format 124 -1 0 0 1 -1 # dark pinkish orange LP_COLOR_DIFF="$lp_terminal_format" # LAST SECTION: oranges lp_terminal_format 214 -1 1 0 5 -1 # orange LP_COLOR_RUNTIME="$lp_terminal_format" lp_terminal_format 220 -1 0 0 5 -1 # light orange LP_COLOR_ERR="$lp_terminal_format" lp_terminal_format 226 -1 1 0 5 -1 # very light orangish yellow LP_COLOR_ERR_MEANING="$lp_terminal_format" lp_terminal_format 15 -1 1 0 5 -1 # light yellow LP_COLOR_MARK="$lp_terminal_format" lp_terminal_format 202 -1 1 0 11 -1 # dark orange LP_COLOR_MARK_SUDO="$lp_terminal_format" lp_terminal_format 0 9 1 0 0 9 # bold black on red LP_COLOR_MARK_ROOT="$lp_terminal_format" liquidprompt-2.2.1/contrib/presets/colors/256-colors-light.conf000066400000000000000000000170041464055045500244740ustar00rootroot00000000000000# Default themes, but with more nuanced colors. # Recall of lp_terminal_format usage: # fg, bg, bold, underline, fallback_fg, fallback_bg # -1 = none, -2 = previous, -3 = switch fg/g # COLORMAP lp_terminal_format 33 -1 0 0 14 -1 # light blue LP_CM_0="$lp_terminal_format" lp_terminal_format 27 -1 1 0 14 -1 # blue LP_CM_1="$lp_terminal_format" lp_terminal_format 21 -1 1 1 12 -1 # dark blue LP_CM_2="$lp_terminal_format" lp_terminal_format 57 -1 0 0 12 -1 # magenta LP_CM_3="$lp_terminal_format" lp_terminal_format 53 -1 1 0 5 -1 # bordeaux LP_CM_4="$lp_terminal_format" lp_terminal_format 129 -1 0 0 5 -1 # violet LP_CM_5="$lp_terminal_format" lp_terminal_format 125 -1 1 0 13 -1 # wine LP_CM_6="$lp_terminal_format" lp_terminal_format 160 -1 0 0 13 -1 # pink red LP_CM_7="$lp_terminal_format" lp_terminal_format 196 -1 1 0 9 -1 # red LP_CM_8="$lp_terminal_format" lp_terminal_format 9 -1 1 0 0 9 # bright red LP_CM_9="$lp_terminal_format" LP_COLORMAP=( ${LP_COLORMAP[@]+"${LP_COLORMAP[@]}"} ) if [[ ${#LP_COLORMAP[@]} == 0 ]]; then LP_COLORMAP=( "$LP_CM_0" "$LP_CM_1" "$LP_CM_2" "$LP_CM_3" "$LP_CM_4" "$LP_CM_5" "$LP_CM_6" "$LP_CM_7" "$LP_CM_8" "$LP_CM_9" ) fi # lp_terminal_format X -1 0 0 X -1 # # CLOCK: discreet lp_terminal_format 141 -1 0 0 4 -1 # slightly dimmed magenta LP_COLOR_TIME="$lp_terminal_format" # SENSORS: blue-magenta-red (subset of colormap) lp_terminal_format 33 -1 0 0 12 -1 # light blue LP_COLOR_CHARGING_ABOVE="$lp_terminal_format" lp_terminal_format 57 -1 0 0 12 -1 # magenta LP_COLOR_CHARGING_UNDER="$lp_terminal_format" lp_terminal_format 160 -1 1 0 13 -1 # pink red LP_COLOR_DISCHARGING_ABOVE="$lp_terminal_format" lp_terminal_format 196 -1 1 0 9 -1 # fancy red LP_COLOR_DISCHARGING_UNDER="$lp_terminal_format" # JOBS: yellow lp_terminal_format 208 -1 0 0 3 -1 # light orange LP_COLOR_JOB_D="$lp_terminal_format" lp_terminal_format 209 -1 1 0 11 -1 # orange LP_COLOR_JOB_R="$lp_terminal_format" lp_terminal_format 202 -1 1 0 11 -1 # dark orange LP_COLOR_JOB_Z="$lp_terminal_format" # Colored separator mark. lp_terminal_format 215 -1 0 0 3 -1 # light orange LP_MARK_JOBS_SEPARATOR="${lp_terminal_format}/" # LOCATION lp_terminal_format 33 -1 1 0 14 -1 # light cyan LP_COLOR_IN_MULTIPLEXER="$lp_terminal_format" lp_terminal_format 70 -1 0 0 2 -1 # light kaki LP_COLOR_USER_LOGGED="$lp_terminal_format" lp_terminal_format 166 -1 1 0 11 -1 # light orange LP_COLOR_USER_ROOT="$lp_terminal_format" lp_terminal_format 76 -1 1 0 10 -1 # very light cyanish green LP_COLOR_X11_ON="$lp_terminal_format" lp_terminal_format 172 -1 0 0 11 -1 # orangish light pink LP_COLOR_X11_OFF="$lp_terminal_format" lp_terminal_format 30 -1 0 0 6 -1 # cyanish blue LP_COLOR_HOST="$lp_terminal_format" lp_terminal_format 208 -1 1 0 11 -1 # light yellow LP_COLOR_SU="$lp_terminal_format" lp_terminal_format 0 9 1 0 0 9 # bold black on red LP_COLOR_TELNET="$lp_terminal_format" lp_terminal_format 37 -1 0 0 14 -1 # quite light cyan LP_COLOR_WRITE="$lp_terminal_format" lp_terminal_format 166 -1 1 0 3 -1 # orange LP_COLOR_NOWRITE="$lp_terminal_format" lp_terminal_format 21 -1 0 0 7 -1 # light greyish blue LP_COLOR_PATH="$lp_terminal_format" lp_terminal_format 69 -1 0 0 8 -1 # magentish blue LP_COLOR_PATH_SEPARATOR="${lp_terminal_format}" lp_terminal_format 63 -1 0 0 8 -1 # light magenta LP_COLOR_PATH_SHORTENED="${lp_terminal_format}" lp_terminal_format 27 -1 1 0 8 -1 # light blue LP_COLOR_PATH_VCS_ROOT=${lp_terminal_format} lp_terminal_format 33 -1 1 0 8 -1 # very light blue LP_COLOR_PATH_LAST_DIR=${lp_terminal_format} lp_terminal_format 3 -1 1 0 11 -1 # bold yellow LP_COLOR_PATH_ROOT="$lp_terminal_format" # SESSION: magentas lp_terminal_format 105 -1 0 0 13 -1 # light purple LP_COLOR_DIRSTACK="$lp_terminal_format" lp_terminal_format 141 -1 0 0 13 -1 # lighter magenta LP_COLOR_PROXY="$lp_terminal_format" lp_terminal_format 135 -1 0 0 5 -1 # quite magenta LP_COLOR_SHLVL="$lp_terminal_format" lp_terminal_format 99 -1 0 0 5 -1 # frank magenta LP_COLOR_ENV_VARS_UNSET="$lp_terminal_format" lp_terminal_format 171 -1 0 0 5 -1 # orangish magenta LP_COLOR_ENV_VARS_SET="$lp_terminal_format" # DEV/ENVS: magentas/pinks lp_terminal_format 213 -1 0 0 5 -1 # light purple LP_MARK_DEV_OPEN="${lp_terminal_format}<" lp_terminal_format 213 -1 0 0 5 -1 # light purple LP_MARK_DEV_MID="${lp_terminal_format}|" lp_terminal_format 213 -1 0 0 5 -1 # light purple LP_MARK_DEV_CLOSE="${lp_terminal_format}>" lp_terminal_format 57 -1 0 0 4 -1 # quite magenta LP_COLOR_OS_ARCH="$lp_terminal_format" lp_terminal_format 93 -1 0 0 4 -1 # lighter magenta LP_COLOR_OS_FAMILY="$lp_terminal_format" lp_terminal_format 129 -1 0 0 5 -1 # light magenta LP_COLOR_OS_KERNEL="$lp_terminal_format" lp_terminal_format 165 -1 0 0 5 -1 # light magentish pink LP_COLOR_OS_DISTRIB="$lp_terminal_format" lp_terminal_format 201 -1 0 0 13 -1 # light pinkish magenta LP_COLOR_OS_VERSION="$lp_terminal_format" # Colored separator mark. lp_terminal_format 207 -1 0 0 4 -1 # dark magenta LP_MARK_OS_SEP="${lp_terminal_format}:" lp_terminal_format 207 -1 0 0 5 -1 # very light lavish purple LP_COLOR_AWS_PROFILE="$lp_terminal_format" lp_terminal_format 171 -1 0 0 5 -1 # lavish purple LP_COLOR_CONTAINER="$lp_terminal_format" lp_terminal_format 135 -1 0 0 5 -1 # light orangish purple LP_COLOR_TERRAFORM="$lp_terminal_format" lp_terminal_format 99 -1 0 0 5 -1 # orangish purple LP_COLOR_KUBECONTEXT="$lp_terminal_format" lp_terminal_format 98 -1 0 0 13 -1 # orangish magenta LP_COLOR_SOFTCOL="$lp_terminal_format" lp_terminal_format 135 -1 0 0 13 -1 # light orangish magenta LP_COLOR_VIRTUALENV="$lp_terminal_format" lp_terminal_format 171 -1 0 0 13 -1 # pastel orangish magenta LP_COLOR_NODE_VENV="$lp_terminal_format" lp_terminal_format 207 -1 0 0 13 -1 # almost green light magenta LP_COLOR_RUBY_VENV="$lp_terminal_format" lp_terminal_format 92 -1 0 0 13 -1 # light pink LP_COLOR_CMAKE_C="$lp_terminal_format" lp_terminal_format 128 -1 0 0 13 -1 # pink LP_COLOR_CMAKE_CXX="$lp_terminal_format" lp_terminal_format 164 -1 0 0 13 -1 # light pink LP_COLOR_CMAKE_GEN="$lp_terminal_format" lp_terminal_format 200 -1 0 0 13 -1 # dark pink LP_COLOR_CMAKE_BUILD="$lp_terminal_format" lp_terminal_format 200 -1 0 0 13 -1 # quite pink LP_COLOR_CMAKE_DEBUG="$lp_terminal_format" lp_terminal_format 2199 -1 0 0 13 -1 # light pink LP_COLOR_CMAKE_RWDI="$lp_terminal_format" lp_terminal_format 198 -1 0 0 13 -1 # very light pink LP_COLOR_CMAKE_RELEASE="$lp_terminal_format" # Colored separator mark. lp_terminal_format 207 -1 0 0 4 -1 # dark magenta LP_MARK_CMAKE="${lp_terminal_format}:" # VCS: mixed lp_terminal_format 84 -1 0 0 10 -1 # light cyan LP_COLOR_UP="$lp_terminal_format" lp_terminal_format 215 -1 0 0 11 -1 # pinkish orange LP_COLOR_COMMITS="$lp_terminal_format" lp_terminal_format 196 -1 0 0 1 -1 # redish pink LP_COLOR_CHANGES="$lp_terminal_format" lp_terminal_format 9 -1 1 0 9 -1 # bold red LP_COLOR_COMMITS_BEHIND="$lp_terminal_format" lp_terminal_format 124 -1 0 0 1 -1 # dark pinkish orange LP_COLOR_DIFF="$lp_terminal_format" # LAST SECTION: oranges lp_terminal_format 214 -1 1 0 5 -1 # orange LP_COLOR_RUNTIME="$lp_terminal_format" lp_terminal_format 209 -1 0 0 5 -1 # light orange LP_COLOR_ERR="$lp_terminal_format" lp_terminal_format 208 -1 1 0 5 -1 # very light orangish yellow LP_COLOR_ERR_MEANING="$lp_terminal_format" lp_terminal_format 0 -1 1 0 0 -1 # black LP_COLOR_MARK="$lp_terminal_format" lp_terminal_format 202 -1 1 0 11 -1 # dark orange LP_COLOR_MARK_SUDO="$lp_terminal_format" lp_terminal_format 0 9 1 0 0 9 # bold black on red LP_COLOR_MARK_ROOT="$lp_terminal_format" liquidprompt-2.2.1/contrib/presets/colors/green-not-blue.conf000066400000000000000000000062341464055045500244020ustar00rootroot00000000000000# Preset for severe Blue-yellow dichromacy color blindness. __lp_foreground_color 2 GREEN="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}" BOLD_GREEN="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${_LP_CLOSE_ESC}" # Replaces blues by greens. LP_COLOR_CMAKE_RWDI=${GREEN} LP_COLOR_PROXY=${BOLD_GREEN} LP_COLOR_ENV_VARS_UNSET=${GREEN} LP_COLOR_ENV_VARS_SET=${BOLD_GREEN} LP_COLOR_SSH=${GREEN} LP_COLOR_TIME=${GREEN} LP_COLOR_IN_MULTIPLEXER=${BOLD_GREEN} LP_COLOR_CONTAINER=${BOLD_GREEN} # fg, bg, bold, underline, fallback_fg, fallback_bg # -1 = none, -2 = previous, -3 = switch fg/g lp_terminal_format 46 -1 0 0 10 -1 # light green LP_CM_0="$lp_terminal_format" lp_terminal_format 40 -1 1 0 10 -1 # green LP_CM_1="$lp_terminal_format" lp_terminal_format 34 -1 1 1 10 -1 # dark green LP_CM_2="$lp_terminal_format" lp_terminal_format 70 -1 0 0 2 -1 # kaki LP_CM_3="$lp_terminal_format" lp_terminal_format 106 -1 1 0 2 -1 # yellowish kaki LP_CM_4="$lp_terminal_format" lp_terminal_format 142 -1 0 0 3 -1 # green brown LP_CM_5="$lp_terminal_format" lp_terminal_format 178 -1 1 0 3 -1 # brown orange LP_CM_6="$lp_terminal_format" lp_terminal_format 214 -1 0 0 11 -1 # orange LP_CM_7="$lp_terminal_format" lp_terminal_format 220 -1 1 0 11 -1 # yellow LP_CM_8="$lp_terminal_format" lp_terminal_format 226 -1 1 0 0 11 # light yellow LP_CM_9="$lp_terminal_format" LP_COLORMAP=( ${LP_COLORMAP[@]+"${LP_COLORMAP[@]}"} ) if [[ ${#LP_COLORMAP[@]} == 0 ]]; then LP_COLORMAP=( "$LP_CM_0" "$LP_CM_1" "$LP_CM_2" "$LP_CM_3" "$LP_CM_4" "$LP_CM_5" "$LP_CM_6" "$LP_CM_7" "$LP_CM_8" "$LP_CM_9" ) fi # Default Configuration (no reds). # LP_COLOR_CMAKE_DEBUG=${MAGENTA} # LP_COLOR_CMAKE_RELEASE=${CYAN} # LP_COLOR_PATH=${NO_COL} # lp_terminal_format 8 -1 0 0 -1 # LP_COLOR_PATH_SEPARATOR=${lp_terminal_format} # LP_COLOR_PATH_SHORTENED=${lp_terminal_format} # lp_terminal_format -1 -1 1 0 # LP_COLOR_PATH_VCS_ROOT=${lp_terminal_format} # LP_COLOR_PATH_LAST_DIR=${lp_terminal_format} # LP_COLOR_PATH_ROOT=${BOLD_YELLOW} # LP_COLOR_JOB_D=${YELLOW} # LP_COLOR_JOB_R=${BOLD_YELLOW} # LP_COLOR_JOB_Z=${BOLD_YELLOW} # LP_COLOR_ERR=${PURPLE} # LP_COLOR_ERR_MEANING=${LP_COLOR_ERR} # LP_COLOR_MARK=${BOLD} # LP_COLOR_MARK_ROOT=${BOLD_RED} # LP_COLOR_MARK_SUDO=${LP_COLOR_MARK_ROOT} # LP_COLOR_USER_LOGGED=${""} # LP_COLOR_USER_ALT=${BOLD} # LP_COLOR_USER_ROOT=${BOLD_YELLOW} # LP_COLOR_HOST=${""} # LP_COLOR_SU=${BOLD_YELLOW} # LP_COLOR_TELNET=${WARN_RED} # LP_COLOR_X11_ON=${GREEN} # LP_COLOR_X11_OFF=${YELLOW} # LP_COLOR_WRITE=${GREEN} # LP_COLOR_NOWRITE=${RED} # LP_COLOR_UP=${GREEN} # LP_COLOR_COMMITS=${YELLOW} # LP_COLOR_COMMITS_BEHIND=${BOLD_RED} # LP_COLOR_CHANGES=${RED} # LP_COLOR_DIFF=${PURPLE} # LP_COLOR_CHARGING_ABOVE=${GREEN} # LP_COLOR_CHARGING_UNDER=${YELLOW} # LP_COLOR_DISCHARGING_ABOVE=${YELLOW} # LP_COLOR_DISCHARGING_UNDER=${RED} # LP_COLOR_RUNTIME=${YELLOW} # LP_COLOR_VIRTUALENV=${CYAN} # LP_COLOR_NODE_VENV=${LP_COLOR_VIRTUALENV} # LP_COLOR_RUBY_VENV=${LP_COLOR_VIRTUALENV} # LP_COLOR_TERRAFORM=${PINK} # LP_COLOR_DIRSTACK=${BOLD_YELLOW} # LP_COLOR_KUBECONTEXT=${CYAN} # LP_COLOR_AWS_PROFILE=${YELLOW} # LP_COLOR_SHLVL=${LP_COLOR_SHLVL:-$BOLD_GREEN} liquidprompt-2.2.1/contrib/presets/colors/yellow-not-red.conf000066400000000000000000000062401464055045500244350ustar00rootroot00000000000000# Preset for severe Red-green dichromacy color blindness. __lp_foreground_color 3 YELLOW="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}" BOLD_YELLOW="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${_LP_CLOSE_ESC}" # Replaces reds by yellows. LP_COLOR_MARK_ROOT=${BOLD_YELLOW} LP_COLOR_NOWRITE=${YELLOW} LP_COLOR_COMMITS_BEHIND=${BOLD_YELLOW} LP_COLOR_CHANGES=${YELLOW} lp_terminal_format 226 -1 1 0 0 11 LP_COLOR_TELNET=${lp_terminal_format} # fg, bg, bold, underline, fallback_fg, fallback_bg # -1 = none, -2 = previous, -3 = switch fg/g lp_terminal_format 46 -1 0 0 10 -1 # light green LP_CM_0="$lp_terminal_format" lp_terminal_format 40 -1 1 0 10 -1 # green LP_CM_1="$lp_terminal_format" lp_terminal_format 34 -1 1 1 10 -1 # dark green LP_CM_2="$lp_terminal_format" lp_terminal_format 70 -1 0 0 2 -1 # kaki LP_CM_3="$lp_terminal_format" lp_terminal_format 106 -1 1 0 2 -1 # yellowish kaki LP_CM_4="$lp_terminal_format" lp_terminal_format 142 -1 0 0 3 -1 # green brown LP_CM_5="$lp_terminal_format" lp_terminal_format 178 -1 1 0 3 -1 # brown orange LP_CM_6="$lp_terminal_format" lp_terminal_format 214 -1 0 0 11 -1 # orange LP_CM_7="$lp_terminal_format" lp_terminal_format 220 -1 1 0 11 -1 # yellow LP_CM_8="$lp_terminal_format" lp_terminal_format 226 -1 1 0 0 11 # light yellow LP_CM_9="$lp_terminal_format" LP_COLORMAP=( ${LP_COLORMAP[@]+"${LP_COLORMAP[@]}"} ) if [[ ${#LP_COLORMAP[@]} == 0 ]]; then LP_COLORMAP=( "$LP_CM_0" "$LP_CM_1" "$LP_CM_2" "$LP_CM_3" "$LP_CM_4" "$LP_CM_5" "$LP_CM_6" "$LP_CM_7" "$LP_CM_8" "$LP_CM_9" ) fi # Default Configuration (no reds). # LP_COLOR_CMAKE_DEBUG=${MAGENTA} # LP_COLOR_CMAKE_RWDI=${BLUE} # LP_COLOR_CMAKE_RELEASE=${CYAN} # LP_COLOR_PATH=${NO_COL} # lp_terminal_format 8 -1 0 0 -1 # LP_COLOR_PATH_SEPARATOR=${lp_terminal_format} # LP_COLOR_PATH_SHORTENED=${lp_terminal_format} # lp_terminal_format -1 -1 1 0 # LP_COLOR_PATH_VCS_ROOT=${lp_terminal_format} # LP_COLOR_PATH_LAST_DIR=${lp_terminal_format} # LP_COLOR_PATH_ROOT=${BOLD_YELLOW} # LP_COLOR_PROXY=${BOLD_BLUE} # LP_COLOR_ENV_VARS_UNSET=${BLUE} # LP_COLOR_ENV_VARS_SET=${BOLD_BLUE} # LP_COLOR_JOB_D=${YELLOW} # LP_COLOR_JOB_R=${BOLD_YELLOW} # LP_COLOR_JOB_Z=${BOLD_YELLOW} # LP_COLOR_ERR=${PURPLE} # LP_COLOR_ERR_MEANING=${LP_COLOR_ERR} # LP_COLOR_MARK=${BOLD} # LP_COLOR_MARK_SUDO=${LP_COLOR_MARK_ROOT} # LP_COLOR_USER_LOGGED=${""} # LP_COLOR_USER_ALT=${BOLD} # LP_COLOR_USER_ROOT=${BOLD_YELLOW} # LP_COLOR_HOST=${""} # LP_COLOR_SSH=${BLUE} # LP_COLOR_SU=${BOLD_YELLOW} # LP_COLOR_X11_ON=${GREEN} # LP_COLOR_X11_OFF=${YELLOW} # LP_COLOR_WRITE=${GREEN} # LP_COLOR_UP=${GREEN} # LP_COLOR_COMMITS=${YELLOW} # LP_COLOR_DIFF=${PURPLE} # LP_COLOR_CHARGING_ABOVE=${GREEN} # LP_COLOR_CHARGING_UNDER=${YELLOW} # LP_COLOR_DISCHARGING_ABOVE=${YELLOW} # LP_COLOR_TIME=${BLUE} # LP_COLOR_IN_MULTIPLEXER=${BOLD_BLUE} # LP_COLOR_RUNTIME=${YELLOW} # LP_COLOR_VIRTUALENV=${CYAN} # LP_COLOR_NODE_VENV=${LP_COLOR_VIRTUALENV} # LP_COLOR_RUBY_VENV=${LP_COLOR_VIRTUALENV} # LP_COLOR_TERRAFORM=${PINK} # LP_COLOR_CONTAINER=${BOLD_BLUE} # LP_COLOR_DIRSTACK=${BOLD_YELLOW} # LP_COLOR_KUBECONTEXT=${CYAN} # LP_COLOR_AWS_PROFILE=${YELLOW} # LP_COLOR_SHLVL=${BOLD_GREEN} liquidprompt-2.2.1/contrib/presets/more-unicode.conf000066400000000000000000000017511464055045500226430ustar00rootroot00000000000000# This preset use fancier characters than the default, # but they should still be in most unicode fonts. LP_TIME_FORMAT="%Hₕ%Mₘ%Sₛ" LP_DELIMITER_KUBECONTEXT_PREFIX="「" LP_DELIMITER_KUBECONTEXT_SUFFIX="」" LP_MARK_BRACKET_CLOSE="⦘" LP_MARK_BRACKET_OPEN="⦗" LP_MARK_CMAKE="·" LP_MARK_DEV_CLOSE="❭" LP_MARK_DEV_OPEN="❬" LP_MARK_JOBS_SEPARATOR="·" LP_MARK_LOAD="Ⓛ " LP_MARK_PERM="⋮ " LP_MARK_PROXY="ⓟ " LP_MARK_SHORTEN_PATH="⋯" LP_MARK_STASH="ⓢ " LP_MARK_TEMP="ⓣ " LP_MARK_UNTRACKED="ⓤ " LP_MARK_VCSH="⛙ " LP_MARK_OS_SEP=" " LP_MARK_OS=( # Arch "x86_64=${BLUE}x64${NO_COL}" "i386=i3" "i686=i6" "aarch64=${GREEN}a64${NO_COL}" # Families "BSD=${RED}B${NO_COL}" "Windows=🪟" "Unix=U" "GNU=🐮" # Kernels "FreeBSD=👹" "DragonFly=🦋" "OpenBSD=🐡" "Darwin=🍎" "SunOS=${BOLD_YELLOW}☀${NO_COL}" "Cygwin=🦢" "MSYS=${MAGENTA}M${NO_COL}" "MinGW=${BOLD_RED}G${NO_COL}" "Linux=🐧" ) liquidprompt-2.2.1/contrib/presets/nerd-font.conf000066400000000000000000000036271464055045500221550ustar00rootroot00000000000000# This preset use symbols from Nerd fonts. # https://www.nerdfonts.com/ # It is required that your terminal emulator use a patched font to see it correctly. LP_TIME_FORMAT="%Hₕ%Mₘ%Sₛ" LP_DELIMITER_KUBECONTEXT_PREFIX="⟮" LP_DELIMITER_KUBECONTEXT_SUFFIX="⟯" LP_MARK_ADAPTER="" LP_MARK_BATTERY="" LP_MARK_BRACKET_CLOSE="" LP_MARK_BRACKET_OPEN="" LP_MARK_CMAKE="·" LP_MARK_DEV_CLOSE="❭" LP_MARK_DEV_MID="ﱞ" LP_MARK_DEV_OPEN="❬" LP_MARK_DIRSTACK="" LP_MARK_DISABLED="" LP_MARK_GIT="" LP_MARK_JOBS_SEPARATOR="·" LP_MARK_LOAD="" LP_MARK_PERM=" ✒ " LP_MARK_PROXY="ﳣ" LP_MARK_SHLVL="" LP_MARK_SHORTEN_PATH="⋯" LP_MARK_STASH="" LP_MARK_TEMP="" LP_MARK_UNTRACKED="" LP_MARK_VCSH="" LP_MARK_WIFI="直" LP_MARK_OS_SEP="" LP_MARK_OS=( # Arch "x86_64" "" "i686" "6" "aarch64" "" # Families "BSD" "${RED}𝐁${NO_COL}" "Windows" "" "Unix" "𝐔" "GNU" "" # Kernels "FreeBSD" "${YELLOW}${NO_COL}" "DragonFly" "" "OpenBSD" "🐡" "Darwin" "" "SunOS" "${BOLD_YELLOW}${NO_COL}" "Cygwin" "🦢" "MSYS" "${MAGENTA}𝐌${NO_COL}" "MinGW" "${BOLD_RED}𝐆${NO_COL}" "Linux" "" "Android" "${GREEN}${NO_COL}" # Distributions "arch" "" "debian" "${RED}${NO_COL}" "raspbian" "" "ubuntu" "${YELLOW}${NO_COL}" "centos" "" "coreos" "" "elementary" "" "mint" "" "fedora" "${BLUE}${NO_COL}" "gentoo" "" "mageia" "" "nixos" "" "manjaro" "" "devuan" "" "alpine" "" "aosc" "" "opensuse" "${GREEN}${NO_COL}" "sabayon" "" "slackware" "" "artix" "A" "rhel" "${RED}${NO_COL}" "amzn" "" ) liquidprompt-2.2.1/contrib/status-bar/000077500000000000000000000000001464055045500200025ustar00rootroot00000000000000liquidprompt-2.2.1/contrib/status-bar/i3-dock.sh000077500000000000000000000014601464055045500215730ustar00rootroot00000000000000#!/bin/bash height="20" wdir=$(dirname $0) # Cannot use terminal emulator reusing a common daemon from which to fork windows, or else the PID will change. # e.g. gnome-terminal, terminator, etc. # urxvt gets X11 errors and shorten the output... xterm -bg black -e watch --no-title --no-wrap --color --interval 1 $wdir/lp-status.sh default $wdir/lp-status.conf & PID="$!" ID=$(xdotool search --sync -pid $PID 2>/dev/null) width=$(xrandr -q | head -n1 | awk '{print $8}') xdotool windowunmap --sync ${ID} xdotool windowsize --sync ${ID} ${width} ${height} xprop -id "${ID}" -format _NET_WM_WINDOW_TYPE 32a -set _NET_WM_WINDOW_TYPE "_NET_WM_WINDOW_TYPE_DOCK" xprop -id "${ID}" -format _NET_WM_STRUT_PARTIAL 32cccccccccccc -set _NET_WM_STRUT_PARTIAL "0,0,${height},0,0,0,0,0,0,${width},0,0" xdotool windowmap ${ID} liquidprompt-2.2.1/contrib/status-bar/lp-status.conf000066400000000000000000000031211464055045500226020ustar00rootroot00000000000000LP_PATH_VCS_ROOT=0 LP_PS1_POSTFIX="" LP_PS1_PREFIX="" # Fancy datetime format LP_TIME_FORMAT="%A %d %B %Y (%Z, w.%V) : %Hh %Mm %Ss" LP_ENABLE_AWS_PROFILE=1 LP_ENABLE_BATT=1 LP_ENABLE_BZR=0 LP_ENABLE_CMAKE=0 LP_ENABLE_COLOR=1 LP_ENABLE_CONTAINER=0 LP_ENABLE_DETACHED_SESSIONS=1 LP_ENABLE_DIRSTACK=0 LP_ENABLE_ERROR=0 LP_ENABLE_ERROR_MEANING=0 LP_ENABLE_ERROR_MEANING_EXTENDED=0 LP_ENABLE_ENV_VARS=1 LP_ENABLE_FOSSIL=0 LP_ENABLE_GIT=0 LP_ENABLE_HG=0 LP_ENABLE_HYPERLINKS=0 LP_ENABLE_JOBS=1 LP_ENABLE_KUBECONTEXT=0 LP_ENABLE_KUBE_NAMESPACE=0 LP_ENABLE_LOAD=1 LP_ENABLE_MODULES=1 LP_ENABLE_MODULES_VERSIONS=1 LP_ENABLE_MODULES_HASHCOLOR=0 LP_ENABLE_NODE_VENV=0 LP_ENABLE_OS=1 LP_ENABLE_OS_ARCH=1 LP_ENABLE_OS_DISTRIB=1 LP_ENABLE_OS_FAMILY=1 LP_ENABLE_OS_KERNEL=1 LP_ENABLE_OS_VERSION=1 LP_ENABLE_PATH=0 LP_ENABLE_PERL_VENV=1 LP_ENABLE_PERM=0 LP_ENABLE_PROXY=1 LP_ENABLE_RUBY_VENV=1 LP_ENABLE_RUNTIME=0 LP_ENABLE_RUNTIME_BELL=0 LP_ENABLE_SCLS=1 LP_ENABLE_SCREEN_TITLE=0 LP_ENABLE_SHLVL=0 LP_ENABLE_SHORTEN_PATH=0 LP_ENABLE_SSH_COLORS=0 LP_ENABLE_SUDO=0 LP_ENABLE_SVN=0 LP_ENABLE_TEMP=1 LP_ENABLE_TERRAFORM=0 LP_ENABLE_TIME=1 LP_ENABLE_TITLE=0 LP_ENABLE_TITLE_COMMAND=0 LP_ENABLE_VCS_ROOT=0 LP_ENABLE_VIRTUALENV=1 LP_ENABLE_WIFI_STRENGTH=1 # Some environment variables. LP_ENV_VARS=( "DESKTOP_SESSION %s T" "TERMINAL %s" "EDITOR %s" ) LP_HOSTNAME_ALWAYS=1 LP_HOSTNAME_METHOD="full" LP_ALWAYS_DISPLAY_VALUES=1 LP_DISPLAY_VALUES_AS_PERCENTS=1 LP_TIME_ANALOG=0 LP_USER_ALWAYS=1 # Always show sensors. LP_BATTERY_THRESHOLD=100 LP_LOAD_CAP=2.0 LP_LOAD_THRESHOLD=0 LP_TEMP_THRESHOLD=0 LP_WIFI_STRENGTH_THRESHOLD=100 liquidprompt-2.2.1/contrib/status-bar/lp-status.sh000077500000000000000000000022531464055045500222770ustar00rootroot00000000000000#!/bin/bash wdir=$(pwd) cd $(dirname $0)/../.. set -u . ./liquidprompt --no-activate # If a theme was given, use the theme and source all other arguments. if [[ -z ${1-} || $1 == --help ]]; then printf ' Usage: %s theme [sourced files...] Print out the prompt. Example usage: %s powerline themes/powerline/powerline.theme ' "$0" "$0" exit 1 else theme=$1 shift for file in "$@"; do # shellcheck disable=SC1090 . "$file" done fi # Liquid Prompt depends on PS1 being set to detect if it has installed itself. PS1="$ " # Activate and generate lp_activate --no-config # Only needs to be done once lp_theme "$theme" || exit "$?" cd $wdir # Since the shell is not evaluating PS1, if we print the PS1 to the console, # the shell escape sequences will not be hidden, and it will look wrong. We # cannot strip them ahead of time, since they are required to know where to # look to remove formatting, so we have to do it right before printing it. __remove_shell_escapes() { # PS1 -> PS1 PS1="${PS1//"${_LP_OPEN_ESC}"/}" PS1="${PS1//"${_LP_CLOSE_ESC}"/}" } __print_prompt() { __lp_set_prompt __remove_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ʆeR &[ &o3*XwILnB'jG,fJˬsYk q-5Ⱥ&vIR]BNX 4R27v=6ُn"b{1{bYrpN~ Ϭ,Ⱦϟobin~M{f!7 -dI05EȺq] 4|:~AEML[ϼe;9~R( D}Z3\Y>M7ťhl>A 0/kCp"<æ:Zw -C@V/΋]e?wj1$u^IQ9bDl~DnFwh;N\I3༉ 3$1aA7&jJ$M9aХs$.I43Z "g3{i\mC$QO7I<Ϯ8FvnLy fq#fAK;g?J: , ̾`1ySp)z)GK7+tk@_ Ց/u 4`DٵLt뱯s6to<.ndm<ų3aVrNây~uts1f̛ij߹L~ ' >/g0aPƟ=MG]T\{F.[lJٌ1K찋ď ,72v{. Bx|8VJ񍌋}fѧx<>O ˀ%Ct7 ୃ/+g#x98BEÝ+>˛@[İ'vOvsf/-)P\CiێbY#&GG,mEs6idy4O\?BM<;|W$y,C\Ќ^T>^9lv&r~4u-zVx)r { `&'FSbOja1зoW# "me0L;Hs}x5W-gzT'2+ظf]K/` d_]sGױvD=[@)8{˞5ݻ c؍KWazbL@;?cҀѼR<ϲW3{{K Lqu;yD6Et[G]$ 'fv HsA]D B&.qWyJ'c͸ɓ̏EQ]15݃UѣfGX4b0CMRdG_{OҶMţRЫ|r^GC}`;I5oaJ-O k8z&L7J9H=jB32??ߡ+¥mD|wU}~UuBP( !q9 BP(*V( BP(ct* BP( EiZjVIENDB`liquidprompt-2.2.1/docs/000077500000000000000000000000001464055045500152055ustar00rootroot00000000000000liquidprompt-2.2.1/docs/.gitignore000066400000000000000000000000161464055045500171720ustar00rootroot00000000000000_build/ venv/ liquidprompt-2.2.1/docs/Makefile000066400000000000000000000011721464055045500166460ustar00rootroot00000000000000# Minimal makefile for Sphinx documentation # # You can set these variables from the command line, and also # from the environment for the first two. SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build SOURCEDIR = . BUILDDIR = _build # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) liquidprompt-2.2.1/docs/README.md000066400000000000000000000010651464055045500164660ustar00rootroot00000000000000 Build docs ========== To build the documentation for checking your edits, try the HTML target: `make html` and open `_build/index.html`. Prompts Comparison ================== The prompts comparison table source `prompts comparison.ods` is an Open Document Sheet produced with LibreOffice (6.4.7.2), then exported to PDF, then exported to SVG with Inkscape (1.2). It is this SVG that is included in the documentation, so if you edit the source table, do not forget to export it to SVG as well. Logo ==== The font used in the SVG logo is "TeX Gyre Chorus". liquidprompt-2.2.1/docs/_static/000077500000000000000000000000001464055045500166335ustar00rootroot00000000000000liquidprompt-2.2.1/docs/_static/liquid.css000066400000000000000000000005161464055045500206360ustar00rootroot00000000000000 .wy-side-nav-search { background-color: #3771c8; } .wy-nav-side { background-color: #1a1a1a; } a { color: #3771c8; } a:hover { text-decoration: underline; } a.external:after { content: " (↗)"; } .wy-nav-side a { color: #87aade; } .wy-side-nav-search a { color: #e3e2db; font-size: large; } liquidprompt-2.2.1/docs/conf.py000066400000000000000000000063541464055045500165140ustar00rootroot00000000000000# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys import time # sys.path.insert(0, os.path.abspath('.')) # -- Project information ----------------------------------------------------- project = 'Liquid Prompt' copyright = '2011-%s, Liquid Prompt team' % time.strftime('%Y') author = 'Mark Vander Stel' # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx_rtd_theme', 'sphinxcontrib.spelling', ] # This value determines how to group the document tree into manual pages man_pages = [ ('functions', 'liquidprompt', 'Liquid Prompt functions', [], 3), ('config', 'liquidprompt', 'Liquid Prompt configuration', [], 5), ('theme', 'liquidprompt', 'Liquid Prompt theming', [], 7), ] # A URL to cross-reference manpage directives manpages_url = 'https://manpages.debian.org/{path}' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ['_build', 'venv', 'Thumbs.db', '.DS_Store'] highlight_language = 'shell' # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'sphinx_rtd_theme' # Adds a logo to the navbar. html_logo = 'liquidprompt_emblem.svg' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # These paths are either relative to html_static_path # # or fully qualified paths (eg. https://...) html_css_files = [ 'liquid.css', ] # linkchecker dislikes anchor tags in github links: https://github.com/sphinx-doc/sphinx/issues/9016 # breezy-vcs.org has been having intermittent dns problems ("Temporary failure in name # resolution") for a while now linkcheck_ignore = [ r'^https://github.com/rcaloras/bash-preexec/blob/master/README.md#install$', r'^https://www.breezy-vcs.org/$', r'^https://spaceship-prompt.sh/$', ] nitpick_ignore_regex = [ # Environment variables are defined by external programs, so we do not # write documentation for them. ('envvar', r'.*'), # Our returned values are done in variables, not types. ('py:class', r'.*'), ] # This is not Python code, so don't ignore Python specific things. spelling_ignore_python_builtins=False spelling_ignore_importable_modules=False liquidprompt-2.2.1/docs/config.rst000066400000000000000000002115511464055045500172110ustar00rootroot00000000000000Config Options ************** .. contents:: :local: Almost every feature in Liquid Prompt can be turned on or off using these config options. They can either be set before sourcing Liquid Prompt (in ``.bashrc`` or ``.zshrc``, or sourcing a preset), or set in a Liquid Prompt config file. .. note:: Config variables set in a config file take precedence over variables set in the environment or on the command line. Setting a config option on the command line, then running :func:`lp_activate` will overwrite that option with the value from the config file, if it is set there. The config file is searched for in the following locations: * ``~/.liquidpromptrc`` * ``$XDG_CONFIG_HOME/liquidpromptrc`` - (if :envvar:`XDG_CONFIG_HOME` is not set, ``~/.config`` is used) * ``$XDG_CONFIG_DIRS/liquidpromptrc`` - :envvar:`XDG_CONFIG_DIRS` is a ``:`` delimited array, each value is searched. (if :envvar:`XDG_CONFIG_DIRS` is not set, ``/etc/xdg`` is used) * ``/etc/liquidpromptrc`` The first file found is sourced. To get your own configuration, you may want to generate a default configuration by calling the following script:: ./tools/config-from-doc.sh > my_liquidpromptrc Then edit the ``my_liquidpromptrc`` file to suits your needs and copy/link it where you want. In the event that you synchronize your configuration file across multiple computers, or if you have an ``/etc/liquidpromptrc`` system-wide from which you'd like to make minor deviations in an individual user account, you can augment the primary config to add in any local modifications using lines such as these:: LOCAL_RCFILE=$HOME/.liquidpromptrc.local [ -f "$LOCAL_RCFILE" ] && source "$LOCAL_RCFILE" .. note:: The example config file does not include every config option, and the comments describing the options are less verbose than the descriptions on this page. Several example of configurations are given in the ``contrib/presets`` directory. Some of these presets can be combined, for instance for changing the icons, along with the colors. Each config option is documented with its default value. Options of type ``bool`` accept values of ``1`` for true and ``0`` for false. General ------- .. attribute:: LP_MARK_PREFIX :type: string :value: " " String added directly before :attr:`LP_MARK_DEFAULT`, after all other parts of the prompt. Can be used to tag the prompt in a way that is less intrusive than :attr:`LP_PS1_PREFIX`, or add a newline before the prompt mark. For example:: LP_MARK_PREFIX=$'\n' .. attribute:: LP_PATH_CHARACTER_KEEP :type: int :value: 3 The number of characters to save at the start and possibly the end of a directory name when shortening the path. See :attr:`LP_PATH_METHOD` for details of the specific methods. .. versionadded:: 2.0 .. attribute:: LP_PATH_DEFAULT :type: string :value: "" .. deprecated:: 2.0 Use :attr:`LP_PATH_METHOD` set to `truncate_to_last_dir` instead. Used to define the string used for the path. Could be used to make use of shell path shortening features, like ``%2~`` in Zsh to keep the last two directories of the path. :attr:`LP_ENABLE_SHORTEN_PATH` must be disabled to have any effect. .. attribute:: LP_PATH_KEEP :type: int :value: 2 The number of directories (counting '/') to display at the beginning of a shortened path. Set to ``1``, will display only root. Set to ``0``, will keep nothing from the beginning of the path. :attr:`LP_ENABLE_SHORTEN_PATH` must be enabled to have any effect. See also: :attr:`LP_PATH_LENGTH` and :attr:`LP_PATH_METHOD`. .. versionchanged:: 2.0 No longer supports a value of ``-1``. .. attribute:: LP_PATH_LENGTH :type: int :value: 35 The maximum percentage of the terminal width used to display the path before removing the center portion of the path and replacing with :attr:`LP_MARK_SHORTEN_PATH`. :attr:`LP_ENABLE_SHORTEN_PATH` must be enabled to have any effect. .. note:: :attr:`LP_PATH_KEEP` and :attr:`LP_PATH_METHOD` have higher precedence over this option. Important path parts, including directories saved by :attr:`LP_PATH_KEEP`, :attr:`LP_PATH_VCS_ROOT`, and the last directory, will always be displayed, even if the path does not fit in the maximum length. .. attribute:: LP_PATH_METHOD :type: string :value: "truncate_chars_from_path_left" Sets the method used for shortening the path display when it exceeds the maximum length set by :attr:`LP_PATH_LENGTH`. * **truncate_chars_from_path_left**: Truncates characters from the start of the path, showing consecutive directories as one shortened section. E.g. in a directory named ``~/MyProjects/liquidprompt/tests``, it will be shortened to ``...prompt/tests``. The shortened mark is :attr:`LP_MARK_SHORTEN_PATH`. * **truncate_chars_from_dir_right**: Leaves the beginning of a directory name untouched. E.g. directories will be shortened like so: ``~/Doc.../Office``. How many characters will be untouched is set by :attr:`LP_PATH_CHARACTER_KEEP`. The shortened mark is :attr:`LP_MARK_SHORTEN_PATH`. * **truncate_chars_from_dir_middle**: Leaves the beginning and end of a directory name untouched. E.g. in a directory named ``~/MyProjects/Office``, then it will be shortened to ``~/MyP...cts/Office``. How many characters will be untouched is set by :attr:`LP_PATH_CHARACTER_KEEP`. The shortened mark is :attr:`LP_MARK_SHORTEN_PATH`. * **truncate_chars_to_unique_dir**: Truncate each directory to the shortest unique starting portion of their name. E.g. in a folder ``~/dev/liquidprompt``, it will be shortened to ``~/d/liquidprompt`` if there is no other directory starting with 'd' in the home directory. * **truncate_to_last_dir**: Only display the last directory in the path. In other words, the current directory name. All methods (other than `truncate_to_last_dir`) start at the far left of the path (limited by :attr:`LP_PATH_KEEP`). Only the minimum number of directories needed to fit inside :attr:`LP_PATH_LENGTH` will be shortened. :attr:`LP_ENABLE_SHORTEN_PATH` must be enabled to have any effect. .. versionadded:: 2.0 .. attribute:: LP_PATH_VCS_ROOT :type: bool :value: 1 Display the root directory of the current VCS repository with special formatting, set by :attr:`LP_COLOR_PATH_VCS_ROOT`. If :attr:`LP_ENABLE_SHORTEN_PATH` is enabled, also prevent the path shortening from shortening or hiding the VCS root directory. .. versionadded:: 2.0 .. attribute:: LP_PS1_POSTFIX :type: string :value: "" A string displayed at the very end of the prompt, after even the prompt mark. :attr:`LP_MARK_PREFIX` is an alternative that goes before the prompt mark. .. attribute:: LP_PS1_PREFIX :type: string :value: "" A string displayed at the start of the prompt. Can also be set with :func:`prompt_tag`. .. attribute:: LP_TIME_FORMAT :type: string :value: "%H:%M:%S" The formatting string passed to :manpage:`date(1)` using formatting from :manpage:`strftime(3)` used to display the current date and/or time. See also: :attr:`LP_ENABLE_TIME`. .. versionadded:: 2.1 Features -------- .. attribute:: LP_ALWAYS_DISPLAY_VALUES :type: bool :value: 1 Display the actual values of load, batteries, and wifi signal strength along with their corresponding marks. Disable to only print the colored marks. See also: :attr:`LP_ENABLE_LOAD`, :attr:`LP_ENABLE_BATT`, :attr:`LP_ENABLE_DISK`, and :attr:`LP_ENABLE_WIFI_STRENGTH`. .. versionadded: 2.2 .. attribute:: LP_DELIMITER_KUBECONTEXT_PREFIX :type: string :value: "" Delimiter to shorten the Kubernetes context by removing a prefix. Usage example: * if your context names are `cluster-dev` and `cluster-test`, then set this to "-" in order to output `dev` and `test` in prompt. * if using AWS EKS then set this to "/" to show only the cluster name, without the rest of the ARN (``arn:aws:eks:$AWS_REGION:$ACCOUNT_ID:cluster/$CLUSTER_NAME``) * alternatively, if using AWS EKS, set this to ":" to show only `cluster/$CLUSTER_NAME`. (Note: the prefix removed is a greedy match - it contains all the ":"s in the input.) If set to the empty string no truncating will occur (this is the default). See also: :attr:`LP_ENABLE_KUBECONTEXT`, :attr:`LP_DELIMITER_KUBECONTEXT_SUFFIX`, :attr:`LP_COLOR_KUBECONTEXT`, and :attr:`LP_MARK_KUBECONTEXT`. .. versionadded:: 2.1 .. attribute:: LP_DELIMITER_KUBECONTEXT_SUFFIX :type: string :value: "" Delimiter to shorten the Kubernetes context by removing a suffix. Usage example: * if your context names are `dev-cluster` and `test-cluster`, then set this to "-" in order to output `dev` and `test` in prompt. * if your context names are `dev.k8s.example.com` and `test.k8s.example.com`, then set this to "." in order to output `dev` and `test` in prompt. (Note: the suffix removed is a greedy match - it contains all the "."s in the input.) * if using OpenShift then set this to "/" to show only the project name without the cluster and user parts. If set to the empty string no truncating will occur (this is the default). See also: :attr:`LP_ENABLE_KUBECONTEXT`, :attr:`LP_DELIMITER_KUBECONTEXT_PREFIX`, :attr:`LP_COLOR_KUBECONTEXT`, and :attr:`LP_MARK_KUBECONTEXT`. .. versionadded:: 2.1 .. attribute:: LP_DISABLED_VCS_PATH :type: string :value: "" .. deprecated:: 2.0 Use :attr:`LP_DISABLED_VCS_PATHS` instead. An colon (``:``) separated list of absolute directory paths where VCS features will be disabled. See :attr:`LP_DISABLED_VCS_PATHS` for more information. .. attribute:: LP_DISABLED_VCS_PATHS :type: array :value: () An array of absolute directory paths where VCS features will be disabled. Generally this would be used for repositories that are large and slow, where generating VCS information for the prompt would impact prompt responsiveness. Any subdirectory under the input directory is also disabled, so setting `/repos` would disable VCS display when the current directory is `/repos/a-repo`. Setting ``("/")`` would disable VCS display completely. An example value would be:: LP_DISABLED_VCS_PATHS=("/a/svn/repo" "/home/me/my/large/repo") See also: :attr:`LP_MARK_DISABLED`. .. versionadded:: 2.0 .. attribute:: LP_DISPLAY_VALUES_AS_PERCENTS :type: bool :value: 0 When displaying a value, show it as a percentage if possible. Used in sensors for capacities, see :attr:`LP_ENABLE_DISK`, :attr:`LP_ENABLE_BATT`. .. versionadded: 2.2 .. attribute:: LP_ENABLE_AWS_PROFILE :type: bool :value: 1 Display the current value of :envvar:`AWS_PROFILE`, :envvar:`AWS_DEFAULT_PROFILE`, or :envvar:`AWS_VAULT`. AWS_PROFILE and AWS_DEFAULT_PROFILE are used to switch between configuration profiles by the `AWS CLI`_. AWS_VAULT is used by `aws-vault`_ to specify the AWS profile in use. .. _`AWS CLI`: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html .. _`aws-vault`: https://github.com/99designs/aws-vault See also: :attr:`LP_COLOR_AWS_PROFILE`. .. versionadded:: 2.1 .. attribute:: LP_ENABLE_BATT :type: bool :value: 1 Display the status of the battery, if there is one, using color and marks. Add battery percentage colored with :attr:`LP_COLORMAP` if :attr:`LP_ALWAYS_DISPLAY_VALUES` is enabled. Will be disabled if ``acpi`` is not found on Linux, fails to read the Linux sysfs system, or ``pmset`` is not found on MacOS. See also: :attr:`LP_BATTERY_THRESHOLD`, :attr:`LP_MARK_BATTERY`, :attr:`LP_MARK_ADAPTER`, :attr:`LP_COLOR_CHARGING_ABOVE`, :attr:`LP_COLOR_CHARGING_UNDER`, :attr:`LP_COLOR_DISCHARGING_ABOVE`, and :attr:`LP_COLOR_DISCHARGING_UNDER`. .. attribute:: LP_ENABLE_BZR :type: bool :value: 1 Display VCS information inside `Bazaar `_ repositories. Will be disabled if ``bzr`` is not found. See also: :attr:`LP_MARK_BZR`. .. attribute:: LP_ENABLE_CHROOT :type: bool :value: 1 Display whether a *chroot* environment is active. .. versionadded: 2.2 .. attribute:: LP_ENABLE_CMAKE :type: bool :value: 0 Displays the current configuration of CMake, if the directory contains a `CMakecache.txt`. Displays the compiler, the generator and the build type, separated by :attr:`LP_MARK_CMAKE`. Will be disabled if ``cmake`` is not found. The compiler is displayed without its path. The generator is displayed without space, and some names are shortened (`Makefiles` as `Make` and `Visual Studio` as `VS`), so that, for instance: `Unix Makefiles` will be displayed as `UnixMake`. Both fields are randomly colored according to their hash. The common build type colors can be configured: - *Debug*, colored with :attr:`LP_COLOR_CMAKE_DEBUG` (magenta, by default), - *RelWithDebInfo*, colored with :attr:`LP_COLOR_CMAKE_RWDI` (blue, by default), - *Release*, colored with :attr:`LP_COLOR_CMAKE_RELEASE` (cyan, by default), - any other value would be colored according to its hash. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_COLOR :type: bool :value: 1 Use terminal formatting when displaying the prompt. .. note:: Not all formatting is correctly disabled if this option is disabled. Will be disabled if ``tput`` is not found. .. versionadded:: 2.0 .. attribute:: LP_ENABLE_CONTAINER :type: bool :value: 0 Indicate if the shell is running in a container environment (e.g. Docker, Podman, LXC, Singularity, systemd-:spelling:word:`nspawn`). .. note:: Containers may inherit some or even no variables from their parent shell, so this may behave inconsistently with different container software. For example, Docker does not inherit anything unless explicitly told to. Singularity in many configurations inherits most variables but shell functions and zsh hooks might not make it in. For full functionality, ``liquidprompt`` may need to be sourced inside the child container. See also: :attr:`LP_COLOR_CONTAINER`. .. versionadded:: 2.1 .. attribute:: LP_ENABLE_DETACHED_SESSIONS :type: bool :value: 1 Display the number of detached multiplexer sessions. Will be disabled if neither ``screen`` nor ``tmux`` are found. .. note:: This can be slow on some machines, and prompt speed can be greatly improved by disabling it. See also: :attr:`LP_COLOR_JOB_D`. .. versionadded:: 2.0 .. attribute:: LP_ENABLE_DIRSTACK :type: bool :value: 0 Display the size of the directory stack if it is greater than ``1``. See also: :attr:`LP_MARK_DIRSTACK` and :attr:`LP_COLOR_DIRSTACK`. .. versionadded:: 2.0 .. attribute:: LP_ENABLE_DISPLAY :type: bool :value: 1 Detect if the connection has X11 support. In the default theme, display a green ``@`` if it does; a yellow one if not. See also :attr:`LP_COLOR_X11_ON` and :attr:`LP_COLOR_X11_OFF`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_DISK :type: bool :value: 1 Display :attr:`LP_MARK_DISK` if the free space on the hard drive hosting the current directory goes below a threshold. Thresholds can be stated either: * as a percentage with :attr:`LP_DISK_THRESHOLD_PERC`, * or an absolute number *of kilobytes* with :attr:`LP_DISK_THRESHOLD`. Display will occur if one of the thresholds is met. If :attr:`LP_ALWAYS_DISPLAY_VALUES` is enabled, the prompt will show the available space along with :attr:`LP_MARK_DISK`, if disabled, it will show only the mark. The precision of the available space can be configured with :attr:`LP_DISK_PRECISION`. If :attr:`LP_DISPLAY_VALUES_AS_PERCENTS` is enabled, it will show the percentage, if it is disabled, it will show the absolute value in a human-readable form (i.e. with metric prefixed units). .. versionadded:: 2.2 .. attribute:: LP_ENABLE_ERROR :type: bool :value: 1 Display the last command error code if it is not ``0``. See also: :attr:`LP_COLOR_ERR`. .. versionadded:: 2.0 .. attribute:: LP_ENABLE_ERROR_MEANING :type: bool :value: 0 Display a guess on the last error meaning. .. note:: This only enable a limited subset of error codes, that are very probably in use on several systems. To enable more codes (and probably more false positives) see :attr:`LP_ENABLE_ERROR_MEANING_EXTENDED`. See also: :attr:`LP_COLOR_ERR`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_ERROR_MEANING_EXTENDED :type: bool :value: 0 Extends the set of interpreted error codes to a larger set of (POSIX) codes. .. note:: This use a reasonable set of error codes that are common on POSIX systems on x86 or ARM architectures (most notably from ``sysexit.h`` and ``signal.h``). But any software may use its own set of codes, and thus the guess may be wrong. This has no effect if :attr:`LP_ENABLE_ERROR_MEANING` is disabled. See also: :attr:`LP_COLOR_ERR`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_ENV_VARS :type: bool :value: 1 Display a user-defined set of environment variables. May show if the variables are unset, set, or their actual content. Watched variables should be added to the :attr:`LP_ENV_VARS` array. The resulting prompt section is configured by: - :attr:`LP_MARK_ENV_VARS_OPEN` - :attr:`LP_MARK_ENV_VARS_SEP` - :attr:`LP_MARK_ENV_VARS_CLOSE` - :attr:`LP_COLOR_ENV_VARS_SET` - :attr:`LP_COLOR_ENV_VARS_UNSET` .. versionadded:: 2.2 .. attribute:: LP_ENABLE_FOSSIL :type: bool :value: 1 Display VCS information inside `Fossil `_ repositories. Will be disabled if ``fossil`` is not found. See also: :attr:`LP_MARK_FOSSIL`. .. attribute:: LP_ENABLE_FQDN :type: bool :value: 0 .. deprecated:: 2.1 Use :attr:`LP_HOSTNAME_METHOD` set to "full" instead. Use the fully qualified domain name (FQDN) instead of the short hostname when the hostname is displayed. .. note:: This never functioned as intended, and would only show the FQDN if ``/etc/hostname`` contained the full domain name. For a more portable and reliable version, set :attr:`LP_HOSTNAME_METHOD` to `fqdn`. See also: :attr:`LP_HOSTNAME_ALWAYS`. .. attribute:: LP_ENABLE_GIT :type: bool :value: 1 Display VCS information inside `Git `_ repositories. Will be disabled if ``git`` is not found. See also: :attr:`LP_MARK_GIT`. .. attribute:: LP_ENABLE_HG :type: bool :value: 1 Display VCS information inside `Mercurial `_ repositories. Will be disabled if ``hg`` is not found. See also: :attr:`LP_MARK_HG` and :attr:`LP_HG_COMMAND`. .. attribute:: LP_ENABLE_HYPERLINKS :type: bool :value: 0 Adds clickable links to some elements of the prompt: - If locally connected, adds a link to each displayed elements of the path, using the ``file://`` scheme. - Within remote SSH connections, adds a link to each element of the path, but using the ``sftp://`` protocol, configured with the *current* username and hostname. - If the hostname is displayed within an SSH connection, adds a ``ssh://`` URL to it. The links take the form of a OSC-8 escape sequences containing an Uniform Resource Locator, which should be interpreted by the terminal emulator. If your terminal emulator does not support OSC-8, it may display escapement garbage. As not all terminal emulator support links, this feature is disabled by default. .. warning:: Your system should be configured to handle the aforementioned link schemes. If nothing happen when you click on the link, or if the wrong application is used, there is a configuration problem on your system or with your terminal emulator (not with Liquid Prompt). .. note:: Liquid Prompt cannot possibly follow complex remote connections. Remote links are thus configured with the *current* username, and the *current* fully qualified domain name, as ``sftp://@/``. It is possible that this URL does not work the same way than a manual connection. For instance, if you proxy jumped (i.e. if you jumped from one connection to the other), and/or you logged in with another user, and/or used SSH aliases, then the links probably won't work the way you may expect. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_JOBS :type: bool :value: 1 Display the number of running and sleeping shell jobs. See also: :attr:`LP_COLOR_JOB_R` and :attr:`LP_COLOR_JOB_Z`. .. attribute:: LP_ENABLE_KUBECONTEXT :type: bool :value: 0 Display the current `Kubernetes `_ `context`_. .. _`context`: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/ See also: :attr:`LP_ENABLE_KUBE_NAMESPACE`, :attr:`LP_DELIMITER_KUBECONTEXT_PREFIX`, :attr:`LP_DELIMITER_KUBECONTEXT_SUFFIX`, :attr:`LP_COLOR_KUBECONTEXT`, and :attr:`LP_MARK_KUBECONTEXT`. .. versionadded:: 2.1 .. attribute:: LP_ENABLE_KUBE_NAMESPACE :type: bool :value: 0 Display the current `Kubernetes `_ default `namespace`_ in the current context. .. _`namespace`: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#setting-the-namespace-preference See also: :attr:`LP_ENABLE_KUBECONTEXT`, :attr:`LP_DELIMITER_KUBECONTEXT_PREFIX`, :attr:`LP_DELIMITER_KUBECONTEXT_SUFFIX`, :attr:`LP_COLOR_KUBECONTEXT`, and :attr:`LP_MARK_KUBECONTEXT`. .. versionadded:: 2.1 .. attribute:: LP_ENABLE_LOAD :type: bool :value: 1 Display the load average over the past 1 minutes when above the threshold. See also: :attr:`LP_LOAD_THRESHOLD`, :attr:`LP_LOAD_CAP`, :attr:`LP_MARK_LOAD`, :attr:`LP_ALWAYS_DISPLAY_VALUES`, and :attr:`LP_COLORMAP`. :attr:`LP_MARK_LOAD`, :attr:`LP_PERCENTS_ALWAYS`, and :attr:`LP_COLORMAP`. .. attribute:: LP_ENABLE_MODULES :type: bool :value: 1 Display the currently loaded `Modules `_. See also: * :attr:`LP_ENABLE_MODULES_VERSIONS`, * :attr:`LP_ENABLE_MODULES_HASHCOLOR`, * :attr:`LP_COLOR_MODULES`, * :attr:`LP_MARK_MODULES_OPEN`, * :attr:`LP_MARK_MODULES_SEP`, * :attr:`LP_MARK_MODULES_CLOSE`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_MODULES_VERSIONS :type: bool :value: 1 Display the currently loaded modules' versions, after their names (separated by a slash, as in the ``module list`` command). If disabled, only the name of the module is displayed. See :attr:`LP_ENABLE_MODULES`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_MODULES_HASHCOLOR :type: bool :value: 0 If enabled, each item in the modules section will be randomly colored, according to its hash, instead of using :attr:`LP_COLOR_MODULES`. See :attr:`LP_ENABLE_MODULES`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_MULTIPLEXER :type: bool :value: 1 Allows getting the name of the current multiplexer (*screen* or *tmux*), if any. If set to ``0``, also disables: * :attr:`LP_COLOR_IN_MULTIPLEXER`, * :attr:`LP_MARK_MULTIPLEXER_OPEN` and :attr:`LP_MARK_MULTIPLEXER_CLOSE`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_NODE_VENV :type: bool :value: 0 Display the currently activated nodeenv_ or NVM_ virtual environment. See also: :attr:`LP_COLOR_NODE_VENV`. .. _nodeenv: https://ekalinin.github.io/nodeenv/ .. _NVM: https://github.com/nvm-sh/nvm .. versionadded:: 2.1 .. attribute:: LP_ENABLE_OS :type: bool :value: 0 Display information about the current Operating System. Degree of details is controlled by: - :attr:`LP_ENABLE_OS_ARCH` - :attr:`LP_ENABLE_OS_FAMILY` - :attr:`LP_ENABLE_OS_KERNEL` - :attr:`LP_ENABLE_OS_DISTRIB` - :attr:`LP_ENABLE_OS_VERSION` .. note:: As of now, only Linux may have detailed information about the distribution and version. See also :attr:`LP_MARK_OS` and :attr:`LP_MARK_OS_SEP` for configuring the appearance. If no replacement string is provided with :attr:`LP_MARK_OS`, each item will be randomly colored, according to its hash. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_OS_ARCH :type: bool :value: 0 Display the processor architecture of the current OS. See :attr:`LP_ENABLE_OS`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_OS_DISTRIB :type: bool :value: 0 Display the current Linux distribution. See :attr:`LP_ENABLE_OS`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_OS_FAMILY :type: bool :value: 0 Display the family of the current OS (UNIX, BSD, GNU, or Windows). See :attr:`LP_ENABLE_OS`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_OS_KERNEL :type: bool :value: 1 Display the name of the kernel type for the current OS. This may be "Linux", "FreeBSD", "SunOS", "Darwin", "Cygwin", "MSYS", "MinGW", "OpenBSD", "DragonFly". See :attr:`LP_ENABLE_OS`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_OS_VERSION :type: bool :value: 1 Display the version "codename" of the current Linux distribution. See :attr:`LP_ENABLE_OS`. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_PATH :type: bool :value: 1 Display the current working directory. .. versionadded:: 2.2 Before this version, this feature was always enabled. .. attribute:: LP_ENABLE_PERL_VENV :type: bool :value: 1 Display the currently activated PERLBREW_ or PLENV_ virtual environment. See also: :attr:`LP_COLOR_PERL_VENV`. .. _PERLBREW: https://perlbrew.pl/ .. _PLENV: https://github.com/tokuhirom/plenv .. versionadded:: 2.2 .. attribute:: LP_ENABLE_PERM :type: bool :value: 1 Display a colored :attr:`LP_MARK_PERM` in the prompt to show when the user does not have write permission to the current directory. See also: :attr:`LP_COLOR_WRITE` and :attr:`LP_COLOR_NOWRITE`. .. attribute:: LP_ENABLE_PROXY :type: bool :value: 1 Display a :attr:`LP_MARK_PROXY` mark when an HTTP proxy is detected. See also: :attr:`LP_COLOR_PROXY`. .. attribute:: LP_ENABLE_RAM :type: bool :value: 1 Display a :attr:`LP_MARK_RAM` mark when the available amount of Random Access Memory goes below a threshold. Thresholds can be stated either: * as a percentage with :attr:`LP_RAM_THRESHOLD_PERC`, * or an absolute number *of kilobytes* with :attr:`LP_RAM_THRESHOLD`. Display will occur if one of the thresholds is met. If :attr:`LP_ALWAYS_DISPLAY_VALUES` is enabled, the prompt will show the available space along with :attr:`LP_MARK_RAM`, if disabled, it will show only the mark. The precision of the displayed available space can be configured with :attr:`LP_RAM_PRECISION`. If :attr:`LP_DISPLAY_VALUES_AS_PERCENTS` is enabled, it will show the percentage, if it is disabled, it will show the absolute value in a human-readable form (i.e. with metric prefixed units). .. versionadded:: 2.2 .. attribute:: LP_ENABLE_RUBY_VENV :type: bool :value: 1 Display the currently activated RVM_ or RBENV_ virtual environment. See also: :attr:`LP_RUBY_RVM_PROMPT_OPTIONS` and :attr:`LP_COLOR_RUBY_VENV`. .. _RVM: https://rvm.io/ .. _RBENV: https://github.com/rbenv/rbenv .. versionadded:: 2.1 .. attribute:: LP_ENABLE_RUNTIME :type: bool :value: 1 Display runtime of the previous command if over :attr:`LP_RUNTIME_THRESHOLD`. See also: :attr:`LP_COLOR_RUNTIME`. .. attribute:: LP_ENABLE_RUNTIME_BELL :type: bool :value: 0 Ring the terminal bell if the previous command ran longer than :attr:`LP_RUNTIME_BELL_THRESHOLD`. .. versionadded:: 1.12 .. attribute:: LP_ENABLE_SCLS :type: bool :value: 1 Display the currently activated `Red Hat Software Collection`_. See also: :attr:`LP_COLOR_VIRTUALENV`. .. _`Red Hat Software Collection`: https://developers.redhat.com/products/softwarecollections/overview .. attribute:: LP_ENABLE_SCREEN_TITLE :type: bool :value: 0 Set the terminal title while in a terminal multiplexer. :attr:`LP_ENABLE_TITLE` must be enabled to have any effect. .. attribute:: LP_ENABLE_SHLVL :type: bool :value: 1 Show the value of ``$SHLVL``, which is the number of nested shells, if the value meets the threshold. For example, if one runs ``bash`` inside their shell, it will open a new shell inside their current shell, and this will display "2". See also: :attr:`LP_SHLVL_THRESHOLD`, :attr:`LP_MARK_SHLVL`, and :attr:`LP_COLOR_SHLVL`. .. versionadded:: 2.1 .. attribute:: LP_ENABLE_SHORTEN_PATH :type: bool :value: 1 Use the shorten path feature if the path is too long to fit in the prompt line. See also: :attr:`LP_PATH_METHOD`, :attr:`LP_PATH_LENGTH`, :attr:`LP_PATH_KEEP`, :attr:`LP_PATH_CHARACTER_KEEP`, and :attr:`LP_MARK_SHORTEN_PATH`. .. attribute:: LP_ENABLE_SSH_COLORS :type: bool :value: 0 Replace :attr:`LP_COLOR_SSH` with a color based on the hash of the hostname. This can give each host a "color feel" to help distinguish them. See also: :attr:`LP_HOSTNAME_ALWAYS`. .. attribute:: LP_ENABLE_SUDO :type: bool :value: 0 Check if the user has valid ``sudo`` credentials, and display an indicating mark or color. Will be disabled if ``sudo`` is not found. .. warning:: Each evocation of ``sudo`` by default writes to the :spelling:word:`syslog`, and this will run ``sudo`` once each prompt, unless you have `NOPASSWD` powers. This is likely to make your sysadmin hate you. See also: :attr:`LP_COLOR_MARK_SUDO`. .. attribute:: LP_ENABLE_SVN :type: bool :value: 1 Display VCS information inside `Subversion `_ repositories. Will be disabled if ``svn`` is not found. See also: :attr:`LP_MARK_SVN`. .. attribute:: LP_ENABLE_TEMP :type: bool :value: 1 Display the highest system temperature if above the threshold. Will be disabled if neither ``sensors`` nor ``acpi`` are found, or fails to read from the Linux sysfs system. See also: :attr:`LP_TEMP_THRESHOLD`, :attr:`LP_MARK_TEMP`, :attr:`LP_COLORMAP`, and :attr:`LP_TEMP_SYSFS_IGNORE_FILES`. .. attribute:: LP_ENABLE_TERRAFORM :type: bool :value: 0 Display the currently activated `Terraform`_ workspace. See also: :attr:`LP_COLOR_TERRAFORM`. .. _Terraform: https://www.terraform.io/docs/language/index.html .. versionadded:: 2.1 .. attribute:: LP_ENABLE_TIME :type: bool :value: 0 Displays the time at which the prompt was shown. The format can be configured with :attr:`LP_TIME_FORMAT`. See also: :attr:`LP_TIME_ANALOG` and :attr:`LP_COLOR_TIME`. .. attribute:: LP_ENABLE_TITLE :type: bool :value: 0 Set the terminal title to part or all of the prompt string, depending on the theme. Must be enabled to be able to set the manual title with :func:`lp_title`. .. warning:: This may not work properly on exotic terminals. Please report any issues. .. attribute:: LP_ENABLE_TITLE_COMMAND :type: bool :value: 1 Postpend the currently running command to the terminal title while the command is running. :attr:`LP_ENABLE_TITLE` must be enabled to have any effect. .. versionadded:: 2.1 .. attribute:: LP_ENABLE_TMUX_TITLE_PANES :type: bool :value: 1 Sets the title of the Tmux pane instead of the window. :attr:`LP_ENABLE_TITLE` and :attr:`LP_ENABLE_SCREEN_TITLE` must be enabled to have any effect. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_VCS_REMOTE :type: bool :value: 0 Enable the display of the remote repository in the VCS state section. If enabled, will display :attr:`LP_MARK_VCS_REMOTE`, followed by the remote repository name. In the default theme, if the remote repository has commits not pulled in the local branch, the mark will be showed in :attr:`LP_COLOR_COMMITS_BEHIND`. If the local repository has commits not pushed to the remote branch, the remote name is shown in :attr:`LP_COLOR_COMMITS`. If neither is the case, nothing will be shown. .. versionadded:: 2.2 .. attribute:: LP_ENABLE_VCS_ROOT :type: bool :value: 0 Enable VCS features when running as root. This is disabled by default for security. .. attribute:: LP_ENABLE_VIRTUALENV :type: bool :value: 1 Display the currently activated Python_ or Conda_ virtual environment. See also: :attr:`LP_COLOR_VIRTUALENV`. .. _Python: https://docs.python.org/tutorial/venv.html .. _Conda: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html .. attribute:: LP_ENABLE_WIFI_STRENGTH :type: bool :value: 0 Display an indicator if any wireless signal strength percentage is below :attr:`LP_WIFI_STRENGTH_THRESHOLD`. Also show the strength percentage if :attr:`LP_ALWAYS_DISPLAY_VALUES` is enabled. Both Linux and MacOS are supported. See also: :attr:`LP_MARK_WIFI` and :attr:`LP_COLORMAP`. .. versionadded:: 2.1 .. attribute:: LP_ENV_VARS :type: array :value: () The set of environment variables that the user wants to watch. Items should be a string with three space-separated elements of the form `" [ ]"`, containing: - the name of the variable to watch, - the string to display if the variable is set, - (optionally) the string to display if the variable is not set. The string used when the variable is set may contain the ``%s`` mark, which is replaced by the actual content of the variable. For example:: LP_ENV_VARS=( # Display "V" if VERBOSE is set, nothing if it's unset. "VERBOSE V" # Display the name of the desktop session, if set, T if unset. "DESKTOP_SESSION %s T" # Display "ed:" followed the name of the default editor, nothing if unset. "EDITOR ed:%s" ) See also :attr:`LP_ENABLE_ENV_VARS`. The resulting prompt section is configured by: - :attr:`LP_MARK_ENV_VARS_OPEN` - :attr:`LP_MARK_ENV_VARS_SEP` - :attr:`LP_MARK_ENV_VARS_CLOSE` - :attr:`LP_COLOR_ENV_VARS_SET` - :attr:`LP_COLOR_ENV_VARS_UNSET` .. attribute:: LP_HG_COMMAND :type: string :value: "hg" The command to use for Mercurial commands. Can be used to replace ``hg`` with ``rhg`` or ``chg``. See also: :attr:`LP_ENABLE_HG` and :attr:`LP_MARK_HG`. .. versionadded:: 2.1 .. attribute:: LP_HIDE_EMPTY_ERROR :type: bool :value: 1 Hide the error code returned by a command if the new prompt is displayed after the user hits Ctrl-C or submits an empty command (i.e. empty string or a comment). See also: :attr:`LP_ENABLE_ERROR`. .. versionadded:: 2.2 .. attribute:: LP_HOSTNAME_ALWAYS :type: int :value: 0 Determine when the hostname should be displayed. Valid values are: * ``0`` - show the hostname, except when locally connected * ``1`` - always show the hostname * ``-1`` - never show the hostname See also: :attr:`LP_COLOR_HOST` and :attr:`LP_ENABLE_SSH_COLORS`. .. attribute:: LP_HOSTNAME_METHOD :type: string :value: "short" Determine the method for displaying the hostname. * **short**: show the first section of the hostname, what is before the first dot. Equal to ``\h`` in Bash or ``%m`` in Zsh. * **full**: show the full hostname, without any domain name. Equal to ``\H`` in Bash or ``%M`` in Zsh. * **fqdn**: show the fully qualified domain name, if it exists. Defaults to **full** if not. * **pretty**: show the pretty hostname, also called "machine display name". Defaults to **full** if one does not exist. See also: :attr:`LP_HOSTNAME_ALWAYS`. .. versionadded:: 2.1 .. attribute:: LP_PERCENTS_ALWAYS :type: bool :value: 1 .. deprecated:: 2.2 Use :attr:`LP_ALWAYS_DISPLAY_VALUES` and :attr:`LP_DISPLAY_VALUES_AS_PERCENTS` instead. Display the actual values of load, batteries, and wifi signal strength along with their corresponding marks. Disable to only print the colored marks. See also: :attr:`LP_ENABLE_LOAD`, :attr:`LP_ENABLE_BATT`, :attr:`LP_ENABLE_WIFI_STRENGTH`. .. attribute:: LP_RUBY_RVM_PROMPT_OPTIONS :type: array :value: (i v g s) An array of single letter switches to customize the `RVM prompt`_ output. Will only have an effect if :attr:`LP_ENABLE_RUBY_VENV` is enabled and you are using RVM (i.e. no effect with RBENV). .. _`RVM prompt`: https://rvm.io/workflow/prompt .. versionadded:: 2.1 .. attribute:: LP_TEMP_SYSFS_IGNORE_FILES :type: array :value: () Paths to files in the sysfs interface that should be ignored when reading temperature sensors. A path can include globs. See also :attr:`LP_ENABLE_TEMP`. .. versionadded:: 2.2 .. attribute:: LP_TIME_ANALOG :type: bool :value: 0 Shows the time using an analog clock instead of numeric values. The analog clock is "accurate" to the nearest half hour. You must have a Unicode capable terminal and a font with the "CLOCK" characters (U+1F550 - U+1F567). Will only have an effect if :attr:`LP_ENABLE_TIME` is enabled. .. attribute:: LP_USER_ALWAYS :type: int :value: 1 Determine when the username should be displayed. Valid values are: * ``0`` - show the username, except when the user is the login user * ``1`` - always show the username * ``-1`` - never show the username See also: :attr:`LP_COLOR_USER_LOGGED`, :attr:`LP_COLOR_USER_ALT`, and :attr:`LP_COLOR_USER_ROOT`. .. versionchanged:: 2.0 The ``-1`` option was added. Thresholds ---------- .. attribute:: LP_BATTERY_THRESHOLD :type: int :value: 75 The percentage threshold that the battery level needs to fall below before it will be displayed in :attr:`LP_COLOR_CHARGING_UNDER` or :attr:`LP_COLOR_DISCHARGING_UNDER` color. Otherwise, it will be displayed in :attr:`LP_COLOR_CHARGING_ABOVE` or :attr:`LP_COLOR_DISCHARGING_ABOVE` color. :attr:`LP_ENABLE_BATT` must be enabled to have any effect. .. attribute:: LP_DISK_PRECISION :type: int :value: 2 Control the numbers of decimals when displaying the absolute available space of the current hard drive. If set to 0, don't display decimals. If set to 1 or 2, display decimals. See :attr:`LP_ENABLE_DISK`, :attr:`LP_ALWAYS_DISPLAY_VALUES`, and :attr:`LP_DISPLAY_VALUES_AS_PERCENTS`. .. versionadded:: 2.2 .. attribute:: LP_DISK_THRESHOLD :type: int :value: 100000 Display something if the available space on the hard drive hosting the current directory goes below this absolute threshold *in kilobytes*. If the file system is smaller than :attr:`LP_DISK_THRESHOLD`, this check is skipped. The threshold for disk can also be set with :attr:`LP_DISK_THRESHOLD_PERC`, the first one to be reached triggering the display. See also :attr:`LP_ENABLE_DISK`. .. versionadded:: 2.2 .. attribute:: LP_DISK_THRESHOLD_PERC :type: int :value: 10 Display something if the available space on the hard drive hosting the current directory goes below this percentage. The threshold for disk can also be set with :attr:`LP_DISK_THRESHOLD`, the first one to be reached triggering the display.. See also :attr:`LP_ENABLE_DISK`. .. versionadded:: 2.2 .. attribute:: LP_LOAD_CAP :type: float :value: 2.0 The value for load average per CPU to display with the max color scaling. Values above this number will still be displayed, but the colors will not increase in intensity. :attr:`LP_ENABLE_LOAD` must be enabled to have any effect. See also: :attr:`LP_COLORMAP`. .. versionadded:: 2.0 .. attribute:: LP_LOAD_THRESHOLD :type: float :value: 0.60 Display the load average per CPU when above this threshold. For historical reasons, this number must have a decimal point ('.'), or it will be treated as a percentage. :attr:`LP_ENABLE_LOAD` must be enabled to have any effect. .. versionchanged:: 2.0 Accepts float values of actual load averages. Integer values of :spelling:word:`centiload` are still accepted, but deprecated. .. attribute:: LP_RAM_PRECISION :type: int :value: 2 Control the numbers of decimals when displaying the absolute available space of the current system RAM. If set to 0, don't display decimals. If set to 1 or 2, display decimals. See :attr:`LP_ENABLE_RAM`, :attr:`LP_ALWAYS_DISPLAY_VALUES`, and :attr:`LP_DISPLAY_VALUES_AS_PERCENTS`. .. versionadded:: 2.2 .. attribute:: LP_RAM_THRESHOLD :type: int :value: 100000 Display something if the available RAM space goes below this absolute threshold *in kilobytes*. The threshold for RAM can also be set with :attr:`LP_RAM_THRESHOLD_PERC`, the first one to be reached triggering the display. See also :attr:`LP_ENABLE_RAM`. .. versionadded:: 2.2 .. attribute:: LP_RAM_THRESHOLD_PERC :type: int :value: 10 Display something if the available RAM space goes below this percentage. The threshold for RAM can also be set with :attr:`LP_RAM_THRESHOLD`, the first one to be reached triggering the display.. See also :attr:`LP_ENABLE_RAM`. .. versionadded:: 2.2 .. attribute:: LP_RUNTIME_THRESHOLD :type: int :value: 2 Time in seconds that a command must run longer than for its runtime to be displayed. :attr:`LP_ENABLE_RUNTIME` must be enabled to have any effect. .. attribute:: LP_RUNTIME_BELL_THRESHOLD :type: int :value: 10 Time in seconds that a command must run longer than for the terminal bell to be rung. :attr:`LP_ENABLE_RUNTIME_BELL` must be enabled to have any effect. .. versionadded:: 1.12 .. attribute:: LP_SHLVL_THRESHOLD :type: int :value: 2 Number of nested shells before the shell level is shown. See also: :attr:`LP_ENABLE_SHLVL`, :attr:`LP_MARK_SHLVL`, and :attr:`LP_COLOR_SHLVL`. .. versionadded:: 2.2 .. attribute:: LP_TEMP_THRESHOLD :type: int :value: 60 Display the highest system temperature when the temperature is above this threshold (in degrees Celsius). :attr:`LP_ENABLE_TEMP` must be enabled to have any effect. .. attribute:: LP_WIFI_STRENGTH_THRESHOLD :type: int :value: 40 Display the lowest wireless signal strength when the strength percentage is below this threshold. :attr:`LP_ENABLE_WIFI_STRENGTH` must be enabled to have any effect. .. versionadded:: 2.1 Marks ----- .. attribute:: LP_MARK_ADAPTER :type: string :value: "⏚" Mark used for battery display when charging. See also: :attr:`LP_ENABLE_BATT`. .. attribute:: LP_MARK_BATTERY :type: string :value: "⌁" Mark used for battery display when on battery power. See also: :attr:`LP_ENABLE_BATT`. .. attribute:: LP_MARK_BRACKET_CLOSE :type: string :value: "]" Mark used for closing core prompt brackets. Used by the default theme for enclosing user, host, and current working directory sections. See also: :attr:`LP_MARK_BRACKET_OPEN`, :attr:`LP_MARK_MULTIPLEXER_CLOSE`. .. versionchanged:: 2.2 Can be disabled by :attr:`LP_ENABLE_MULTIPLEXER`. .. attribute:: LP_MARK_BRACKET_OPEN :type: string :value: "[" Mark used for opening core prompt brackets. Used by the default theme for enclosing user, host, and current working directory sections. See also: :attr:`LP_MARK_BRACKET_CLOSE`, :attr:`LP_MARK_MULTIPLEXER_OPEN`. .. versionchanged:: 2.2 Can be disabled by :attr:`LP_ENABLE_MULTIPLEXER`. .. attribute:: LP_MARK_BZR :type: string :value: "⚯" Mark used instead of :attr:`LP_MARK_DEFAULT` to indicate that the current directory is inside of a Bazaar repository. See also: :attr:`LP_ENABLE_BZR`. .. attribute:: LP_MARK_CMAKE :type: string :value: ":" Separator used for fields of :attr:`LP_ENABLE_CMAKE`. .. versionadded:: 2.2 .. attribute:: LP_MARK_DEFAULT :type: string :value: "$" (Bash) or "%" (Zsh) Mark used to indicate that the prompt is ready for user input, unless some other context overrides it, like a VCS repository. .. attribute:: LP_MARK_DEV_CLOSE :type: string :value: ">" Closing of the "development tools" section. .. versionadded:: 2.2 .. attribute:: LP_MARK_DEV_MID :type: string :value: "|" Separator between elements of the "development tools" section. .. versionadded:: 2.2 .. attribute:: LP_MARK_DEV_OPEN :type: string :value: "<" Opening of the "development tools" section. .. versionadded:: 2.2 .. attribute:: LP_MARK_DIRSTACK :type: string :value: "⚞" Mark used to indicate the size of the directory stack. Here are some alternative marks you might like: ⚟ = ≡ ≣ See also: :attr:`LP_ENABLE_DIRSTACK` and :attr:`LP_COLOR_DIRSTACK`. .. versionadded:: 2.0 .. attribute:: LP_MARK_DISABLED :type: string :value: "⌀" Mark used instead of :attr:`LP_MARK_DEFAULT` to indicate that the current directory is disabled for VCS display through :attr:`LP_DISABLED_VCS_PATHS`. .. attribute:: LP_MARK_DISK :type: string :value: "🖴 " Mark used to indicate that the available disk space is too low. See :attr:`LP_ENABLE_DISK`. .. versionadded:: 2.2 .. attribute:: LP_MARK_ENV_VARS_OPEN :type: string :value: "(" Mark used to start the user-defined environment variables watch list. See also: - :attr:`LP_ENABLE_ENV_VARS` - :attr:`LP_ENV_VARS` - :attr:`LP_MARK_ENV_VARS_SEP` - :attr:`LP_MARK_ENV_VARS_CLOSE` - :attr:`LP_COLOR_ENV_VARS_SET` - :attr:`LP_COLOR_ENV_VARS_UNSET` .. versionadded:: 2.2 .. attribute:: LP_MARK_ENV_VARS_SEP :type: string :value: " " Mark used to separate items of the user-defined environment variables watch list. See also: - :attr:`LP_ENABLE_ENV_VARS` - :attr:`LP_ENV_VARS` - :attr:`LP_MARK_ENV_VARS_OPEN` - :attr:`LP_MARK_ENV_VARS_CLOSE` - :attr:`LP_COLOR_ENV_VARS_SET` - :attr:`LP_COLOR_ENV_VARS_UNSET` .. versionadded:: 2.2 .. attribute:: LP_MARK_ENV_VARS_CLOSE :type: string :value: ")" Mark used to end the user-defined environment variables watch list. See also: - :attr:`LP_ENABLE_ENV_VARS` - :attr:`LP_ENV_VARS` - :attr:`LP_MARK_ENV_VARS_OPEN` - :attr:`LP_MARK_ENV_VARS_SEP` - :attr:`LP_COLOR_ENV_VARS_SET` - :attr:`LP_COLOR_ENV_VARS_UNSET` .. versionadded:: 2.2 .. attribute:: LP_MARK_FOSSIL :type: string :value: "⌘" Mark used instead of :attr:`LP_MARK_DEFAULT` to indicate that the current directory is inside of a Fossil repository. See also: :attr:`LP_ENABLE_FOSSIL`. .. attribute:: LP_MARK_GIT :type: string :value: "±" Mark used instead of :attr:`LP_MARK_DEFAULT` to indicate that the current directory is inside of a Git repository. See also: :attr:`LP_ENABLE_GIT`. .. attribute:: LP_MARK_HG :type: string :value: "☿" Mark used instead of :attr:`LP_MARK_DEFAULT` to indicate that the current directory is inside of a Mercurial repository. See also: :attr:`LP_ENABLE_HG` and :attr:`LP_HG_COMMAND`. .. attribute:: LP_MARK_JOBS_SEPARATOR :type: string :value: "/" Mark used to separate elements of :attr:`LP_JOBS`. See also :attr:`LP_ENABLE_JOBS`. .. versionadded:: 2.2 .. attribute:: LP_MARK_KUBECONTEXT :type: string :value: "⎈" Mark used to prefix the current Kubernetes context. Used to visually distinguish the Kubernetes context from other context fields like the Python virtual environment (see :attr:`LP_ENABLE_VIRTUALENV`) and the Red Hat Software Collection (see :attr:`LP_ENABLE_SCLS`). The display of Unicode characters varies among Terminal and Font settings, so you might try alternative marks. Single symbol alternatives to the default `⎈` (U+2388, Helm Symbol) are `☸` (U+2638, Wheel of :spelling:word:`Dharma`) or `κ` (U+03BA, Greek Small Letter Kappa). See also: :attr:`LP_ENABLE_KUBECONTEXT`. .. versionadded:: 2.1 .. attribute:: LP_MARK_LOAD :type: string :value: "⌂" Mark used before displaying load average. See also: :attr:`LP_ENABLE_LOAD`. .. attribute:: LP_MARK_MODULES_OPEN :type: string :value: "" Mark used before displaying loaded modules. See also: :attr:`LP_ENABLE_MODULES`. .. attribute:: LP_MARK_MODULES_CLOSE :type: string :value: "" Mark used after displaying loaded modules. See also: :attr:`LP_ENABLE_MODULES`. .. attribute:: LP_MARK_MODULES_SEP :type: string :value: ":" Mark used between loaded modules. See also: :attr:`LP_ENABLE_MODULES`. .. attribute:: LP_MARK_MULTIPLEXER_CLOSE :type: string :value: $LP_MARK_BRACKET_CLOSE Mark used for closing core prompt brackets. Used by the default theme when inside of a multiplexer. See also: :attr:`LP_MARK_MULTIPLEXER_OPEN`, :attr:`LP_MARK_BRACKET_CLOSE`. .. versionadded:: 2.1 .. versionchanged:: 2.2 Can be disabled by :attr:`LP_ENABLE_MULTIPLEXER`. .. attribute:: LP_MARK_MULTIPLEXER_OPEN :type: string :value: $LP_MARK_BRACKET_OPEN Mark used for opening core prompt brackets. Used by the default theme when inside of a multiplexer. See also: :attr:`LP_MARK_MULTIPLEXER_CLOSE`, :attr:`LP_MARK_BRACKET_OPEN`. .. versionadded:: 2.1 .. versionchanged:: 2.2 Can be disabled by :attr:`LP_ENABLE_MULTIPLEXER`. .. attribute:: LP_MARK_OS :type: array :value: () A list of pair of strings to be replaced by another string when displaying information about the OS. Each pair in the list configures the match, then the replacement string. For instance, if you set ``LP_MARK_OS=("Linux" "L")`` and ``LP_ENABLE_OS=1 ; LP_ENABLE_OS_FAMILY=1``, then any occurrence of "Linux" will be replaced by an "L" in the OS section. It is possible to use presets colors in the replacement string (see the :ref:`Colors` section below). Note that if a replacement occurs, the result will *not* be colored automatically. For example, to shorten known names, you can use the following configuration (if your font supports those characters): .. code-block:: shell LP_MARK_OS=( # Arch "x86_64" "${BLUE}x64${NO_COL}" "i386" "i3" "i686" "i6" "aarch64" "${GREEN}a64${NO_COL}" # Families "BSD" "${RED}BSD${NO_COL}" "Windows" "🪟" "Unix" "U" "GNU" "🐮" # Kernels "FreeBSD" "👹" "DragonFly" "🦋" "OpenBSD" "🐡" "Darwin" "🍎" "SunOS" "${BOLD_YELLOW}☀${NO_COL}" "Cygwin" "🦢" "MSYS" "M" "MinGW" "GW" "Linux" "🐧" ) See :attr:`LP_ENABLE_OS`. .. versionadded:: 2.2 .. attribute:: LP_MARK_OS_SEP :type: string :value: "/" The character used to separate items of the OS section. See :attr:`LP_ENABLE_OS`. .. versionadded:: 2.2 .. attribute:: LP_MARK_PERM :type: string :value: ":" Mark used by default separate hostname and current working directory, and is colored to indicate user permissions on the current directory. Is still used (without colors) if :attr:`LP_ENABLE_PERM` is disabled. .. versionadded:: 1.12 .. attribute:: LP_MARK_PROXY :type: string :value: "↥" Mark used to indicate a proxy is active. See also: :attr:`LP_ENABLE_PROXY`. .. attribute:: LP_MARK_RAM :type: string :value: M Mark used before displaying available Random Access Memory. See :attr:`LP_ENABLE_RAM`. .. versionadded:: 2.2 .. attribute:: LP_MARK_SHLVL :type: string :value: "└" Mark used to indicate the shell is inside another shell. See also: :attr:`LP_ENABLE_SHLVL`, :attr:`LP_SHLVL_THRESHOLD`, and :attr:`LP_COLOR_SHLVL`. .. versionadded:: 2.1 .. attribute:: LP_MARK_SHORTEN_PATH :type: string :value: " … " Mark used to indicate a portion of the path was hidden to save space. Not all shortening methods use this mark, some only use :attr:`LP_COLOR_PATH_SHORTENED`. See also: :attr:`LP_ENABLE_SHORTEN_PATH`, :attr:`LP_PATH_METHOD`. .. attribute:: LP_MARK_STASH :type: string :value: "+" Mark used to indicate at least one stash or shelve exists in the current repository. .. attribute:: LP_MARK_SVN :type: string :value: "‡" Mark used instead of :attr:`LP_MARK_DEFAULT` to indicate that the current directory is inside of a Subversion repository. See also: :attr:`LP_ENABLE_SVN`. .. attribute:: LP_MARK_TEMP :type: string :value: "θ" Mark used before displaying temperature. See also: :attr:`LP_ENABLE_TEMP`. .. attribute:: LP_MARK_UNTRACKED :type: string :value: "*" Mark used to indicate untracked or extra files exist in the current repository. .. attribute:: LP_MARK_VCS_REMOTE :type: string :value: "⭚" Mark used to indicate the VCS remote repository name and status. See :attr:`LP_ENABLE_VCS_REMOTE`. .. versionadded:: 2.2 .. attribute:: LP_MARK_VCSH :type: string :value: "|" Mark used instead of :attr:`LP_MARK_DEFAULT` to indicate that the current directory is inside of a `VCSH `_ repository. Since VCSH repositories are Git repositories under the hood, :attr:`LP_MARK_GIT` is surrounded in this mark. .. attribute:: LP_MARK_WIFI :type: string :value: "📶" Mark used before displaying wireless signal strength. See also: :attr:`LP_ENABLE_WIFI_STRENGTH`. .. versionadded:: 2.1 .. _Colors: Colors ------ These color strings will be used without modification, so they need to be valid terminal escape sequences, either generated with :func:`lp_terminal_format` or using the ``$COLOR`` variables. Valid preset color variables are: * ``BOLD`` - bold formatting only. * ``BLACK`` * ``BOLD_GRAY`` - actually bold black * ``RED`` * ``BOLD_RED`` * ``GREEN`` * ``BOLD_GREEN`` * ``YELLOW`` * ``BOLD_YELLOW`` * ``BLUE`` * ``BOLD_BLUE`` * ``PURPLE`` or ``MAGENTA`` * ``BOLD_PURPLE``, ``BOLD_MAGENTA`` or ``PINK`` * ``CYAN`` * ``BOLD_CYAN`` * ``WHITE`` * ``BOLD_WHITE`` * ``WARN_RED`` - black foreground, red background * ``CRIT_RED`` - white foreground, red background * ``DANGER_RED`` - yellow foreground, red background .. attribute:: LP_COLORMAP :type: array :value: ( "" $GREEN $BOLD_GREEN $YELLOW $BOLD_YELLOW $RED $BOLD_RED $WARN_RED $CRIT_RED $DANGER_RED ) An array of colors that is used by the battery, load, temperature, and wireless signal strength features to indicate the severity level of their status. A normal or low status will use the first index, while the last index is the most severe. See also: :attr:`LP_ENABLE_BATT`, :attr:`LP_ENABLE_LOAD`, :attr:`LP_ENABLE_TEMP`, and :attr:`LP_ENABLE_WIFI_STRENGTH`. .. attribute:: LP_COLOR_AWS_PROFILE :type: string :value: $YELLOW Color used to display the current active AWS Profile. See also: :attr:`LP_ENABLE_AWS_PROFILE`. .. versionadded:: 2.1 .. attribute:: LP_COLOR_CHANGES :type: string :value: $RED Color used to indicate that the current repository is not clean, or in other words, has changes that have not been committed. .. attribute:: LP_COLOR_CHARGING_ABOVE :type: string :value: $GREEN Color used to indicate that the battery is charging and above the :attr:`LP_BATTERY_THRESHOLD`. See also: :attr:`LP_ENABLE_BATT`. .. attribute:: LP_COLOR_CHARGING_UNDER :type: string :value: $YELLOW Color used to indicate that the battery is charging and under the :attr:`LP_BATTERY_THRESHOLD`. See also: :attr:`LP_ENABLE_BATT`. .. attribute:: LP_COLOR_CMAKE_BUILD :type: string :value: $MAGENTA Color used to display the build type in the CMake segment. See :attr:`LP_ENABLE_CMAKE`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_CMAKE_C :type: string :value: $MAGENTA Color used to display the C compiler in the CMake segment. See :attr:`LP_ENABLE_CMAKE`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_CMAKE_CXX :type: string :value: $MAGENTA Color used to display the C++ compiler in the CMake segment. See :attr:`LP_ENABLE_CMAKE`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_CMAKE_DEBUG :type: string :value: $MAGENTA Color for the *Debug* build type of the CMake section. See also: :attr:`LP_COLOR_CMAKE_RWDI` and :attr:`LP_COLOR_CMAKE_RELEASE`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_CMAKE_RWDI :type: string :value: $BLUE Color for the *RelWithDebInfo* build type of the CMake section. See also: :attr:`LP_COLOR_CMAKE_DEBUG` and :attr:`LP_COLOR_CMAKE_RELEASE`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_CMAKE_RELEASE :type: string :value: $CYAN Color for the *Release* build type of the CMake section. See also: :attr:`LP_COLOR_CMAKE_DEBUG` and :attr:`LP_COLOR_CMAKE_RWDI`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_COMMITS_BEHIND :type: string :value: $BOLD_RED Color used to indicate that the current repository has a remote tracking branch that has commits that the local branch does not. May be used by :attr:`LP_ENABLE_VCS_REMOTE`. .. attribute:: LP_COLOR_COMMITS :type: string :value: $YELLOW Color used to indicate that the current repository has commits on the local branch that the remote tracking branch does not. Also used to color :attr:`LP_MARK_STASH` and :attr:`LP_MARK_VCS_REMOTE`. .. attribute:: LP_COLOR_CONTAINER :type: string :value: $BOLD_BLUE Color used to indicate that the current shell is running in a container. .. versionadded:: 2.1 .. attribute:: LP_COLOR_DIFF :type: string :value: $PURPLE Color used to indicate that the current repository has lines that have been changed since the last commit. .. attribute:: LP_COLOR_DIRSTACK :type: string :value: $BOLD_YELLOW Color used to indicate the size of the directory stack. See also: :attr:`LP_ENABLE_DIRSTACK` and :attr:`LP_MARK_DIRSTACK`. .. versionadded:: 2.0 .. attribute:: LP_COLOR_DISCHARGING_ABOVE :type: string :value: $YELLOW Color used to indicate that the battery is discharging and above the :attr:`LP_BATTERY_THRESHOLD`. See also: :attr:`LP_ENABLE_BATT`. .. attribute:: LP_COLOR_DISCHARGING_UNDER :type: string :value: $RED Color used to indicate that the battery is discharging and above the :attr:`LP_BATTERY_THRESHOLD`. See also: :attr:`LP_ENABLE_BATT`. .. attribute:: LP_COLOR_DISK :type: string :value: $BOLD_RED Color used for displaying information about the hard drive hosting the current directory. See also :attr:`LP_COLOR_DISK_UNITS`, :attr:`LP_ENABLE_DISK`, :attr:`LP_ALWAYS_DISPLAY_VALUES`, and :attr:`LP_PERCENTS_ALWAYS`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_DISK_UNITS :type: string :value: $RED Color used for displaying the unit of the available space on the hard drive hosting the current directory. See also :attr:`LP_COLOR_DISK`, :attr:`LP_ENABLE_DISK`, :attr:`LP_ALWAYS_DISPLAY_VALUES`, and :attr:`LP_PERCENTS_ALWAYS`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_ERR :type: string :value: $PURPLE Color used to indicate the last command exited with a non-zero return code. See also: :attr:`LP_ENABLE_ERROR`. .. attribute:: LP_COLOR_ENV_VARS_SET :type: string :value: $BOLD_BLUE Color of the environment variables that are set, in the user-defined watch list. See also: - :attr:`LP_ENABLE_ENV_VARS` - :attr:`LP_ENV_VARS` - :attr:`LP_COLOR_ENV_VARS_UNSET` - :attr:`LP_MARK_ENV_VARS_OPEN` - :attr:`LP_MARK_ENV_VARS_SEP` - :attr:`LP_MARK_ENV_VARS_CLOSE` .. attribute:: LP_COLOR_ENV_VARS_UNSET :type: string :value: $BLUE Color of the environment variables that are unset, in the user-defined watch list. See also: - :attr:`LP_ENABLE_ENV_VARS` - :attr:`LP_ENV_VARS` - :attr:`LP_COLOR_ENV_VARS_SET` - :attr:`LP_MARK_ENV_VARS_OPEN` - :attr:`LP_MARK_ENV_VARS_SEP` - :attr:`LP_MARK_ENV_VARS_CLOSE` .. versionadded:: 2.2 .. attribute:: LP_COLOR_HOST :type: string :value: "" Color used for the hostname when connected locally. See also: :attr:`LP_HOSTNAME_ALWAYS`. .. attribute:: LP_COLOR_IN_MULTIPLEXER :type: string :value: $BOLD_BLUE Color used for :attr:`LP_MARK_MULTIPLEXER_OPEN` and :attr:`LP_MARK_MULTIPLEXER_CLOSE` if the terminal is in a multiplexer. .. versionchanged:: 2.2 Can be disabled by :attr:`LP_ENABLE_MULTIPLEXER`. .. attribute:: LP_COLOR_JOB_D :type: string :value: $YELLOW Color used for detached multiplexer sessions. See also: :attr:`LP_ENABLE_DETACHED_SESSIONS`. .. attribute:: LP_COLOR_JOB_R :type: string :value: $BOLD_YELLOW Color used for running shell jobs. See also: :attr:`LP_ENABLE_JOBS`. .. attribute:: LP_COLOR_JOB_Z :type: string :value: $BOLD_YELLOW Color used for sleeping shell jobs. See also: :attr:`LP_ENABLE_JOBS`. .. attribute:: LP_COLOR_KUBECONTEXT :type: string :value: $CYAN Color used for the current Kubernetes context. See also: :attr:`LP_ENABLE_KUBECONTEXT`. .. versionadded:: 2.1 .. attribute:: LP_COLOR_MARK :type: string :value: $BOLD Color used for :attr:`LP_MARK_DEFAULT`. .. attribute:: LP_COLOR_MARK_ROOT :type: string :value: $BOLD_RED Color used for :attr:`LP_MARK_DEFAULT` when the current user is root, shown instead of :attr:`LP_COLOR_MARK`. .. attribute:: LP_COLOR_MARK_SUDO :type: string :value: $LP_COLOR_MARK_ROOT Color used for :attr:`LP_MARK_DEFAULT` when ``sudo`` is active, shown instead of :attr:`LP_COLOR_MARK`. See also: :attr:`LP_ENABLE_SUDO`. .. attribute:: LP_COLOR_MODULES :type: string :value: $BLUE Color used for displaying currently loaded modules (if :attr:`LP_ENABLE_MODULES_HASHCOLOR` is disabled). See also: :attr:`LP_ENABLE_MODULES`. .. attribute:: LP_COLOR_NODE_VENV :type: string :value: $LP_COLOR_VIRTUALENV Color used for displaying a Node.js virtual environment. See also: :attr:`LP_ENABLE_NODE_VENV`. .. versionadded:: 2.1 .. attribute:: LP_COLOR_NOWRITE :type: string :value: $RED Color used for :attr:`LP_MARK_PERM` when the user does not have write permissions to the current working directory. See also: :attr:`LP_ENABLE_PERM` and :attr:`LP_COLOR_WRITE`. .. attribute:: LP_COLOR_OS_ARCH :type: string :value: $MAGENTA Color used for OS' architecture (e.g. "x86_64", "i686"…). See also: :attr:`LP_ENABLE_OS` and :attr:`LP_ENABLE_OS_ARCH`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_OS_DISTRIB :type: string :value: $MAGENTA Color used for OS' distribution (e.g. "Ubuntu", "Debian"…). .. note:: Will probably only work on Linux-like systems. See also: :attr:`LP_ENABLE_OS` and :attr:`LP_ENABLE_OS_DISTRIB`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_OS_FAMILY :type: string :value: $MAGENTA Color used for OS' family (e.g. "BSD", "GNU"…). See also: :attr:`LP_ENABLE_OS` and :attr:`LP_ENABLE_OS_FAMILY`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_OS_KERNEL :type: string :value: $MAGENTA Color used for OS' kernel (e.g. "Linux", "MinGW"…). See also: :attr:`LP_ENABLE_OS` and :attr:`LP_ENABLE_OS_KERNEL`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_OS_VERSION :type: string :value: $MAGENTA Color used for OS' version codename (e.g. "focal", "buster"…). .. note:: Will probably only work on Linux-like systems. See also: :attr:`LP_ENABLE_OS` and :attr:`LP_ENABLE_OS_VERSION`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_PATH :type: string :value: "" Color used for the current working directory. If :attr:`LP_COLOR_PATH_LAST_DIR`, :attr:`LP_COLOR_PATH_VCS_ROOT`, :attr:`LP_COLOR_PATH_SEPARATOR`, or :attr:`LP_COLOR_PATH_SHORTENED` are set, their respective sections will be colored with them instead. .. versionchanged:: 2.0 Default value changed from ``$BOLD`` to the default color. .. attribute:: LP_COLOR_PATH_LAST_DIR :type: string :value: $BOLD Color used for the last path segment, which corresponds to the current directory basename. .. versionadded:: 2.0 .. attribute:: LP_COLOR_PATH_ROOT :type: string :value: $BOLD_YELLOW Color used in place of :attr:`LP_COLOR_PATH` when the current user is root. .. attribute:: LP_COLOR_PATH_SEPARATOR :type: string :value: lp_terminal_format 8 -1 0 0 -1 # Grey Color used for the separator ('/') between path segments. If set to the empty string, the separator will take the format of the path segment before it. .. attribute:: LP_COLOR_PATH_SHORTENED :type: string :value: lp_terminal_format 8 -1 0 0 -1 # Grey Color used for path segments that have been shortened. :attr:`LP_ENABLE_SHORTEN_PATH` must be enabled to have any effect. .. attribute:: LP_COLOR_PATH_VCS_ROOT :type: string :value: $BOLD Color used for the path segment corresponding to the current VCS repository root directory. :attr:`LP_PATH_VCS_ROOT` must be enabled to have any effect. .. versionadded:: 2.0 .. attribute:: LP_COLOR_PERL_VENV :type: string :value: $LP_COLOR_VIRTUALENV Color used for displaying a Perl virtual environment. See also: :attr:`LP_ENABLE_PERL_VENV`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_PROXY :type: string :value: $BOLD_BLUE Color used for :attr:`LP_MARK_PROXY`. See also: :attr:`LP_ENABLE_PROXY`. .. attribute:: LP_COLOR_RAM :type: string :value: $BOLD_RED Color used for displaying information about the available RAM. See also :attr:`LP_COLOR_RAM_UNITS`, :attr:`LP_ENABLE_RAM`, :attr:`LP_ALWAYS_DISPLAY_VALUES`, and :attr:`LP_PERCENTS_ALWAYS`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_RAM_UNITS :type: string :value: $RED Color used for displaying the unit of the available RAM. See also :attr:`LP_COLOR_RAM`, :attr:`LP_ENABLE_RAM`, :attr:`LP_ALWAYS_DISPLAY_VALUES`, and :attr:`LP_PERCENTS_ALWAYS`. .. versionadded:: 2.2 .. attribute:: LP_COLOR_RUBY_VENV :type: string :value: $LP_COLOR_VIRTUALENV Color used for displaying a Ruby virtual environment. See also: :attr:`LP_ENABLE_RUBY_VENV`. .. versionadded:: 2.1 .. attribute:: LP_COLOR_RUNTIME :type: string :value: $YELLOW Color used for displaying the last command runtime. See also: :attr:`LP_ENABLE_RUNTIME`. .. attribute:: LP_COLOR_SHLVL :type: string :value: $BOLD_GREEN Color used for displaying the nested shell level. See also: :attr:`LP_ENABLE_SHLVL`, :attr:`LP_SHLVL_THRESHOLD`, and :attr:`LP_MARK_SHLVL`. .. versionadded:: 2.1 .. attribute:: LP_COLOR_SSH :type: string :value: $BLUE Color used for displaying the hostname when connected with SSH. Has no effect if :attr:`LP_ENABLE_SSH_COLORS` is enabled. See also: :attr:`LP_HOSTNAME_ALWAYS`. .. attribute:: LP_COLOR_SU :type: string :value: $BOLD_YELLOW Color used for displaying the hostname when running under ``su`` or ``sudo``. See also: :attr:`LP_HOSTNAME_ALWAYS`. .. attribute:: LP_COLOR_TELNET :type: string :value: $WARN_RED Color used for displaying the hostname when connected with Telnet. See also: :attr:`LP_HOSTNAME_ALWAYS`. .. attribute:: LP_COLOR_TERRAFORM :type: string :value: $PINK Color used for displaying a Terraform workspace. See also: :attr:`LP_ENABLE_TERRAFORM`. .. versionadded:: 2.1 .. attribute:: LP_COLOR_TIME :type: string :value: $BLUE Color used for displaying the current time. See also: :attr:`LP_ENABLE_TIME`. .. attribute:: LP_COLOR_UP :type: string :value: $GREEN Color used to indicate that the current repository is up-to-date and no commits differ from the remote tracking branch. .. attribute:: LP_COLOR_USER_ALT :type: string :value: $BOLD Color used for displaying the username when running as a different user than the login user. .. attribute:: LP_COLOR_USER_LOGGED :type: string :value: "" Color used for displaying the username when running as the login user. See also: :attr:`LP_USER_ALWAYS`. .. attribute:: LP_COLOR_USER_ROOT :type: string :value: $BOLD_YELLOW Color used for displaying the username when running as root. .. attribute:: LP_COLOR_VIRTUALENV :type: string :value: $CYAN Color used for displaying a Python virtual environment or Red Hat Software Collection. See also: :attr:`LP_ENABLE_VIRTUALENV` and :attr:`LP_ENABLE_SCLS`. .. attribute:: LP_COLOR_WRITE :type: string :value: $GREEN Color used for :attr:`LP_MARK_PERM` when the user has write permissions to the current working directory. See also: :attr:`LP_ENABLE_PERM` and :attr:`LP_COLOR_NOWRITE`. .. attribute:: LP_COLOR_X11_OFF :type: string :value: $YELLOW Color used for indicating that a display is not connected. See also :attr:`LP_ENABLE_DISPLAY`. .. attribute:: LP_COLOR_X11_ON :type: string :value: $GREEN Color used for indicating that a display is connected. See also :attr:`LP_ENABLE_DISPLAY`. liquidprompt-2.2.1/docs/docs-lint.sh000077500000000000000000000006141464055045500174410ustar00rootroot00000000000000#!/bin/sh error=0 # Error on warnings and turn on nitpicky mode. # Output the HTML so we can check it for leaked RST. make html SPHINXOPTS="-W --keep-going -n" || error=1 make spelling SPHINXOPTS="-W --keep-going" || error=1 sphinx-lint \ --ignore venv/ \ --enable all \ --disable default-role \ || error=1 make linkcheck || error=1 exit "$error" # vim: ft=sh et sts=2 sw=2 tw=120 liquidprompt-2.2.1/docs/functions.rst000066400000000000000000000012541464055045500177510ustar00rootroot00000000000000Functions ********* Functions starting with ``lp`` or any other alphanumeric character are **public** functions designed to be used by users on the command line or in their config. Functions starting with ``_lp`` are **theme** level functions, designed to be used by themes. These include data, theme, and utility functions. Functions starting with ``__lp`` are **internal** functions, designed to be used only by Liquid Prompt internals. These functions should not be used by users or themes, as they are not guaranteed to not change between versions. .. toctree:: :maxdepth: 1 functions/public functions/data functions/theme functions/util functions/internal liquidprompt-2.2.1/docs/functions/000077500000000000000000000000001464055045500172155ustar00rootroot00000000000000liquidprompt-2.2.1/docs/functions/data.rst000066400000000000000000000520221464055045500206610ustar00rootroot00000000000000Data Functions ************** .. contents:: :local: .. toctree:: data/vcs These functions are designed to be used by themes. All data functions will return ``true`` (meaning return code ``0``) when they are both enabled and have data. They will return ``false`` (meaning return code ``1``) when they do not have data. Most will return ``2`` when they are disabled, either through the config or because the tool they depend on is not installed. Such disable config options will be documented. Exceptions to this rule are explicitly documented. When a function returns ``false``, any return variables are not guaranteed to be set. If running with ``set -u`` (or when building a theme to be distributed), guard any return variable accesses with a check of the return code, or use ``${var-}`` syntax. Battery ------- .. function:: _lp_battery() -> var:lp_battery Returns a return code depending on the status of the battery: * ``5`` if the battery feature is disabled or not available * ``4`` if no battery level is found * ``3`` if charging and the level is above the threshold * ``2`` if charging and the level is under the threshold * ``1`` if discharging and the level is above the threshold * ``0`` if discharging and the level is under the threshold Returns an integer percentage of the current battery level. If the threshold is not surpassed, the battery level is still returned. The threshold is configured with :attr:`LP_BATTERY_THRESHOLD`. Can be disabled by :attr:`LP_ENABLE_BATT`. .. versionchanged:: 2.1 Implemented `sysfs` method as the default way of getting battery status. Development Environment ----------------------- .. function:: _lp_cmake() -> var:lp_cmake_compiler, var:lp_cmake_generator, var:lp_cmake_buildtype Returns ``true`` if a CMake context is found. Parse the data in `CMakeCache.txt` and returns the basename of the configured compiler, generator (e.g. "Unix Makefiles"), and build type ("Debug", "Release", etc.). Some generator names are shorten: "Makefiles" becomes "Make" and "Visual Studio" becomes "VS". Can be disabled by :attr:`LP_ENABLE_CMAKE`. .. versionadded:: 2.2 .. function:: _lp_kubernetes_context() -> var:lp_kubernetes_context, var:lp_kubernetes_namespace Returns ``true`` if a Kubernetes context is found. Returns the Kubernetes context name or the first name component. Splitting long context names into components is defined by :attr:`LP_DELIMITER_KUBECONTEXT_SUFFIX` and :attr:`LP_DELIMITER_KUBECONTEXT_PREFIX`. Both use greedy matches - see :doc:`../config` for examples. If enabled by :attr:`LP_ENABLE_KUBE_NAMESPACE`, will also return the default namespace for the current context, if one is set. Can be disabled by :attr:`LP_ENABLE_KUBECONTEXT`. .. versionadded:: 2.1 .. function:: _lp_node_env() -> var:lp_node_env Returns ``true`` if a Node.js environment is detected. Returns the virtual environment name. Can be enabled by :attr:`LP_ENABLE_NODE_VENV`. .. versionadded:: 2.1 .. function:: _lp_perl_env() -> var:lp_perl_env Returns ``true`` if a Perlbrew or PLENV Perl environment is detected. Returns the virtual environment name. Can be disabled by :attr:`LP_ENABLE_PERL_VENV`. .. versionadded:: 2.2 .. function:: _lp_python_env() -> var:lp_python_env Returns ``true`` if a Python or Conda environment is detected. Returns the virtual environment name. If the environment name contains a forward slash (``/``), only the substring after the last forward slash is returned. Can be disabled by :attr:`LP_ENABLE_VIRTUALENV`. .. versionadded:: 2.0 .. versionchanged:: 2.1 Displays the "prompt string" first (the ``--prompt`` argument when setting up the virtualenv). .. function:: _lp_ruby_env() -> var:lp_ruby_env Returns ``true`` if a RVM or RBENV ruby environment is detected. Returns the virtual environment name. In the case of a RVM environment, the label displayed can be customized with the :attr:`LP_RUBY_RVM_PROMPT_OPTIONS`. Can be disabled by :attr:`LP_ENABLE_RUBY_VENV`. .. versionadded:: 2.1 .. function:: _lp_software_collections() -> var:lp_software_collections Returns ``true`` if a `Red Hat Software Collection`_ is enabled. Returns the software collection name. If the software collection name has trailing whitespace, it is removed. Can be disabled by :attr:`LP_ENABLE_SCLS`. .. versionadded:: 2.0 .. _`Red Hat Software Collection`: https://developers.redhat.com/products/softwarecollections/overview .. function:: _lp_terraform_env() -> var:lp_terraform_env Returns ``true`` if a Terraform workspace is detected. Returns the workspace name. Can be enabled by :attr:`LP_ENABLE_TERRAFORM`. .. versionadded:: 2.1 Disks and Memory ---------------- .. function:: _lp_disk -> var:lp_disk, var:lp_disk_human, var:lp_disk_perc Gather information about the current state of the hard drive hosting the *current directory*: * available space in kibi-bytes (``lp_disk``, that is, 1024 bytes), * available space in human-readable form, using binary unit prefixes (``lp_disk_human``, see also :func:`__lp_bytes_to_human`). * available space as a percentage of total (``lp_disk_perc``). Returns ``true`` if the used space is below at least one of the user-defined thresholds: * :attr:`LP_DISK_THRESHOLD` * :attr:`LP_DISK_THRESHOLD_PERC` Can be disabled by :attr:`LP_ENABLE_DISK`. .. versionadded:: 2.2 .. function:: _lp_ram -> var:lp_ram, var:lp_ram_human, var:lp_ram_perc Gather information about the current state of the RAM: * available space in kibi-bytes (``lp_ram``, that is, 1024 bytes), * available space in human-readable form, using binary unit prefixes (``lp_ram_human``, see also :func:`__lp_bytes_to_human`). * available space as a percentage of total (``lp_ram_perc``). Returns ``true`` if the used space is below at least one of the user-defined thresholds: * :attr:`LP_RAM_THRESHOLD` * :attr:`LP_RAM_THRESHOLD_PERC` Can be disabled by :attr:`LP_ENABLE_RAM`. .. versionadded:: 2.2 Environment ----------- .. function:: _lp_aws_profile() -> var:lp_aws_profile Returns ``true`` if the :envvar:`AWS_PROFILE`, :envvar:`AWS_DEFAULT_PROFILE`, or :envvar:`AWS_VAULT` variables are found in the environment (in that order of preference). Returns the contents of the variable. Can be disabled by :attr:`LP_ENABLE_AWS_PROFILE`. .. versionadded:: 2.1 .. function:: _lp_connected_display() Returns ``true`` if there is a connected X11 display. .. versionadded:: 2.0 .. versionchanged:: 2.2 Can be disabled by :attr:`LP_ENABLE_DISPLAY`. .. function:: _lp_connection() -> var:lp_connection Returns a string matching the connection context of the shell. Valid values: * ``ssh`` - connected over OpenSSH * ``tel`` - connected over Telnet * ``su`` - running in a ``su`` or ``sudo`` shell * ``lcl`` - running in a local terminal It is not possible for more than one context to be returned. The contexts are checked in the order listed above, and the first one found will be returned. It is not possible for no context to be returned. .. versionchanged:: 2.0 Return method changed from stdout. .. function:: _lp_container() -> var:lp_container Returns ``true`` if the shell is running in a container. In that case, the return variable is set to a string matching the container type. Possible values include (but are not limited to): * ``Singlrty`` - running in a `Singularity`_ container * ``Toolbox`` - running in a `Toolbox`_ container * ``Podman`` - running in a `Podman`_ container * ``Docker`` - running in a `Docker`_ container * ``LXC`` - running in an `LXC`_ container * ``nspawn`` - running in a `systemd-nspawn`_ container .. _Singularity: https://sylabs.io/guides/latest/user-guide/ .. _Toolbox: https://containertoolbx.org/ .. _Podman: https://podman.io/ .. _Docker: https://www.docker.com/ .. _LXC: https://linuxcontainers.org/lxc/ .. _systemd-nspawn: https://www.freedesktop.org/software/systemd/man/systemd-nspawn.html It is not possible to detect more than one containerization type to be returned. The containers are checked in the order listed above, and the first one found will be returned. Can be enabled by :attr:`LP_ENABLE_CONTAINER`. .. versionadded:: 2.1 .. function:: _lp_dirstack() -> var:lp_dirstack Returns ``true`` if directory stack support is enabled and the directory stack contains more than one directory. In that case, the return variable is set to the number of directories on the stack. Can be enabled by :attr:`LP_ENABLE_DIRSTACK`. .. versionadded:: 2.0 .. function:: _lp_env_vars([color_if_set, [color_if_unset, [end_color]]]) -> var:lp_env_vars Gather the states of the environment variables indicated in the :attr:`LP_ENV_VARS` array, and put them in the ``lp_env_vars`` array. :attr:`LP_ENV_VARS` should be a list of environment variable names to look for, along with the string to be displayed if the variable is set, and an optional string to be displayed if the variable is not set. The string to be displayed may contain a ``%s`` marker, which will be replaced by the variable's content. If ``color_if_set`` is passed, it will be used to color the *set* variables string. If ``color_if_unset`` is passed, it will be used to color the *unset* variables string. ``end_color`` is added at the end of each variable string. It defaults to "$NO_COL" (color reset). Returns ``true`` if at least one variable representation is added to the result array. Returns ``1`` if the no variable representation is set. Returns ``2`` if the user disabled the feature with :attr:`LP_ENABLE_ENV_VARS`. .. versionadded:: 2.2 .. function:: _lp_error() -> var:lp_error Returns ``true`` if the last user shell command returned a non-zero exit code. Returns (in the return variable) the exit code of that command. Can be disabled by :attr:`LP_ENABLE_ERROR`. .. note:: The return variable ``lp_error`` will always be set with the last command return code, as it must be the first thing done by the prompt. This function should still be used, as it checks for the feature being disabled by the user. .. versionadded:: 2.0 .. function:: _lp_error_meaning() -> var:lp_error_meaning Returns ``true`` if the last user shell command returned a non-zero exit code. Returns (in the return variable) a guess of the meaning of that error. Can be disabled by :attr:`LP_ENABLE_ERROR_MEANING`. .. versionadded:: 2.2 .. function:: _lp_http_proxy() -> var:lp_http_proxy Returns ``true`` if an HTTP or HTTPS proxy is enabled through environment variables in the shell. Returns the first found proxy string. Can be disabled by :attr:`LP_ENABLE_PROXY`. .. versionadded:: 2.0 .. function:: _lp_multiplexer() -> var:lp_multiplexer Returns ``true`` if the current shell context is inside a terminal multiplexer. Returns a string matching the multiplexer: * ``tmux`` * ``screen`` .. versionadded:: 2.0 .. versionchanged:: 2.2 Can be disabled by :attr:`LP_ENABLE_MULTIPLEXER`, except if ``--internal`` is passed (i.e. for internal use only). Return variable renamed from ``lp_mulitplexer`` to ``lp_multiplexer``. .. function:: _lp_shell_level() -> var:lp_shell_level Returns ``true`` if the shell is a nested shell inside another shell. Can be disabled by :attr:`LP_ENABLE_SHLVL`. .. versionadded:: 2.1 .. function:: _lp_terminal_device() -> var:lp_terminal_device Returns the basename of the terminal device connected to the shell's standard input. .. note:: This value should never change during the life of the shell. .. note:: This data source is unlikely to be wanted by the user, and should not be included in themes by default. .. versionadded:: 2.0 Jobs ---- .. function:: _lp_detached_sessions() -> var:lp_detached_sessions Returns ``true`` if any detached multiplexer sessions are found. Returns an integer count of how many sessions were found. Can be disabled by :attr:`LP_ENABLE_DETACHED_SESSIONS`. .. versionadded:: 2.0 .. function:: _lp_jobcount() -> var:lp_running_jobs, var:lp_stopped_jobs Returns ``true`` if any shell background jobs are found. Returns an integer count of how many jobs are running and how many are stopped. Stopped jobs are jobs suspended with `Ctrl-Z`. Running jobs are jobs started with the ``command &`` syntax, or stopped jobs started again with the ``bg`` command. Can be disabled by :attr:`LP_ENABLE_JOBS`. .. versionadded:: 2.0 Load ---- .. function:: _lp_cpu_load() -> var:lp_cpu_load Returns a string of the system load average smallest increment, usually 1 minute. The return code is not defined. .. function:: _lp_load() -> var:lp_load, var:lp_load_adjusted Returns ``true`` if the system load average scaled by CPU count is greater than the threshold. Returns the system load average in *lp_load*, and the average scaled by CPU count, multiplied by 100 in *lp_load_adjusted*. In other words, the load average is multiplied by 100, then divided by the number of CPU cores. *lp_load* should be displayed to the user, while *lp_load_adjusted* should be used to compare values between machines using :attr:`LP_LOAD_CAP`. The default theme uses this to generate a color scale. .. note:: :attr:`LP_LOAD_CAP` is a raw floating point configuration value that is difficult to do math on. ``_LP_LOAD_CAP`` contains the same value, but multiplied by 100 to make comparisons to *lp_load_adjusted* simple. Use it along with *lp_load_adjusted* as arguments to :func:`_lp_color_map`. If the threshold is not surpassed, the load average is still returned. The threshold is configured with :attr:`LP_LOAD_THRESHOLD`. Can be disabled by :attr:`LP_ENABLE_LOAD`. .. versionadded:: 2.0 OS -- .. function:: _lp_chroot() -> var:lp_chroot Returns ``true`` if a chroot environment is detected. Returns a string matching the chroot string if one is found. .. versionadded:: 2.0 .. versionchanged:: 2.2 Can be disabled by :attr:`LP_ENABLE_CHROOT`. .. function:: _lp_hostname() -> var:lp_hostname Returns ``true`` if a hostname should be displayed. Returns ``1`` if the connection type is local and :attr:`LP_HOSTNAME_ALWAYS` is not ``1``. Returns the hostname string in *lp_hostname*. Can be disabled by :attr:`LP_HOSTNAME_ALWAYS` set to ``-1``. .. versionadded:: 2.0 .. versionchanged:: 2.1 Returns the actual hostname instead of a shell prompt escape code. No longer sets ``LP_HOST_SYMBOL`` to the same return string. Added :attr:`LP_HOSTNAME_METHOD` to configure display method. .. function:: _lp_os() -> var:lp_os_arch, var:lp_os_family, var:lp_os_kernel, var:lp_os_distrib, var:lp_os_version Gather data about the current Operating System. Returns ``true`` if it was able to gather all possible data. Returns ``1`` if some expected information was missing. Returns ``2`` if the user disabled the feature with :attr:`LP_ENABLE_OS`. Returns data in ``lp_os_*`` variables: - processor architecture (e.g. x86_64, i686, etc.), - OS family (BSD, UNIX, GNU or Windows), - OS kernel (Linux, Darwin, Cygwin, etc.), - Linux *distribution* (e.g. ubuntu, arch, mandrake, etc.), - Linux distribution *version codename* (e.g. focal, ada, buzz, etc.) Each data source can be disabled via its corresponding configuration variable: - :attr:`LP_ENABLE_OS_ARCH` - :attr:`LP_ENABLE_OS_FAMILY` - :attr:`LP_ENABLE_OS_KERNEL` - :attr:`LP_ENABLE_OS_DISTRIB` - :attr:`LP_ENABLE_OS_VERSION` .. versionadded:: 2.2 .. function:: _lp_sudo_active() Returns ``true`` if ``sudo`` is currently activated with valid credentials. If ``sudo`` is configured to always allow a user to run commands with no password, this will always return ``true``. Can be disabled by :attr:`LP_ENABLE_SUDO`. .. versionadded:: 2.0 .. versionchanged:: 2.1 If the user has NOPASSWD powers, that is cached on startup to prevent multiple ``sudo`` calls. .. function:: _lp_user() Returns a return code depending on the logged in user: * ``2`` - the user is root * ``1`` - the user is a user other than the original login user * ``0`` - the user is the login user .. versionadded:: 2.0 .. function:: _lp_username() -> var:lp_username Returns ``true`` if a username should be displayed. Returns ``1`` if the user is the login user and :attr:`LP_USER_ALWAYS` is not ``1``. Returns the current user ID in *lp_username*. Can be disabled by :attr:`LP_USER_ALWAYS` set to ``-1``. .. versionadded:: 2.0 .. versionchanged:: 2.1 Returns the actual username instead of a shell prompt escape code. Path ---- .. function:: _lp_path_format(path_format=$LP_COLOR_PATH, \ last_directory_format=$path_format, vcs_root_format=$last_directory_format, \ shortened_directory_format=$path_format, separator="/", \ [separator_format]) -> var:lp_path, var:lp_path_format Returns a shortened and formatted string indicating the current working directory path. *lp_path* contains the path without any formatting, custom separators, or shell escapes, intended for use in the terminal title. *lp_path_format* contains the complete formatted path, to be inserted into the prompt. The behavior of the shortening is controlled by :attr:`LP_ENABLE_SHORTEN_PATH`, :attr:`LP_PATH_METHOD`, :attr:`LP_PATH_LENGTH`, :attr:`LP_PATH_KEEP`, :attr:`LP_PATH_CHARACTER_KEEP`, and :attr:`LP_PATH_VCS_ROOT`. See their descriptions for details on how they change the output of this function. The last directory in the displayed path will be shown with the *last_directory_format*. If a VCS repository is detected with :func:`_lp_find_vcs`, the root of the VCS repository is formatted with *vcs_root_format*. The detection method is the same as for all other VCS display, so if a VCS type or directory is disabled, it will not be detected. If the path shortening shortens a directory (or multiple consecutive directories), they will be formatted with *shortened_directory_format*. A custom *separator* will only be substituted in the *lp_path_format* output. Note that this will cut into maximum path length if the separator is longer than one character. With no specified *separator_format*, each separator will take the format of the directory section preceding it. Otherwise every separator will be formatted with *separator_format*. Note that the root directory is treated as a directory, and is formatted as such. .. versionadded:: 2.0 .. versionchanged:: 2.1 Changed *lp_path* to no longer contain shell escapes. Runtime ------- .. function:: _lp_runtime_format() -> var:lp_runtime_format Returns ``true`` if the last command runtime was greater than the threshold. Returns a formatted string of the total runtime, split into days, hours, minutes, and seconds. Ex: ``3h27m6s``. The threshold is configured with :attr:`LP_RUNTIME_THRESHOLD`. Can be disabled by :attr:`LP_ENABLE_RUNTIME`. .. versionadded:: 2.0 Temperature ----------- .. function:: _lp_temperature() -> var:lp_temperature Returns ``true`` if the highest system temperature is greater than the threshold. Returns the highest temperature integer. If the threshold is not surpassed, the highest temperature is still returned. If no temperature data is found, returns ``false`` and *lp_temperature* will not be set. The threshold is configured with :attr:`LP_TEMP_THRESHOLD`. Can be disabled by :attr:`LP_ENABLE_TEMP`. .. versionadded:: 2.0 Note that a function by this name was renamed to ``_lp_temperature_color``. Time ---- .. function:: _lp_time() -> var:lp_time Returns ``true`` if digital time is enabled. Returns the current digital time string, formatting set by :attr:`LP_TIME_FORMAT`. Can be disabled by :attr:`LP_ENABLE_TIME`, or :attr:`LP_TIME_ANALOG` set to ``1``. .. versionadded:: 2.0 .. versionchanged:: 2.1 Returns the actual time instead of a shell prompt escape code. .. function:: _lp_analog_time() -> var:lp_analog_time Returns ``true`` if analog time is enabled. Returns the current analog time as a single Unicode character, accurate to the closest 30 minutes. Can be disabled by :attr:`LP_ENABLE_TIME`, or :attr:`LP_TIME_ANALOG` set to ``0``. .. versionadded:: 2.0 Wireless -------- .. function:: _lp_wifi_signal_strength() -> var:lp_wifi_signal_strength Returns ``true`` if the lowest wireless signal strength is lower than the threshold. Returns the lowest strength percentage. If the threshold is not surpassed, the lowest signal strength is still returned. If no wireless signal data is found, returns ``false`` and *lp_wifi_signal_strength* will not be set. The threshold is configured with :attr:`LP_WIFI_STRENGTH_THRESHOLD`. Can be disabled by :attr:`LP_ENABLE_WIFI_STRENGTH`. .. versionadded:: 2.1 liquidprompt-2.2.1/docs/functions/data/000077500000000000000000000000001464055045500201265ustar00rootroot00000000000000liquidprompt-2.2.1/docs/functions/data/vcs.rst000066400000000000000000000571601464055045500214640ustar00rootroot00000000000000Version Control Data Functions ****************************** .. contents:: :local: These functions are designed to be used by themes. Generic ------- The generic interface functions are designed to provide a level of abstraction over the type of VCS that a user might be using. By using the generic interface, a theme can provide a common look for all VCS types. See the default theme function :func:`_lp_vcs_details_color` for an example of this. .. function:: _lp_find_vcs() -> var:lp_vcs_type, var:lp_vcs_root, \ var:lp_vcs_dir, var:lp_vcs_specific_dir, var:lp_vcs_subtype Returns ``true`` if the current directory is part of a version control repository. If not, returns ``1``. Returns the VCS type ID, subtype if one exists, the VCS data directory, and the repository root directory. If the current directory is disabled for version control using :attr:`LP_DISABLED_VCS_PATHS` (checked using :func:`_lp_are_vcs_enabled`), returns ``2``, and the returned type is set to "disabled". :func:`_lp_find_vcs` will only search for VCS types that are not disabled. If all VCS types are disabled in the config, :func:`_lp_find_vcs` will return ``1``, as no repository will be found. This function does a lightweight check for the existence of a version control repository, only looking for the existence of a database. It does not check if the database is valid or healthy. Use :func:`_lp_vcs_active` to test for that. Git worktrees have two Git directories: one is the main directory in *lp_vcs_dir*, which holds the DB and config. The other is the worktree specific directory in *lp_vcs_specific_dir*, which holds working directory specific information, like index and status like merge or rebase in progress. .. note:: *lp_vcs_dir* will not be set for Fossil repositories. Protect it with ``"${lp_vcs_dir-}"``. .. note:: *lp_vcs_specific dir* will only be set for Git repositories. Protect it with ``"${lp_vcs_specific_dir-}"``. .. note:: *lp_vcs_subtype* will not be set usually. The only currently supported subtypes are `vcsh` and `svn`, which are subtypes of `git`. .. versionadded:: 2.0 .. versionchanged:: 2.1 Added the *lp_vcs_dir* and *lp_vcs_subtype* return values. Added support for checking the :envvar:`GIT_DIR` environment variable. .. versionchanged:: 2.2 Added the *lp_vcs_specific_dir* return value. .. function:: _lp_are_vcs_enabled() Returns ``true`` if the current directory is not excluded by the config option :attr:`LP_DISABLED_VCS_PATHS`. .. note:: All following generic functions need :func:`_lp_find_vcs` to be run first, as they need ``lp_vcs_type`` to be set. .. function:: _lp_vcs_active() Returns ``true`` if the detected VCS is enabled in Liquid Prompt and the current directory is a valid repository of that type. This check should be done before running any other ``_lp_vcs_*`` data functions, but can be omitted for speed reasons if the checks done by :func:`_lp_find_vcs` are good enough. .. versionadded:: 2.0 .. note:: Unless otherwise documented, the following functions return ``0`` for good data, ``1`` for no data, and ``2`` for unsupported function. .. function:: _lp_vcs_bookmark() -> var:lp_vcs_bookmark Returns ``true`` if a bookmark is active in the repository. Returns the bookmark name. Most VCS providers do not support bookmarks. .. versionadded:: 2.0 .. function:: _lp_vcs_branch() -> var:lp_vcs_branch Returns ``true`` if a branch is active in the repository. Returns the branch name. For some VCS providers, a branch is always active. .. versionadded:: 2.0 .. function:: _lp_vcs_commit_id() -> var:lp_vcs_commit_id Returns the full commit ID of the current commit. The return code is not defined. Some VCS providers use hashes, while others use incrementing revision numbers. All VCS providers support some form of ID. The returned string should be unique enough that a user can identify the commit. .. versionadded:: 2.0 .. function:: _lp_vcs_commits_off_remote() -> var:lp_vcs_commit_ahead, var:lp_vcs_commit_behind Returns ``true`` if there are commits on the current branch that are not on the remote tracking branch, or commits on the remote tracking branch that are not on this branch. Returns ``1`` if there are no differing commits. Returns ``2`` if there is no matching remote tracking branch. Returns ``3`` or higher if the VCS provider does not support remote tracking branches. Returns the number of commits behind and ahead. Most VCS providers do not support remote tracking branches. .. versionadded:: 2.0 .. function:: _lp_vcs_head_status() -> var:lp_vcs_head_status, var:lp_vcs_head_details Return ``true`` if the repository is in a special or unusual state. Return the special status, and any extra details (like progress in a rebase) if applicable. Many VCS providers do not have such information. This info is unlikely to be similar across VCSs, and should probably be displayed to a user without manipulation. .. note:: The details are optional, and might not be set. Protect it with ``"${lp_vcs_head_details-}"``. .. versionadded:: 2.0 .. function:: _lp_vcs_remote() -> var:lp_vcs_remote Return ``true`` if the current branch is a remote tracking branch. The remote name is returned in *lp_vcs_remote*. Many VCS providers do not have such information. Currently this is only implemented for Git. Can be enabled by :attr:`LP_ENABLE_VCS_REMOTE`. .. versionadded:: 2.2 .. function:: _lp_vcs_staged_files() -> var:lp_vcs_staged_files Returns ``true`` if any staged files exist in the repository. In other words, tracked files that contain staged changes. Returns the number of staged files. Many VCS providers do not support staging. .. versionadded:: 2.0 .. function:: _lp_vcs_staged_lines() -> var:lp_vcs_staged_i_lines, var:lp_vcs_staged_d_lines Returns ``true`` if any staged lines exist in the repository. In other words, tracked files that contain staged changes. Returns the number of staged lines. Many VCS providers do not support staging. .. versionadded:: 2.0 .. function:: _lp_vcs_stash_count() -> var:lp_vcs_stash_count Returns ``true`` if there are stashes the repository. Returns the number of stashes. Some VCS providers refer to stashes as "shelves". Some VCS providers do not support stashes. .. versionadded:: 2.0 .. function:: _lp_vcs_tag() -> var:lp_vcs_tag Returns ``true`` if a tag is active in the repository. Returns the tag name. A tag will only be returned if it is a unique ID that points only to the current commit. If multiple tags match, only one is returned. Which tag is selected is not defined. Some VCS providers do not support unique tags. .. versionadded:: 2.0 .. function:: _lp_vcs_uncommitted_files() -> var:lp_vcs_uncommitted_files Returns ``true`` if any uncommitted files exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted files. Some VCS providers refer to uncommitted files as "modified" files. .. versionadded:: 2.0 .. function:: _lp_vcs_uncommitted_lines() -> var:lp_vcs_uncommitted_i_lines, var:lp_vcs_uncommitted_d_lines Returns ``true`` if any uncommitted lines exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted lines. Some VCS providers refer to uncommitted lines as "modified" or "changed" lines. .. versionadded:: 2.0 .. function:: _lp_vcs_unstaged_files() -> var:lp_vcs_unstaged_files Returns ``true`` if any unstaged files exist in the repository. In other words, tracked files that contain unstaged changes. Returns the number of unstaged files. Many VCS providers do not support staging. .. versionadded:: 2.0 .. function:: _lp_vcs_unstaged_lines() -> var:lp_vcs_unstaged_i_lines, var:lp_vcs_unstaged_d_lines Returns ``true`` if any unstaged lines exist in the repository. In other words, tracked files that contain unstaged changes. Returns the number of unstaged lines. Many VCS providers do not support staging. .. versionadded:: 2.0 .. function:: _lp_vcs_untracked_files() -> var:lp_vcs_untracked_files Returns ``true`` if any untracked files exist in the repository. Returns the number of untracked files. Some VCS providers refer to untracked files as "extra" files. .. versionadded:: 2.0 Bazaar ------ .. warning:: Bazaar is no longer being actively developed, and depends on Python 2, which is no longer supported. `Breezy `_ is a fork that can work with Bazaar repositories. To use Breezy in place of Bazaar, set a wrapper function:: bzr() { brz "$@"; } .. note:: Bazaar does not support bookmarks. A nick is somewhat like a bookmark, but there is no command to view a naked branch name, so the ``nick`` command is used for branches. .. note:: Bazaar does not support a staging area. .. note:: Bazaar does not support getting details of remote tracking branches. Bazaar does not keep a local copy of the remote state, so checking this would be impossible anyway. .. note:: Bazaar does not have extra head statuses. A Bazaar merge can be partially complete, but there is no command to test for it. .. function:: _lp_bzr_active() Returns ``true`` if Bazaar is enabled in Liquid Prompt and the current directory is a valid Bazaar repository. This check should be done before running any other ``_lp_bzr_*`` data functions if accessing the Bazaar data functions directly instead of through the generic interface. Can be disabled by :attr:`LP_ENABLE_BZR`. .. versionadded:: 2.0 .. function:: _lp_bzr_branch() -> var:lp_vcs_branch Returns ``true`` if a branch is active in the repository. Returns the branch name. .. versionchanged:: 2.0 Return method changed from stdout. No branch now returns ``false``. .. function:: _lp_bzr_commit_id() -> var:lp_vcs_commit_id Returns the revision number of the current commit. The return code is not defined. .. versionadded:: 2.0 .. function:: _lp_bzr_stash_count() -> var:lp_vcs_stash_count Returns ``true`` if there are shelves the repository. Returns the number of shelves. .. versionadded:: 2.0 .. function:: _lp_bzr_tag() -> var:lp_vcs_tag Returns ``true`` if a tag is active in the repository. Returns the tag name. If multiple tags match, only one is returned. Which tag is selected is not defined. .. versionadded:: 2.0 .. function:: _lp_bzr_uncommitted_files() -> var:lp_vcs_uncommitted_files Returns ``true`` if any uncommitted files exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted files. .. versionadded:: 2.0 .. function:: _lp_bzr_uncommitted_lines() -> var:lp_vcs_uncommitted_i_lines, var:lp_vcs_uncommitted_d_lines Returns ``true`` if any uncommitted lines exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted lines. .. versionadded:: 2.0 .. function:: _lp_bzr_untracked_files() -> var:lp_vcs_untracked_files Returns ``true`` if any untracked files exist in the repository. Returns the number of untracked files. .. versionadded:: 2.0 Fossil ------ .. note:: Fossil does not support bookmarks. .. note:: Fossil does not support a staging area. .. note:: Fossil does not support unique tags. Fossil tags can refer to multiple check-in IDs, so a matching tag is not a useful unique ID. .. note:: Fossil does not support remote tracking branches. Fossil by default keeps the local repository in sync with the remote. Even if a user disables that, it is not possible to have a local and remote branch named the same not in sync. .. function:: _lp_fossil_active() Returns ``true`` if Fossil is enabled in Liquid Prompt and the current directory is a valid Fossil repository. This check should be done before running any other ``_lp_fossil_*`` data functions if accessing the Fossil data functions directly instead of through the generic interface. Can be disabled by :attr:`LP_ENABLE_FOSSIL`. .. versionadded:: 2.0 .. function:: _lp_fossil_branch() -> var:lp_vcs_branch Returns ``true`` if a branch is active in the repository. Returns the branch name. .. versionchanged:: 2.0 Return method changed from stdout. No branch now returns ``false`` and nothing instead of "no-branch". .. function:: _lp_fossil_commit_id() -> var:lp_vcs_commit_id Returns the full commit hash of the current commit. The return code is not defined. .. versionadded:: 2.0 .. function:: _lp_fossil_head_status() -> var:lp_vcs_head_status Return ``true`` if the repository is in a special or unusual state. Return the special status. Does not return any extra details. .. versionadded:: 2.0 .. function:: _lp_fossil_stash_count() -> var:lp_vcs_stash_count Returns ``true`` if there are stashes the repository. Returns the number of stashes. .. versionadded:: 2.0 .. function:: _lp_fossil_uncommitted_files() -> var:lp_vcs_uncommitted_files Returns ``true`` if any uncommitted files exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted files. .. versionadded:: 2.0 .. function:: _lp_fossil_uncommitted_lines() -> var:lp_vcs_uncommitted_i_lines, var:lp_vcs_uncommitted_d_lines Returns ``true`` if any uncommitted lines exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted lines. .. versionadded:: 2.0 .. function:: _lp_fossil_untracked_files() -> var:lp_vcs_untracked_files Returns ``true`` if any untracked files exist in the repository. Returns the number of untracked files. .. versionadded:: 2.0 Git --- .. note:: Git does not support bookmarks. .. function:: _lp_git_active() Returns ``true`` if Git is enabled in Liquid Prompt and the current directory is a valid Git repository. This check should be done before running any other ``_lp_git_*`` data functions if accessing the Git data functions directly instead of through the generic interface. Can be disabled by :attr:`LP_ENABLE_GIT`. .. versionadded:: 2.0 .. function:: _lp_git_branch() -> var:lp_vcs_branch Returns ``true`` if a branch is active in the repository. Returns the branch name. .. versionchanged:: 2.0 Return method changed from stdout. No branch now returns ``false`` and nothing instead of commit ID. .. function:: _lp_git_commit_id() -> var:lp_vcs_commit_id Returns the full commit hash of the current commit. The return code is not defined. .. versionadded:: 2.0 .. function:: _lp_git_commits_off_remote() -> var:lp_vcs_commit_ahead, var:lp_vcs_commit_behind Returns ``true`` if there are commits on the current branch that are not on the remote tracking branch, or commits on the remote tracking branch that are not on this branch. Returns ``1`` if there are no differing commits. Returns ``2`` if there is no matching remote tracking branch. Returns the number of commits behind and ahead. .. versionadded:: 2.0 .. function:: _lp_git_head_status() -> var:lp_vcs_head_status, var:lp_vcs_head_details Return ``true`` if the repository is in a special or unusual state. Return the special status, and any extra details (like progress in a rebase) if applicable. .. versionadded:: 2.0 .. function:: _lp_git_staged_files() -> var:lp_vcs_staged_files Returns ``true`` if any staged files exist in the repository. In other words, tracked files that contain staged changes. Returns the number of staged files. .. versionadded:: 2.0 .. function:: _lp_git_staged_lines() -> var:lp_vcs_staged_i_lines, var:lp_vcs_staged_d_lines Returns ``true`` if any staged lines exist in the repository. In other words, tracked files that contain staged changes. Returns the number of staged lines. .. versionadded:: 2.0 .. function:: _lp_git_stash_count() -> var:lp_vcs_stash_count Returns ``true`` if there are stashes the repository. Returns the number of stashes. .. versionadded:: 2.0 .. function:: _lp_git_tag() -> var:lp_vcs_tag Returns ``true`` if a tag is active in the repository. Returns the tag name. If multiple tags match, only one is returned. Which tag is selected is not defined. .. versionadded:: 2.0 .. function:: _lp_git_uncommitted_files() -> var:lp_vcs_uncommitted_files Returns ``true`` if any uncommitted files exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted files. .. versionadded:: 2.0 .. function:: _lp_git_uncommitted_lines() -> var:lp_vcs_uncommitted_i_lines, var:lp_vcs_uncommitted_d_lines Returns ``true`` if any uncommitted lines exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted lines. .. versionadded:: 2.0 .. function:: _lp_git_unstaged_files() -> var:lp_vcs_unstaged_files Returns ``true`` if any unstaged files exist in the repository. In other words, tracked files that contain unstaged changes. Returns the number of unstaged files. .. versionadded:: 2.0 .. function:: _lp_git_unstaged_lines() -> var:lp_vcs_unstaged_i_lines, var:lp_vcs_unstaged_d_lines Returns ``true`` if any unstaged lines exist in the repository. In other words, tracked files that contain unstaged changes. Returns the number of unstaged lines. .. versionadded:: 2.0 .. function:: _lp_git_untracked_files() -> var:lp_vcs_untracked_files Returns ``true`` if any untracked files exist in the repository. Returns the number of untracked files. .. versionadded:: 2.0 Mercurial --------- .. note:: Mercurial does not support a staging area. .. note:: Mercurial remote tracking branches are disabled (see :func:`_lp_hg_commits_off_remote`). .. function:: _lp_hg_active() Returns ``true`` if Mercurial is enabled in Liquid Prompt and the current directory is a valid Mercurial repository. This check should be done before running any other ``_lp_hg_*`` data functions if accessing the Mercurial data functions directly instead of through the generic interface. Can be disabled by :attr:`LP_ENABLE_HG`. .. versionadded:: 2.0 .. function:: _lp_hg_bookmark() -> var:lp_vcs_bookmark Returns ``true`` if a bookmark is active in the repository. Returns the bookmark name. Mercurial bookmarks work more like Git branches. .. versionadded:: 2.0 .. function:: _lp_hg_branch() -> var:lp_vcs_branch Returns ``true`` if a branch is active in the repository. Returns the branch name. All Mercurial commits have a branch, so this function should always return ``true``. A closer analog to Git branches are Mercurial bookmarks (see :func:`_lp_hg_bookmark`). .. versionchanged:: 2.0 Return method changed from stdout. No branch now returns ``false``. .. function:: _lp_hg_commit_id() -> var:lp_vcs_commit_id Returns the full global revision ID of the current commit. The return code is not defined. .. versionadded:: 2.0 .. function:: _lp_hg_commits_off_remote() Returns ``2`` (disabled). Mercurial does not keep a local copy of the remote state, so checking this will require a connection to the remote server. This means it is often prohibitively time expensive, and therefore should not be used in a prompt. See `issue #217`_. .. versionadded:: 2.0 .. _`issue #217`: https://github.com/liquidprompt/liquidprompt/issues/217 .. function:: _lp_hg_head_status() -> var:lp_vcs_head_status Return ``true`` if the repository is in a special or unusual state. Return the special status. Does not return any extra details. This function depends on :func:`_lp_find_vcs` being run first to set ``lp_vcs_root``. .. versionadded:: 2.0 .. function:: _lp_hg_stash_count() -> var:lp_vcs_stash_count Returns ``true`` if there are shelves the repository. Returns the number of shelves. .. versionadded:: 2.0 .. function:: _lp_hg_tag() -> var:lp_vcs_tag Returns ``true`` if a tag is active in the repository. Returns the tag name. If multiple tags match, only one is returned. Which tag is selected is not defined. .. versionadded:: 2.0 .. function:: _lp_hg_uncommitted_files() -> var:lp_vcs_uncommitted_files Returns ``true`` if any uncommitted files exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted files. .. versionadded:: 2.0 .. function:: _lp_hg_uncommitted_lines() -> var:lp_vcs_uncommitted_i_lines, var:lp_vcs_uncommitted_d_lines Returns ``true`` if any uncommitted lines exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted lines. .. versionadded:: 2.0 .. function:: _lp_hg_untracked_files() -> var:lp_vcs_untracked_files Returns ``true`` if any untracked files exist in the repository. Returns the number of untracked files. .. versionadded:: 2.0 Subversion ---------- .. note:: Subversion does not support bookmarks. .. note:: Subversion does not support a staging area. .. note:: Subversion does not support stashes. .. note:: Subversion does not have extra head statuses. A Subversion merge is no different than a manual file change, so the repository has no extra state to track. .. note:: Subversion does not support remote tracking branches (as it is not a distributed version control system). .. note:: Subversion does not support tags. What are generally agreed upon as being tags are internally branches. These are returned by :func:`_lp_svn_branch`. .. function:: _lp_svn_active() Returns ``true`` if Subversion is enabled in Liquid Prompt and the current directory is a valid Subversion repository. This check should be done before running any other ``_lp_svn_*`` data functions if accessing the Subversion data functions directly instead of through the generic interface. Can be disabled by :attr:`LP_ENABLE_SVN`. .. versionadded:: 2.0 .. function:: _lp_svn_branch() -> var:lp_vcs_branch Returns ``true`` if a branch is active in the repository. Returns the branch name. Subversion "tags" are really branches under a "tag" directory. Tags are returned as their directory name, prefixed with "tag/". .. versionchanged:: 2.0 Return method changed from stdout. No branch now returns ``false`` and nothing instead of the current directory. .. function:: _lp_svn_commit_id() -> var:lp_vcs_commit_id Returns the revision number of the current commit. The return code is not defined. .. versionadded:: 2.0 .. function:: _lp_svn_uncommitted_files() -> var:lp_vcs_uncommitted_files Returns ``true`` if any uncommitted files exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted files. .. versionadded:: 2.0 .. function:: _lp_svn_uncommitted_lines() -> var:lp_vcs_uncommitted_i_lines, var:lp_vcs_uncommitted_d_lines Returns ``true`` if any uncommitted lines exist in the repository. In other words, tracked files that contain uncommitted changes. Returns the number of uncommitted lines. .. versionadded:: 2.0 .. function:: _lp_svn_untracked_files() -> var:lp_vcs_untracked_files Returns ``true`` if any untracked files exist in the repository. Returns the number of untracked files. .. versionadded:: 2.0 liquidprompt-2.2.1/docs/functions/internal.rst000066400000000000000000000240141464055045500215640ustar00rootroot00000000000000Internal Functions ****************** .. contents:: :local: These functions are designed to be used only by Liquid Prompt internals and data functions. These functions should not be used by users or themes, as they are not guaranteed to be stable between versions. There are documented here for information for those developing Liquid Prompt. Config ------ .. function:: __lp_source_config([--no-config]) Load the user config and default config values. This function is called by :func:`lp_activate`. Also setup color variables that can be used by the user for their color config. Those variables are local to this function. If the ``--no-config`` flag is passed, defaults are set, but no config file is sourced. .. versionchanged:: 2.0 Renamed from ``_lp_source_config``. Added ``--no-config`` flag. Formatting ---------- .. function:: __lp_background_color(color) -> var:ab_color Returns the terminal escape code to set the background color to the `ANSI escape color code`_ integer *color*. No checking is done for invalid color codes. .. versionadded:: 1.12 .. versionchanged:: 2.0 Renamed from ``background_color``. .. function:: __lp_foreground_color(color) -> var:af_color Returns the terminal escape code to set the foreground color to the `ANSI escape color code`_ integer *color*. No checking is done for invalid color codes. .. versionadded:: 1.12 .. versionchanged:: 2.0 Renamed from ``foreground_color``. .. _`ANSI escape color code`: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors Battery ------- .. function:: __lp_battery_acpi() -> var:lp_battery, var:lp_battery_status Returns the status and remaining capacity of the battery, as reported by the `acpi` tool. This function is available only on Linux, and requires `acpi` to be installed. .. versionadded:: 2.1 .. function:: __lp_battery_sysfs() -> var:lp_battery, var:lp_battery_status Returns the status and remaining capacity of the battery, using `sysfs`. This is the default method. If multiple batteries are present, returns the status of the first battery found. This function is available only on Linux systems. .. versionadded:: 2.1 Git --- .. function:: __lp_git_diff_shortstat_files(diff_shortstat) -> var:lp_git_diff_shortstat_files Processes the input *diff_shortstat* as the output of a ``git diff --shortstat`` command, returning the number of changed files. This allows for the comparison of any two states, as :func:`__lp_git_diff_shortstat_files` does not run any specific ``git diff`` command. .. versionadded:: 2.0 .. function:: __lp_git_diff_shortstat_lines(diff_shortstat) -> var:lp_git_diff_shortstat_lines Processes the input *diff_shortstat* as the output of a ``git diff --shortstat`` command, returning the number of changed lines. This allows for the comparison of any two states, as :func:`__lp_git_diff_shortstat_files` does not run any specific ``git diff`` command. .. versionadded:: 2.0 .. function:: __lp_git_diff_shortstat_staged() -> var:_lp_git_diff_shortstat_staged Returns the output of a ``git diff --shortstat`` command, comparing the staging area to the HEAD commit. The return variable is supposed to be a cache, set as local in :func:`__lp_set_prompt`, preventing duplicate calls to ``git``. .. versionadded:: 2.0 .. function:: __lp_git_diff_shortstat_uncommitted() -> var:_lp_git_diff_shortstat_uncommitted Returns the output of a ``git diff --shortstat`` command, comparing the working directory to the HEAD commit. The return variable is supposed to be a cache, set as local in :func:`__lp_set_prompt`, preventing duplicate calls to ``git``. .. versionadded:: 2.0 .. function:: __lp_git_diff_shortstat_unstaged() -> var:_lp_git_diff_shortstat_unstaged Returns the output of a ``git diff --shortstat`` command, comparing the working directory to the staging area. The return variable is supposed to be a cache, set as local in :func:`__lp_set_prompt`, preventing duplicate calls to ``git``. .. versionadded:: 2.0 Load ---- .. function:: __lp_cpu_count() -> var:_lp_CPUNUM Returns the number of CPUs on the machine. The implementation depends on the operating system. .. versionadded:: 2.0 OS -- .. function:: __lp_hostname_hash() -> var:lp_hostname_hash Returns the hash of the hostname as computed by ``cksum``. .. versionadded:: 2.0 Path ---- .. function:: __lp_end_path_left_shortening() Terminate a multi-directory shortening, checking if the shortening actually made a shorter path, and if so, adding the shortened mark. If not, adds the real path to the output. Only used internally by :func:`_lp_path_format`. .. versionadded:: 2.0 .. function:: __lp_get_unique_directory(path) -> var:lp_unique_directory Returns the shortest unique directory prefix matching the real directory input. Only used internally by :func:`_lp_path_format`. .. versionadded:: 2.0 .. function:: __lp_pwd_tilde([path]) -> var:lp_pwd_tilde Returns *path*, or :envvar:`PWD` if *path* is not set, with the user's home directory replaced with a tilde ("~"). .. versionchanged:: 2.0 Renamed from ``_lp_get_home_tilde_collapsed``. Return method changed from stdout. Optional parameter *path* added. Prompt ------ .. function:: __lp_before_command() Used only by Bash to hack the DEBUG trap to run functions before the user command executes. .. versionchanged:: 2.1 Renamed from the Bash version of ``__lp_runtime_before``. .. function:: __lp_set_prompt() Setup features that need to be handled outside of the themes, like :func:`_lp_error` (since last return code must be recorded first), non printing features like :attr:`LP_ENABLE_RUNTIME_BELL` and :attr:`LP_ENABLE_TITLE`, track current directory changes, and initialize data source cache variables. This function also calls the current theme functions. .. versionchanged:: 2.0 Renamed from ``_lp_set_prompt``. Runtime ------- .. function:: __lp_runtime_before() Hooks into the shell to run directly after the user hits return on a command, to record the current time before the command runs. .. versionchanged:: 2.0 Renamed from ``_lp_runtime_before``. .. function:: __lp_runtime_after() Called by :func:`__lp_set_prompt` to run directly after the user command returns, to record the current time and calculate how long the command ran for. .. versionchanged:: 2.0 Renamed from ``_lp_runtime_after``. Theme ----- .. function:: __lp_theme_list() -> var:lp_theme_list Returns an array of Liquid Prompt themes currently loaded in memory. Looks for functions matching ``_lp_*_theme_prompt``. .. versionadded:: 2.0 .. function:: __lp_theme_bash_complete() -> var:COMPREPLY Uses :func:`__lp_theme_list` to provide Bash autocompletion for :func:`lp_theme`. .. versionadded:: 2.0 .. function:: __lp_theme_zsh_complete() Uses :func:`__lp_theme_list` to provide Zsh autocompletion for :func:`lp_theme`. .. versionadded:: 2.0 Title ----- .. function:: __lp_get_last_command_line() -> var:command Returns the whole command line most recently submitted by the user. .. versionadded:: 2.1 .. function:: __lp_print_title_command() Sets the terminal title to the normal set title, postpended with the currently running command. .. versionadded:: 2.1 Temperature ----------- .. function:: __lp_temp_detect() -> var:_LP_TEMP_FUNCTION Attempts to run the possible temperature backend functions below to find one that works correctly. When one correctly returns a value, it is saved to ``_LP_TEMP_FUNCTION`` for use by :func:`_lp_temperature`. .. versionchanged:: 2.0 Renamed from ``_lp_temp_detect``. .. versionchanged:: 2.1 No longer takes arguments of what backends to try. .. function:: __lp_temp_acpi() -> var:lp_temperature A temperature backend using ``acpi``. .. versionchanged:: 2.0 Renamed from ``_lp_temp_acpi``. Return variable changed from ``temperature``. .. function:: __lp_temp_sensors() -> var:lp_temperature A temperature backend using `lm-sensors` provided ``sensors``. .. versionchanged:: 2.0 Renamed from ``_lp_temp_sensors``. Return variable changed from ``temperature``. .. function:: __lp_temp_sysfs() -> var:lp_temperature A temperature backend reading directly from the Linux sysfs file system. .. versionadded:: 2.1 Utility --------- .. function:: __lp_escape(string) -> var:ret Escape shell escape characters so they print correctly in :envvar:`PS1`. In Bash, backslashes (``\``) are used to escape codes, so backslashes are replaced by two backslashes. In Zsh, percents (``%``) are used to escape codes, so percents are replaced by two percents. .. versionchanged:: 2.0 Renamed from ``_lp_escape``. Return method changed from stdout. .. function:: __lp_floating_scale(number, scale) -> var:ret Returns the input floating point *number* multiplied by the input *scale*. The input *scale* must be a power of 10. Shells do not support floating point math, so this is used to scale up floating point numbers to integers with the needed precision. .. versionadded:: 2.0 .. function:: __lp_is_function(function) Returns ``true`` if *function* is the name of a function. .. versionadded:: 2.0 .. function:: __lp_line_count(string) -> var:count Count the number of newline characters (``\n``) in *string*. A faster drop-in replacement for ``wc -l``. .. versionadded:: 2.0 .. function:: __lp_strip_escapes(string) -> var:ret Remove shell escape characters so *string* prints correctly in a terminal title, or can be measured for printing character length. .. versionadded:: 2.1 Wireless -------- .. function:: __lp_wifi_signal_strength_raw() -> var:level Returns the lowest raw wireless signal strength in dBm. Return ``2`` if no data is found. Implementation depends on operating system. This function does not exist on all operating systems. .. versionadded:: 2.1 liquidprompt-2.2.1/docs/functions/public.rst000066400000000000000000000131261464055045500212300ustar00rootroot00000000000000Public Functions **************** These functions are designed to be used by users on the command line or in their config. .. function:: lp_activate() Reload the user config. This function is called when sourcing ``liquidprompt``, unless the flag ``--no-activate`` is passed. The config is sourced, and the environment scanned again for programs needed for specific features. Lastly, :func:`prompt_on` is called to enabled the prompt. .. versionadded:: 2.0 .. function:: lp_title([title_string]) Not to be confused with :func:`_lp_title`. Set *title_string* as the terminal title. This overrides any title set by the current theme. .. note:: The input string is not escaped in any way; if it contains characters that the shell will interpret, the user must escape them if that behavior is not desired. To unset the manual title, call :func:`lp_title` with no arguments. To set a blank title, call :func:`lp_title` with an empty string argument (``''``). This function will do nothing and return ``2`` if :attr:`LP_ENABLE_TITLE` is ``0``. .. versionadded:: 2.0 .. function:: lp_theme(theme_id | --list) Load and activate the theme named *theme_id*. The theme functions must be loaded into memory before :func:`lp_theme` can be called, normally by sourcing the theme file. The optional flag ``--list`` will instead list all currently loaded themes. The variable :envvar:`LP_THEME` can be set to a theme name, which is essentially equivalent to calling this function. :envvar:`LP_THEME` will always hold the currently active theme; it is updated by this function. If :envvar:`LP_THEME` is set to an invalid theme name, it will be reset to the previous value. This function supports shell autocompletion. .. versionadded:: 2.0 .. versionchanged:: 2.2 :envvar:`LP_THEME` reading and setting added. .. function:: lp_terminal_format(foreground_color, [background_color], \ [bold], [underline], \ [fallback_foreground_color], \ [fallback_background_color]) \ -> var:lp_terminal_format Generate a shell escaped terminal formatting string for use in :envvar:`PS1`. The start of the formatting string always resets back to terminal defaults. *foreground_color* and *background_color* accept an `ANSI escape color code`_ integer to set the color of the foreground and background, respectively. The behavior depends on the integer: * ``>= 0 && < max_color`` - The color is used directly. * ``>= max_color`` - If the terminal reports that the number of colors it supports is less than the input color code, the *fallback_foreground_color* or *fallback_background_color* is used instead. * ``-1`` - No color is set. This does not mean that the previous color will continue over, as all formatting is reset to default at the start of the sequence. This means the default coloring is effectively set. * ``-2`` - The previous color of the field is set. If no color was previously set, no color will be set. Note that the output is a static formatting string; the string will not keep the same color as the terminal previously had, but the color that was last selected when :func:`lp_terminal_format` was last run. * ``-3`` - Same as ``-2``, except the opposite field color is copied. In other words, if *foreground_color* is set to ``-3``, it will copy the color of *background_color* the last time :func:`lp_terminal_format` was run. *bold* and *underline* enable their respective formats when set to ``1``. If omitted or set to ``0``, they are not enabled. To use fallback colors, they will need to be set to be able to set the other options. *fallback_foreground_color* and *fallback_background_color* are used when the normal colors are higher than the terminal supported colors. The special negative inputs do not work for these options, and they are not checked for compatibility before being used, so it is recommended that they are in the range ``0-7``. When setting *foreground_color* or *background_color* to negative inputs, these options are never checked. For example, to set the error color to a bright, bold pink, with a fallback color of red:: lp_terminal_format 204 -1 1 0 1 LP_COLOR_ERR=$lp_terminal_format To set the prompt mark color to black on a white background:: lp_terminal_format 0 7 LP_COLOR_MARK=$lp_terminal_format .. versionadded:: 2.0 .. _`ANSI escape color code`: https://en.wikipedia.org/wiki/ANSI_escape_code#Colors .. function:: prompt_on() Enable the prompt generation and setting. This function is called when sourcing ``liquidprompt``, unless the flag ``--no-activate`` is passed. .. function:: prompt_off() Disable the prompt generation and setting, and restore the old :envvar:`PS1`. If the shell is Bash, also restore the old :envvar:`PROMPT_COMMAND`. If the shell is Zsh, also restore the old prompt theme. .. function:: prompt_OFF() Same as :func:`prompt_off`, except instead of restoring the previous :envvar:`PS1`, it is set to "$ " on Bash, "% " on Zsh. .. function:: prompt_tag([prefix_string]) Sets a prefix that will be displayed before every prompt. Postpends a space to the input string. Internally, this function sets :attr:`LP_PS1_PREFIX` to *prefix_string*. If a trailing space is not wanted, set :attr:`LP_PS1_PREFIX` manually. To unset the prefix, call :func:`prompt_tag` with no arguments. liquidprompt-2.2.1/docs/functions/theme.rst000066400000000000000000000344211464055045500210550ustar00rootroot00000000000000Default Theme Functions *********************** .. contents:: :local: These functions are designed to be used by the default theme, but are documented here so that other themes can use these functions to reduce duplication if sections from the default theme are wanted. Theme Functions --------------- .. function:: _lp_default_theme_activate() Setup the defaults and static pieces of the default theme. Uses colors: * :attr:`LP_COLOR_IN_MULTIPLEXER` * :attr:`LP_COLOR_MARK` * :attr:`LP_COLOR_MARK_ROOT` * :attr:`LP_COLOR_PATH_ROOT` * :attr:`LP_COLOR_USER_ALT` * :attr:`LP_COLOR_USER_LOGGED` * :attr:`LP_COLOR_USER_ROOT` And marks: * :attr:`LP_MARK_BRACKET_OPEN` * :attr:`LP_MARK_BRACKET_CLOSE` * :attr:`LP_MARK_DEFAULT` .. versionadded:: 2.0 .. function:: _lp_default_theme_directory() Setup the colors for the directory when the current working directory changes. Uses colors: * :attr:`LP_COLOR_NOWRITE` * :attr:`LP_COLOR_PATH` * :attr:`LP_COLOR_WRITE` And mark :attr:`LP_MARK_PERM`. .. versionadded:: 2.0 .. function:: _lp_default_theme_prompt() Runs :func:`_lp_default_theme_prompt_data` then :func:`_lp_default_theme_prompt_template`. .. versionadded:: 2.0 .. function:: _lp_default_theme_prompt_data() Runs all of the below theme data functions, and writes values to the :doc:`../theme/default` variables. Can be used to generate all the default theme sections, then modify them before running a user template. .. versionadded:: 2.0 .. function:: _lp_default_theme_prompt_template() If :attr:`LP_PS1_FILE` is set, sources it. Then, if :attr:`LP_PS1` is set, uses it as :envvar:`PS1`. Otherwise, uses the default theme layout to construct :envvar:`PS1`. Can be used to set different template sections than the default theme, but still use the same template engine. .. versionadded:: 2.0 Theme Data Functions -------------------- These functions wrap :doc:`data` with color and/or other formatting. Their return codes are the same as the data functions they wrap unless otherwise documented. The interface of the functions will not change between minor versions, but the specific text and formatting may change. .. function:: _lp_analog_time_color() -> var:lp_analog_time_color Returns :func:`_lp_analog_time` with color from :attr:`LP_COLOR_TIME`. .. versionadded:: 2.0 .. function:: _lp_aws_profile_color() -> var:lp_aws_profile_color Returns :func:`_lp_aws_profile` with color from :attr:`LP_COLOR_AWS_PROFILE`. .. versionadded:: 2.1 .. versionchanged:: 2.2 No longer include squared brackets, superseded by :attr:`LP_MARK_DEV_OPEN`, :attr:`LP_MARK_DEV_MID` and :attr:`LP_MARK_DEV_CLOSE`. .. function:: _lp_battery_color() -> var:lp_battery_color Returns data from :func:`_lp_battery`, colored with: * :attr:`LP_COLOR_CHARGING_ABOVE` * :attr:`LP_COLOR_CHARGING_UNDER` * :attr:`LP_COLOR_DISCHARGING_ABOVE` * :attr:`LP_COLOR_DISCHARGING_UNDER` * :attr:`LP_COLORMAP` And using marks: * :attr:`LP_MARK_ADAPTER` * :attr:`LP_MARK_BATTERY` Adds battery value if :attr:`LP_PERCENTS_ALWAYS` is ``1``. .. versionchanged:: 2.0 Return code matches data function. Return method changed from stdout. .. function:: _lp_cmake_color() -> var:lp_cmake_color Returns data from :func:`_lp_cmake`. `lp_cmake_compiler` and `lp_cmake_generator` are colored according to their hash (see :func:`_lp_hash_color`). `lp_cmake_buildtype` has as configurable color, depending on its value: - *Debug*, colored with :attr:`LP_COLOR_CMAKE_DEBUG` (magenta, by default), - *RelWithDebInfo*, colored with :attr:`LP_COLOR_CMAKE_RWDI` (blue, by default), - *Release*, colored with :attr:`LP_COLOR_CMAKE_RELEASE` (cyan, by default), - any other value would be colored according to its hash. .. versionadded:: 2.2 .. function:: _lp_container_color() -> var:_lp_container_color Returns :func:`_lp_container`, surrounded by « and » colored with :attr:`LP_COLOR_CONTAINER` if the value is true. Returns no data if the value is false. .. versionadded:: 2.1 .. versionchanged:: 2.2 No longer include squared brackets, superseded by :attr:`LP_MARK_DEV_OPEN`, :attr:`LP_MARK_DEV_MID` and :attr:`LP_MARK_DEV_CLOSE`. .. function:: _lp_dev_env_color() -> var:lp_dev_env_color Assemble data related to development environment and returns a single string. The returned string starts with :attr:`LP_MARK_DEV_OPEN` and ends with :attr:`LP_MARK_DEV_CLOSE`, with each section separated by :attr:`LP_MARK_DEV_MID`. Data are collected from: - :attr:`LP_SCLS` - :attr:`LP_AWS_PROFILE` - :attr:`LP_CONTAINER` - :attr:`LP_VENV` - :attr:`LP_NODE_VENV` - :attr:`LP_PERL_VENV` - :attr:`LP_RUBY_VENV` - :attr:`LP_TFSPACE` - :attr:`LP_KUBECONTEXT` - :attr:`LP_CMAKE` .. versionadded:: 2.2 .. function:: _lp_dirstack_color() -> var:lp_dirstack_color Returns :func:`_lp_dirstack`, prefixed with :attr:`LP_MARK_DIRSTACK`, all colored with :attr:`LP_COLOR_DIRSTACK`. .. versionadded:: 2.0 .. function:: _lp_disk_color() -> var:lp_disk_color Returns information about available space of the hard drive hosting the current directory. If :attr:`LP_ALWAYS_DISPLAY_VALUES` is ``false``, displays a colored mark (using :attr:`LP_MARK_DISK`), if the available disk space goes below :attr:`LP_DISK_THRESHOLD` or :attr:`LP_DISK_THRESHOLD_PERC`. If it is ``true``, displays the corresponding value, either as a percentage (if :attr:`LP_DISPLAY_VALUES_AS_PERCENTS` is ``true``) or as a human-readable quantity (if :attr:`LP_DISPLAY_VALUES_AS_PERCENTS` is ``false``). The mark and the value itself are colored with :attr:`LP_COLOR_DISK`, while the unit is colored with :attr:`LP_COLOR_DISK_UNITS`. .. versionadded:: 2.2 .. function:: _lp_env_vars_color() -> var:lp_env_vars_color Returns the elements of the array set by :func:`_lp_env_vars`, joined with the :attr:`LP_MARK_ENV_VARS_SEP` marker, and surrounded by :attr:`LP_MARK_ENV_VARS_OPEN` and :attr:`LP_MARK_ENV_VARS_CLOSE`. If a matching environment variable is set, it is colored with :attr:`LP_COLOR_ENV_VARS_SET`, if it is unset, it is colored with :attr:`LP_COLOR_ENV_VARS_UNSET`. See also :attr:`LP_ENV_VARS`. .. versionadded:: 2.2 .. function:: _lp_error_color() -> var:lp_error_color Returns :func:`_lp_error` with color from :attr:`LP_COLOR_ERR`. .. versionadded:: 2.0 .. function:: _lp_error_meaning_color() -> var:lp_error_meaning_color Returns :func:`_lp_error_meaning` with color from :attr:`LP_COLOR_ERR` and surrounded by parentheses. .. versionadded:: 2.2 .. function:: _lp_hostname_color() -> var:lp_hostname_color Returns :func:`_lp_hostname`, with added data from :func:`_lp_chroot`. Color from :attr:`LP_COLOR_HOST`, :attr:`LP_COLOR_SSH`, ``LP_COLOR_HOST_HASH``, and :attr:`LP_COLOR_TELNET`, depending on the output of :func:`_lp_connection`. Added color from :func:`_lp_connected_display`: either :attr:`LP_COLOR_X11_ON` or :attr:`LP_COLOR_X11_OFF`. Return code is :func:`_lp_hostname` `ORed` with :func:`_lp_chroot`: both must return no data for :func:`_lp_hostname_color` to return no data. .. versionadded:: 2.0 .. function:: _lp_http_proxy_color() -> var:lp_http_proxy_color Returns :func:`_lp_http_proxy` with color from :attr:`LP_COLOR_PROXY`. .. versionadded:: 2.0 .. function:: _lp_jobcount_color() -> var:lp_jobcount_color Returns :func:`_lp_detached_sessions` with color from :attr:`LP_COLOR_JOB_D` and :func:`_lp_jobcount` with colors from :attr:`LP_COLOR_JOB_R` and :attr:`LP_COLOR_JOB_Z`. Return code is :func:`_lp_detached_sessions` `ORed` with :func:`_lp_jobcount`: both must return no data for :func:`_lp_jobcount_color` to return no data. .. versionchanged:: 2.0 Return code matches data function. Return method changed from stdout. .. function:: _lp_kubernetes_context_color() -> var:lp_kubernetes_context_color Returns data from :func:`_lp_kubernetes_context`, colored with :attr:`LP_COLOR_KUBECONTEXT` and using mark :attr:`LP_MARK_KUBECONTEXT`. .. versionadded:: 2.1 .. versionchanged:: 2.2 No longer include squared brackets, superseded by :attr:`LP_MARK_DEV_OPEN`, :attr:`LP_MARK_DEV_MID` and :attr:`LP_MARK_DEV_CLOSE`. .. function:: _lp_load_color() -> var:lp_load_color Returns :func:`_lp_load` with color from :attr:`LP_COLORMAP` and mark from :attr:`LP_MARK_LOAD`. Adds load value if :attr:`LP_PERCENTS_ALWAYS` is ``1``. .. versionchanged:: 2.0 Return code matches data function. Return method changed from stdout. .. function:: _lp_node_env_color() -> var:lp_node_env_color Returns :func:`_lp_node_env` with color from :attr:`LP_COLOR_NODE_VENV`. .. versionadded:: 2.1 .. versionchanged:: 2.2 No longer include squared brackets, superseded by :attr:`LP_MARK_DEV_OPEN`, :attr:`LP_MARK_DEV_MID` and :attr:`LP_MARK_DEV_CLOSE`. .. function:: _lp_os_color() -> var:lp_os_color Gather information about the Operating System. Any string encountered in the process may be replaced by a user-defined counterpart, using the :attr:`LP_MARK_OS` configuration array. If the string was not replaced, it is colored with a random color depending on its hash (see :func:`_lp_hash_color`). All fields gathered via the :func:`_lp_os` function are joined with the :attr:`LP_MARK_OS_SEP` string, in the following order: arch, family, kernel, distribution, codename. The corresponding data are returned as a single string via the ``lp_os_color`` variable. The function returns ``2`` if the user disabled the feature with :attr:`LP_ENABLE_OS`, ``1`` if no field was filled in with data, and ``true`` otherwise. .. versionadded:: 2.2 .. function:: _lp_python_env_color() -> var:lp_python_env_color Returns :func:`_lp_python_env` with color from :attr:`LP_COLOR_VIRTUALENV`. .. versionadded:: 2.0 .. versionchanged:: 2.2 No longer include squared brackets, superseded by :attr:`LP_MARK_DEV_OPEN`, :attr:`LP_MARK_DEV_MID` and :attr:`LP_MARK_DEV_CLOSE`. .. function:: _lp_ram_color() -> var:lp_ram_color Returns information about available RAM. If :attr:`LP_ALWAYS_DISPLAY_VALUES` is ``false``, displays a colored mark (using :attr:`LP_MARK_RAM`), if the available ram goes below :attr:`LP_RAM_THRESHOLD` or :attr:`LP_RAM_THRESHOLD_PERC`. If it is ``true``, displays the corresponding value, either as a percentage (if :attr:`LP_DISPLAY_VALUES_AS_PERCENTS` is ``true``) or as a human-readable quantity (if :attr:`LP_DISPLAY_VALUES_AS_PERCENTS` is ``false``). The mark and the value itself are colored with :attr:`LP_COLOR_RAM`, while the unit is colored with :attr:`LP_COLOR_RAM_UNITS`. .. versionadded:: 2.2 .. function:: _lp_perl_env_color() -> var:lp_perl_env_color Returns :func:`_lp_perl_env` with color from :attr:`LP_COLOR_PERL_VENV`. .. versionadded:: 2.2 .. function:: _lp_ruby_env_color() -> var:lp_ruby_env_color Returns :func:`_lp_ruby_env` with color from :attr:`LP_COLOR_RUBY_VENV`. .. versionadded:: 2.1 .. versionchanged:: 2.2 No longer include squared brackets, superseded by :attr:`LP_MARK_DEV_OPEN`, :attr:`LP_MARK_DEV_MID` and :attr:`LP_MARK_DEV_CLOSE`. .. function:: _lp_runtime_color() -> var:lp_runtime_color Returns :func:`_lp_runtime_format` with color from :attr:`LP_COLOR_RUNTIME`. .. versionchanged:: 2.0 Renamed from ``_lp_runtime``. Return code matches data function. Return method changed from stdout. .. function:: _lp_shell_level_color() -> var:lp_shell_level_color Returns :func:`_lp_shell_level`, prefixed with :attr:`LP_MARK_SHLVL`, all colored with :attr:`LP_COLOR_SHLVL`. .. versionadded:: 2.1 .. function:: _lp_software_collections_color() -> var:lp_software_collections_color Returns :func:`_lp_software_collections` with color from :attr:`LP_COLOR_VIRTUALENV`. .. versionadded:: 2.0 .. versionchanged:: 2.2 No longer include squared brackets, superseded by :attr:`LP_MARK_DEV_OPEN`, :attr:`LP_MARK_DEV_MID` and :attr:`LP_MARK_DEV_CLOSE`. .. function:: _lp_sudo_active_color() -> var:lp_sudo_active_color Returns :func:`_lp_sudo_active` with color and marks from :attr:`LP_COLOR_MARK_SUDO` if ``sudo`` is active, or ``LP_COLOR_MARK_NO_SUDO`` if not. Does not return ``1`` if ``sudo`` is not active, as the return string is still needed. .. versionchanged:: 2.0 Renamed from ``_lp_sudo_check``. Always defined instead of only when :attr:`LP_ENABLE_SUDO` is enabled. Return variable changed from ``LP_COLOR_MARK``. .. function:: _lp_temperature_color() -> var:lp_temperature_color Returns :func:`_lp_temperature` with color from :attr:`LP_COLORMAP` and mark from :attr:`LP_MARK_TEMP`. .. versionchanged:: 2.0 Renamed from ``_lp_temperature``. Return code matches data function. Return method changed from stdout. .. function:: _lp_terraform_env_color() -> var:lp_terraform_env_color Returns :func:`_lp_terraform_env` with color from :attr:`LP_COLOR_TERRAFORM`. .. versionadded:: 2.1 .. versionchanged:: 2.2 No longer include squared brackets, superseded by :attr:`LP_MARK_DEV_OPEN`, :attr:`LP_MARK_DEV_MID` and :attr:`LP_MARK_DEV_CLOSE`. .. function:: _lp_time_color() -> var:lp_time_color Returns :func:`_lp_time` with color from :attr:`LP_COLOR_TIME`. .. versionadded:: 2.0 .. function:: _lp_vcs_details_color() -> var:lp_vcs_details_color Returns data from all generic :doc:`data/vcs`, colored with: * :attr:`LP_COLOR_CHANGES` * :attr:`LP_COLOR_COMMITS` * :attr:`LP_COLOR_COMMITS_BEHIND` * :attr:`LP_COLOR_DIFF` * :attr:`LP_COLOR_UP` And using marks: * :attr:`LP_MARK_STASH` * :attr:`LP_MARK_UNTRACKED` This function should only be called when in a VCS repository; use :func:`_lp_find_vcs` or :func:`_lp_vcs_active` before. The return code is undefined; a string should always be returned. .. versionadded:: 2.0 .. function:: _lp_wifi_signal_strength_color() -> var:lp_wifi_signal_strength_color Returns :func:`_lp_wifi_signal_strength` with color from :attr:`LP_COLORMAP` and mark from :attr:`LP_MARK_WIFI`. .. versionadded:: 2.1 liquidprompt-2.2.1/docs/functions/util.rst000066400000000000000000000210151464055045500207230ustar00rootroot00000000000000Utility Functions ***************** These functions are designed to be used by themes. .. function:: _lp_as_text(string) -> stdout .. deprecated:: 2.1 Use :func:`__lp_strip_escapes` instead. Return *string* with all shell escaped substrings removed. .. function:: _lp_bool(variable, [code]) .. deprecated:: 2.0 Stores the *code* in a variable named *variable*. If *code* is not set, uses the last return code instead. .. function:: __lp_bytes_to_human(bytes, [precision]) -> var:lp_bytes, var:lp_bytes_units Convert the given bytes into a human readable format, using binary multiple-byte units. E.g.: KiB instead of KB, 1024 instead of 1000. Precision can be 0, 1 or 2 digits. If not given, precision is two digits. Converted value goes into ``lp_bytes`` and its unit in ``lp_bytes_units``. Note that after petabytes (PiB) of data, Bash and Zsh will start failing at integer computations. .. versionadded:: 2.2 .. function:: _lp_color_map(value, scale=100) -> var:ret Returns a color from the configured or default color map based on *value* and optional *scale*. Values below 0 or above *scale* will be capped. The returned string is a fully escaped terminal formatting sequence. .. function:: _lp_create_link(url, text) -> var:lp_link Adds the *url* link to the given *text*. See :attr:`LP_ENABLE_HYPERLINKS`. .. function:: _lp_create_link_path(path) -> lp_link_path Adds a link on the given path, with the protocol scheme depending on the current connection type. If the current connection is *SSH*, adds an ``SFTP://`` URL, if it is *su* or *lcl* (see :func:`_lp_connection`), adds a ``file://`` one. See also :attr:`LP_ENABLE_HYPERLINKS` and :func:`_lp_create_link`. .. function:: _lp_fill(left, right, [fillstring, [splitends]]) -> var:lp_fill Adds as much *fillstring* (e.g. spaces) between *left* and *right*, so as to make the resulting string the same width as the current terminal. If *fillstring* is omitted, it defaults to one space. If *fillstring* is a string with several characters and *splitends* is 1 (the default), then the final occurrence of *fillstring* will have its end cut, so as to fit the terminal width. If *fillstring* has multiple characters and *splitends* is 0, some spaces will be inserted after the last occurrence of *fillstring*, so as to match the exact width of the terminal. .. note:: Any escaped sequence in *fillstring* will be removed automatically. The end of *left* and the beginning of *right* may be used to add escaped sequences at the beginning and, respectively, the end of the filling sequence. If the available number of columns in the terminal is smaller than the width of *left* and *right* combined, then the function will return code 1 and set *lp_fill* to *left* and *right*, concatenated. For example, ``_lp_fill "Left part·" "·right part" "⣀⠔⠉⠢" 1`` will render (in a terminal being 32 characters large): Left part·⣀⠔⠉⠢⣀⠔⠉⠢⣀⠔⠉·right part .. versionadded:: 2.2 .. function:: _lp_formatted_title(title) Sets the theme generated title to *title*. The input is escaped using :func:`__lp_strip_escapes` to strip terminal formatting from being added to the title. This function will do nothing and return ``2`` if :attr:`LP_ENABLE_TITLE` is disabled. .. versionadded:: 2.0 .. function:: _lp_grep_fields(filename, delimiter, keys...) -> var:lp_grep_fields Parse the given filename for one key/value pairs of the form "" (e.g. "this=that") on each line. Sets an array containing the parsed values, for each key in the same order the function was called. .. code-block:: sh :caption: Example of use _lp_grep_fields "CMakeCache.txt" "=" "CMAKE_C_COMPILER:FILEPATH" "CMAKE_CXX_COMPILER:FILEPATH" cmake_c_compiler=${lp_grep_fields[_LP_FIRST_INDEX+0]-} cmake_cxx_compiler=${lp_grep_fields[_LP_FIRST_INDEX+1]-} .. note:: Bash and Zsh are using different array indexing schemes. To write portable code, you should use ``_LP_FIRST_INDEX``. .. warning:: It is strongly advised not to loop over the items in `lp_grep_fields`. If a searched key is missing in the file, its corresponding entry in the array will be silently skipped, and thus the indices you would expect may lead to unset variables. Just use explicit indexing to access the parsed values. Returns 1 if the file does not exists. .. versionadded:: 2.2 .. function:: _lp_hash_color(str) -> var:lp_hash_color Colorize the given string with a color depending on its hash. The color is chosen among: (green, yellow, blue, purple, cyan). Note that the red color is not a candidate, as it should be reserved for alerts. .. versionadded:: 2.2 .. function:: _lp_join(delimiter, items...) -> var:lp_join Join all strings in items with the given delimiter. Example: ``_lp_join ", " "a" "b" "c"`` will render ``lp_join="a, b, c"`` .. versionadded:: 2.2 .. function:: _lp_raw_title(title) Sets the theme generated title to *title*. The input is not escaped in any way: if the input contains terminal formatting, use :func:`_lp_formatted_title` instead. This function will do nothing and return ``2`` if :attr:`LP_ENABLE_TITLE` is disabled. .. versionadded:: 2.0 .. function:: _lp_sb(string) -> stdout .. deprecated:: 2.0 Use the return code of the source data function to determine if any string was returned. If *string* is set and not empty, returns *string* padded with an extra space on the right and the left. .. function:: _lp_sl(string) -> stdout .. deprecated:: 2.0 Use the return code of the source data function to determine if any string was returned. If *string* is set and not empty, returns *string* padded with an extra space on the left. .. function:: _lp_sr(string) -> stdout .. deprecated:: 2.0 Use the return code of the source data function to determine if any string was returned. If *string* is set and not empty, returns *string* padded with an extra space on the right. .. function:: _lp_smart_mark([vcs_type], [vcs_subtype]) -> var:lp_smart_mark Returns a string set to the configured mark matching *vcs_type*. If *vcs_type* is not set, uses the value of ``lp_vcs_type`` instead. If the type is "git", matches *vcs_subtype* to see if the repository is of type VCSH or ``git-svn`` instead, and return their marks if so. If *vcs_subtype* is not set, uses the value of ``lp_vcs_subtype`` instead. .. versionchanged:: 2.1 Added *vcs_subtype* argument. .. function:: _lp_substitute(string, pairs_array) -> var:lp_substitute If the given string is found in the given array of pairs, return the second element of the pair for which the first element matches the string. For instance: .. code-block:: shell pairs=( "A" "B" # Replace A by B. "something" "dead pixels" "I see" "nothing" ) _lp_substitute "something" "${pairs[@]}" # "$lp_substitute" == "dead pixels" .. versionadded:: 2.2 .. function:: _lp_title(title) -> stdout Not to be confused with :func:`lp_title`. .. deprecated:: 2.0 Use :attr:`_lp_formatted_title` instead. Formats *title* with title escape codes. The input is escaped using :func:`__lp_strip_escapes` to strip terminal formatting from being added to the title. The output should be added to :envvar:`PS1` to be printed as a title. This function will do nothing if :attr:`LP_ENABLE_TITLE` is disabled. .. function:: _lp_version_greatereq(major, minor, [patch, [string, [number]]]) Returns true (0) if Liquid Prompt version is greater than or equal to the the given version. Returns 1 (false) if there is a *minor* or less version difference, and 2 (false) if it is a *major* difference. See also :func:`_lp_version_string`. .. warning:: This only supports the following input values for `strings`: "alpha", "beta" and "rc". .. versionadded:: 2.2 .. function:: _lp_version_string([major, [minor, [patch, [string, [number]]]]]) -> var:lp_version Formats the given version number in a version string of the form: "${major}.${minor}.${patch}-${string}.${number}" If no version is given, formats the current version number of Liquid Prompt. If a version number is given, *major* and *minor* are both mandatory. See also :func:`_lp_version_greatereq`. .. versionadded:: 2.2 liquidprompt-2.2.1/docs/index.rst000066400000000000000000000027031464055045500170500ustar00rootroot00000000000000.. Liquid Prompt documentation master file, created by sphinx-quickstart on Wed Nov 18 11:00:53 2020. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Liquid Prompt's documentation ============================= *Liquid Prompt* is an adaptive prompt for Bash & Zsh that gives you a nicely displayed prompt with useful information when you need it. It does this with a powerful theming engine and a large array of data sources. If you just want a short overview of the main Liquid Prompt features, see the ":doc:`overview`" section. To actually get started, view the :doc:`install` documentation, which includes instructions for trying Liquid Prompt temporarily. To know more about the available features, see the :doc:`theme` section, which has some explanations on what's displayed on your prompt, and the :doc:`config`, which lists all that change the behavior of the prompt. For making your own theme, see the :doc:`theme/custom` section. If you need to dig more in the code, you can browse the :doc:`functions` section. To check what changed in a release, check the :doc:`release-notes`, and if you plan to do an upgrade, see :doc:`upgrading`, and look for *deprecated options*. .. toctree:: :maxdepth: 2 :caption: Contents: overview install config theme functions release-notes upgrading Indices and tables ================== * :ref:`genindex` * :ref:`search` liquidprompt-2.2.1/docs/install.rst000066400000000000000000000072771464055045500174220ustar00rootroot00000000000000Installation ************ .. contents:: :local: .. toctree:: :maxdepth: 1 install/packages .. spelling:word-list:: gzip Zinit Download ======== You can either download the latest release from Github, or using your OS package manager with our :doc:`install/packages`. To download to ``~/liquidprompt``, run:: git clone --branch stable https://github.com/liquidprompt/liquidprompt.git ~/liquidprompt Or, if you want to use the development (non-stable) branch:: git clone https://github.com/liquidprompt/liquidprompt.git ~/liquidprompt If you do not have ``git``, you can download and extract the source in zip or gzip format directly from the `release page `_. Installation via Antigen ------------------------ To install via `Antigen `_, simply add the following line in your ``.zshrc`` after activating Antigen:: antigen bundle liquidprompt/liquidprompt Installation via Zinit ---------------------- To install via `Zinit `_, simply add the following lines in your ``.zshrc`` after activating Zinit:: zinit ice ver"stable" lucid nocd zinit light liquidprompt/liquidprompt Dependencies ============ Liquid Prompt uses commands that should be available on a large variety of Unix systems: * ``awk`` * ``grep`` * ``logname`` * ``ps`` * ``sed`` * ``uname`` Some features depend on specific commands. If you do not install them, the corresponding feature will not be available, but no error will be displayed. See the :doc:`config` for more information about available features and what tools they require. * Terminal formatting requires ``tput``. * Time display requires ``date``. * Detached session status looks for ``screen`` and/or ``tmux``. * VCS support features require ``git``, ``hg``, ``svn``, ``bzr`` or ``fossil`` for their respective repositories. Test Drive ========== To test the prompt immediately after download, run:: source ~/liquidprompt/liquidprompt Adjust the path if you installed to a different location than the suggested ``~/liquidprompt``. .. _shell-installation: Shell Installation ================== To use Liquid Prompt every time you start a shell, add the following lines to your ``.bashrc`` (if you use Bash) or ``.zshrc`` (if you use zsh):: # Only load Liquid Prompt in interactive shells, not from a script or from scp [[ $- = *i* ]] && source ~/liquidprompt/liquidprompt Adjust the path if you installed to a different location than the suggested ``~/liquidprompt``. .. warning:: Check in your ``.bashrc`` that the :envvar:`PROMPT_COMMAND` variable is not set, or else the prompt will not be available. If you must set it or use a add-on that sets it, make sure to set :envvar:`PROMPT_COMMAND` **before** you source Liquid Prompt to avoid history, timing, or error display issues. Do not export :envvar:`PROMPT_COMMAND`. .. warning:: If you are using `bash-preexec `_, be aware that bash-preexec **must** come **before** liquidprompt in your ``.bashrc``. This contradicts their documentation, which says `"[bash-preexec] must be the last thing imported in your bash profile" `_, but since Liquid Prompt special-cases bash-preexec, it must be loaded after bash-preexec. The order should always be: #. Anything that references :envvar:`PROMPT_COMMAND` #. bash-preexec (optional) #. liquidprompt #. Anything that references ``precmd_functions`` or ``preexec_functions`` (if using bash-preexec) Next up are the :doc:`config`. liquidprompt-2.2.1/docs/install/000077500000000000000000000000001464055045500166535ustar00rootroot00000000000000liquidprompt-2.2.1/docs/install/packages.rst000066400000000000000000000053411464055045500211660ustar00rootroot00000000000000Packages ******** .. contents:: :local: Liquid Prompt is packaged for many operating systems, though the latest version in those repositories is not always up to date. Latest Versions =============== .. image:: https://repology.org/badge/vertical-allrepos/liquidprompt.svg :alt: Liquid Prompt packaging status Source: `repology.org `_. Install commands ================ Archlinux --------- Liquid Prompt is not available in the official repositories. However someone provides a ``PKGBUILD`` on AUR. Liquid Prompt is not responsible for this recipe, thus use it at your own risk. .. image:: https://repology.org/badge/version-for-repo/aur/liquidprompt.svg :alt: Archlinux User package :target: https://aur.archlinux.org/packages/liquidprompt Please refer to the `Archlinux documentation`_ to know how to use it, if you are unsure. .. _Archlinux documentation: https://wiki.archlinux.org/title/Arch_User_Repository Debian ------ ... and Debian derivatives. .. image:: https://repology.org/badge/version-for-repo/debian_unstable/liquidprompt.svg :alt: Debian Unstable package :target: https://packages.debian.org/source/liquidprompt .. image:: https://repology.org/badge/version-for-repo/ubuntu_22_04/liquidprompt.svg :alt: Ubuntu 22.04 package :target: https://packages.ubuntu.com/source/liquidprompt .. image:: https://repology.org/badge/version-for-repo/mx_19_testing/liquidprompt.svg :alt: MX Linux MX-19 Testing package :target: http://mxrepo.com/mx/testrepo/pool/test/l/liquidprompt/ .. code-block:: apt-get install liquidprompt A small script, ``liquidprompt_activate`` (not to be confused with :func:`lp_activate`) is included to ease activation of the prompt, which can be used instead of the :ref:`shell-installation` instructions. This will set the required environment: * The files ``~/.bashrc`` and/or ``~/.zshrc`` are modified to load Liquid Prompt at startup. * If no previous ``~/.config/liquidpromptrc`` file exists, it will be created. So, to get Liquid Prompt working simply run: .. code-block:: liquidprompt_activate source ~/.bashrc # or ~/.zshrc Be aware that multiple invocations of the ``liquidprompt_activate`` command may pollute ``~/.bashrc`` and/or ``~/.zshrc`` files. Homebrew -------- .. image:: https://repology.org/badge/version-for-repo/homebrew/liquidprompt.svg :alt: Homebrew package :target: https://formulae.brew.sh/formula/liquidprompt .. code-block:: brew install liquidprompt Nix --- .. image:: https://repology.org/badge/version-for-repo/nix_unstable/liquidprompt.svg :alt: nixpkgs unstable package :target: https://search.nixos.org/packages?query=liquidprompt .. code-block:: nix-env -i liquidprompt liquidprompt-2.2.1/docs/liquidprompt_emblem.svg000066400000000000000000007631631464055045500220200ustar00rootroot00000000000000 Liquid Prompt Emblem nojhan, dolmen, Rycieos & co~ https://github.com/ liquidprompt/liquidpromptLiquid Prompt Emblem2022-08-22nojhanLiquid PromptBashZshAGPL~$>https://raw.githubusercontent.com/liquidprompt/liquidprompt/master/docs/liquidprompt_emblem.svgen_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". liquidprompt-2.2.1/docs/make.bat000066400000000000000000000013701464055045500166130ustar00rootroot00000000000000@ECHO OFF pushd %~dp0 REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set SOURCEDIR=. set BUILDDIR=_build if "%1" == "" goto help %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.http://sphinx-doc.org/ exit /b 1 ) %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% goto end :help %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% :end popd liquidprompt-2.2.1/docs/overview.rst000066400000000000000000000251771464055045500176210ustar00rootroot00000000000000 Why Liquid Prompt? ================== Liquid Prompt gives you a **carefully designed prompt** with useful information. It shows you what you need when you need it. You will notice what changes *when* it changes, saving time and frustration. You can even use it with your favorite shell – Bash or zsh. Below are screenshots of typical states that you would see in everyday use. Using the default theme: .. image:: theme/default-med.png :alt: 1& [user@server:~/liquidprompt] main ± The Unfold theme, very similar to the default theme, but spread on two lines and a right-aligned section: .. image:: theme/included/unfold-med.png Using the Powerline theme: .. image:: theme/included/powerline-med.png :alt:   server  user  ~  liquidprompt  1   main   There are many prompts configurations out there, but here is what makes Liquid Prompt stand out: - **UX Design**: Liquid Prompt was very carefully design from the beginning, to allow for the best user experience. That is, it displays *meaningful* information with *minimal visual clutter* and *maximum readability*. While most of the other prompts are focused on aligning as much colored "segments" as possible on top of each others to look fancy, Liquid Prompt focus on what really matters. - **Ease of use**: Liquid Prompt is written in (*heavily optimized*) portable Shell, and its installation is as easy as copying files. It also provides pre-defined themes, enabled by a simple command in your shell configuration. Configuration is as simple as editing text files with key/value pairs. No complex format to learn. - **Shell features first**: Liquid Prompt helps you being aware of all the powerful features a modern shell can provide. While most other prompts focus on covering a lot of (boring) software version tags, Liquid Prompt shows you the features that are actually useful while you actually use the shell. - **Configurability**: All aspects of Liquid Prompt are configurable, down to the core. Features overview ================= Liquid Prompt has good support of shell-related features, various version control systems, and several software configuration environments. To browse the complete list of capabilities, see :doc:`config`. Shell Essentials ---------------- These are some of the most popular features: - **Current path**: displays where you are, highlighting the important parts (current directory, version control repository root), smart path shortening. - **Last command execution time**: if the last executed command took too long, display how much time it took. - **Battery level**: show what charge remains in the battery if it's close enough to empty. - **Username**: display the user name if it's not the login one. - **Hostname**: indicate the hostname if over a remote connection, with host-specific color. - **Exit code**: display the last command's exit code if it was an error. - **Jobs**: show counters for background, sleeping, and detached jobs. - **Time**: display the current time, using clock icons if you want a compact view. - **Memory**: display the available memory, if not enough RAM remains. - **Filesystem permission**: indicate if the current directory is writable or not. - **System load**: warn if the load is too high. - **Remote shell**: discreetly denote if you are connected through SSH, under Tmux and with X Forwarding capability. - **Disk**: display the free disk space if it is too small. - **Shell level**: displays the number of nested shells if it starts being too much. - **Sudo**: show if the user currently has *sudo* rights. - **Multiplexers**: indicate if you are in a terminal multiplexer session (i.e. tmux or screen). - **Proxy**: indicate whether a proxy is configured. - **Temperature**: warn if the temperature goes too high. - **Hot prompt switch**: commands allowing you to rapidly switch the theme, go back to the default prompt, or even the most simple prompt possible. - **Wifi**: shows the wireless network signal strength. - **Dir stack**: helps you follow the state of this overlooked, but neat, feature of modern shells. - **Title**: synchronize the prompt and the terminal's window title (or status bar). Version Control --------------- Liquid Prompt has one of the most comprehensive supports for source code management systems living in the shell. It has near-to-complete support for: - **Git**, - **Mercurial**, - **Subversion**, - **Fossil**, - **Bazaar**. It shows the current branch/tags, its state, and several statistics on the current commits/edits. Software Configuration Environments ----------------------------------- Modern development environments love to use abstractions on top of software packages. Liquid Prompt helps you knowing which one is currently in use where you are: - **AWS**, - **Conda**, - **Python venv**, - **Kubernetes**, - **Terraform**, - **Docker**, - **Container**, - **Node env**, - **Perl venv**, - **Ruby venv**, - **Software Collections**, - **CMake**. Those show up only if you enter a configured directory, or have configured environment variables. Features Disabled by Default ---------------------------- Some features are disabled by default, generally because they are expected to be rarely used or to not behave consistently on *all* systems. You may want to enable those features, by setting the following configuration variables to **1** in your configuration file(s) (see the :doc:`config` section to find out how to do it). Shell essentials: - :attr:`LP_ENABLE_DIRSTACK` - :attr:`LP_HOSTNAME_ALWAYS` - :attr:`LP_ENABLE_RUNTIME_BELL` - :attr:`LP_ENABLE_SSH_COLORS` - :attr:`LP_ENABLE_SUDO` (double-check with your sysadmin if you can enable that) - :attr:`LP_ENABLE_DISK` - :attr:`LP_ENABLE_ERROR_MEANING` - :attr:`LP_ENABLE_ERROR_MEANING_EXTENDED` Operating System: - :attr:`LP_ENABLE_OS` - :attr:`LP_ENABLE_OS_ARCH` - :attr:`LP_ENABLE_OS_FAMILY` - :attr:`LP_ENABLE_OS_DISTRIB` Development/environments: - :attr:`LP_ENABLE_VCS_REMOTE` - :attr:`LP_ENV_VARS` is empty by default (but :attr:`LP_ENABLE_ENV_VARS` is enabled). - :attr:`LP_ENABLE_CMAKE` - :attr:`LP_ENABLE_CONTAINER` (may behave inconsistently) - :attr:`LP_ENABLE_KUBECONTEXT` - :attr:`LP_ENABLE_KUBE_NAMESPACE` - :attr:`LP_ENABLE_NODE_VENV` - :attr:`LP_ENABLE_TERRAFORM` - :attr:`LP_ENABLE_MODULES_HASHCOLOR` Miscellaneous: - :attr:`LP_ENABLE_TIME` - :attr:`LP_TIME_ANALOG` - :attr:`LP_ENABLE_TITLE` (may behave inconsistently on exotic terminals) - :attr:`LP_ENABLE_SCREEN_TITLE` - :attr:`LP_ENABLE_WIFI_STRENGTH` (Linux or MacOS) - :attr:`LP_ENABLE_HYPERLINKS` (not supported by all terminal emulators) Disabled by default for security: - :attr:`LP_ENABLE_VCS_ROOT` (enable at your own risk!) Known Limitations and Bugs -------------------------- - Does not display the number of commits to be pushed in Mercurial repositories. - Browsing very large Subversion repositories may dramatically slow down the display of Liquid Prompt (use :attr:`LP_DISABLED_VCS_PATHS` to avoid that). - Subversion repositories cannot display commits to be pushed because that's not how Subversion works. - The window's title escape sequence may not work properly on some terminals (like `xterm-256`). - The analog clock requires a Unicode-aware terminal and at least a sufficiently complete font on your system. The `Symbola `_ font, designed by Georges :spelling:word:`Douros`, is known to work well. On Debian or Ubuntu install try the `fonts-symbola` or `ttf-ancient-fonts` package. "Powerline" and "Nerd" fonts also have the appropriate symbols. - The ``sudo`` feature is disabled by default as there is no way to detect if the user has ``sudo`` rights without triggering a security alert that will annoy the sysadmin. Competitors ----------- All prompt systems tend to focus on some feature sets. If you don't like Liquid Prompt's design, you may be interested in one of those popular prompts: - `Starship `_: focused on showing development contexts, across various shells. Probably the largest set of detected languages. - `Spaceship `_: similar spirit to :spelling:word:`Starship` (with a few fewer features), but only for Zsh. - `Oh-My-Posh `_: tries to support a little bit of everything, across various shells, largest set of themes (albeit not very diverse). - `Powerlevel10k `_: the most popular on Github, focused on fancy features (like transitive prompt), but to the expense of the UX. Only supports Zsh. - `Powerline `_: primarily a daemon-based status line generator, hence with good support for latency-expensive features. Probably the largest feature set for various services status. - `Pure `_: quite popular, despite focusing on being minimalist (only supports Zsh, Git, and a few shell features). The following table compares those prompts systems in details. .. warning:: This information has been gathered by *nojhan*, one of the authors of Liquid Prompt. As such, it is highly subjective. Judgments made about the levels of support are extremely arbitrary. Take this with a grain of salt. In this table, the numbers in cells figure the level of quality of the feature. *Popularity* is the sum of levels in the row. *Support* lines are the sum of levels in the column, for each *category* section. *Category* sections are sorted from top to bottom based on their average popularity. Projects are sorted from left to right, based on their *support* score in the *essentials* section. .. image:: prompts_comparison.svg :alt: A long table with 10 columns and 155 lines. License ------- Liquid Prompt is distributed under the `GNU Affero General Public License version 3 `_. To comply with the AGPL clauses, anybody offering Liquid Prompt over the network is *required* to also offer access to the source code of it and allow further use and modifications. As Liquid Prompt is implemented purely in shell script, anybody using it over SSH or equivalent terminal connection automatically also has access to the source code, **so it is easy to comply with the license**. The only case in which you may violate the license is if you provide a shell service but do not allow the user to download your Liquid Prompt version. For instance if you offer an access to a virtual machine through a graphical session, without allowing files transfer. In that case, you are required to explicitly indicate to your users where they may download the code that is running your version of Liquid Prompt (even if you only provide a theme on top of the base code). liquidprompt-2.2.1/docs/prompts_comparison.ods000066400000000000000000001055531464055045500216630ustar00rootroot00000000000000PK|s[Wl9..mimetypeapplication/vnd.oasis.opendocument.spreadsheetPK|s[WConfigurations2/toolbar/PK|s[WConfigurations2/floater/PK|s[WConfigurations2/menubar/PK|s[WConfigurations2/popupmenu/PK|s[WConfigurations2/accelerator/PK|s[WConfigurations2/toolpanel/PK|s[WConfigurations2/progressbar/PK|s[WConfigurations2/statusbar/PK|s[WConfigurations2/images/Bitmaps/PK|s[W manifest.rdf͓n0+9| c"Ww٦S3AvsfҬXs,Y;GRˉ!bOZ?&#EQ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K|s[Wl9..mimetypePK|s[WTConfigurations2/toolbar/PK|s[WConfigurations2/floater/PK|s[WConfigurations2/menubar/PK|s[WConfigurations2/popupmenu/PK|s[W.Configurations2/accelerator/PK|s[WhConfigurations2/toolpanel/PK|s[WConfigurations2/progressbar/PK|s[WConfigurations2/statusbar/PK|s[WConfigurations2/images/Bitmaps/PK|s[Wh Omanifest.rdfPK|s[W }meta.xmlPK|s[W_n% styles.xmlPK|s[W%`uM+ settings.xmlPK|s[W-r"}J}J-Thumbnails/thumbnail.pngPK|s[W1,]META-INF/manifest.xmlPK|s[Wiic'[ T_content.xmlPKeliquidprompt-2.2.1/docs/prompts_comparison.svg000066400000000000000000024743021464055045500217000ustar00rootroot00000000000000 Prompts comparison as of 2022-08CategoryFeatureLiquidpromptStarshipSpaceshipOh-My-PoshPowerlevel10kPowerlinePurePopularityImplementationLanguageShellRustZshGoZshPythonZshLicenseAGPLv3ISCMITMITMITMITMITGithub stars (k)4.22817.27.430.413.411.5Themes222332115ShellsSupport49383837.6Zsh233232318Bash22020208Fish02020206Powershell02020004ipython00000202EssentialsSupport623425222017109.0Current path333313117Last runtime333320317Battery333222015Username333112215Exit code332221013Hostname322112213Jobs322021212Date/time322202011Memory Usage330220010FS Permissions33300009System Load30022209OS30022007Remote shell (SSH, Telne32200007Disk usage30021006SHLVL33000006Sudo32000005Tmux30000205Proxy20002004Hot prompt switch30000003Screen30000003Temperature30000003Version ControlSupport154682336.8Git333321318Mercurial31300108Subversion30020005Bazaar30000104Fossil30010004Plastic00020002EnvironmentsSupport2128181025204.9Kubernetes333120012AWS232130011Conda233021011Python venv222221011Terraform23310009Azure02032007Docker2?300005Docker context03200005Nix-shell03002005Container22000004Node env20002004Ruby venv20002004iTerm200020002Lua env00002002Perl env00002002Scala env00002002Singularity/Apptainer02000002Software Collections20000002Spack02000002Toolbox00002002Environment Modules30000003VCSH01000001MiscSupport12302111003.5Environment Variables32000106WiFi30012006Local IP01002205Extern IP00012104Network Load00002204Dirstack30000003Title30000003Mail00000202Uptime00000202VPN IP00002002direnv00001001Dev contextSupport685374921003.6.NET03222009Go02222008Haskell02222008Rust02222008Node.js02222008Current Shell33020008PHP02220006Ruby02220006Google Cloud (gcloud)02202006Perl02022006Swift02220006CMake31020006Julia02220006Package directory02211006Java02022006Crystal02020004Dart02020004Elixir02200004Elm02200004Python02020004R02020004Flutter00022004Kotlin02020004Lua02020004IBM cloud00300003Angular00020002Buf02000002Bun02000002C02000002CDS (SAP CAP)00020002Cloud Foundry00020002COBOL02000002Daml02000002Deno02000002Ember.js00200002Erlang02000002Gradle00200002Helm02000002Maven00200002Nim02000002OCaml02000002OpenStack02000002Pulumi02000002PureScript02000002Raku02000002Red02000002Scala02000002UI5 Tooling00020002V02000002Vagrant02000002Zig02000002asdf00002002Xcode00200002NPM00020002GCP00010001NX00010001ServicesSupport0001542502.5Weather00020204Brewfather00030003CMUS00000303DBUS00000303iTunes00000303MOCPS00000303MPD00000303RDIO00000303Rhythmbox00000303Nightscout00003003Clementine00000202Spotify00020002Strava00020002Wakatime00020002Withings00020002YouTube Music00020002Taskwarrior00001001 liquidprompt-2.2.1/docs/release-notes.rst000066400000000000000000000007271464055045500205130ustar00rootroot00000000000000Release Notes ************* The release documents here are a brief overview of the most important changes in a release. See the `Changelog`_ for a full description of what has changed. For a full description of what a user needs to do to upgrade, see :doc:`upgrading`. .. _`Changelog`: https://github.com/liquidprompt/liquidprompt/blob/master/CHANGELOG.md .. toctree:: :maxdepth: 2 :reversed: release-notes/v1.12 release-notes/v2.0 release-notes/v2.1 liquidprompt-2.2.1/docs/release-notes/000077500000000000000000000000001464055045500177535ustar00rootroot00000000000000liquidprompt-2.2.1/docs/release-notes/v1.12.rst000066400000000000000000000022151464055045500212540ustar00rootroot00000000000000Version 1.12 Release Notes ************************** Most of the changes in 1.12 are accumulated bug fixes, but a few features made it in as well. .. contents:: :local: Runtime Bell ============ A new feature, similar to the displayed last command runtime, is to ring the terminal bell when the running command exits, if the runtime was over a threshold. This can be used to notify when a long running command has finished. See the :attr:`LP_ENABLE_RUNTIME_BELL` and :attr:`LP_RUNTIME_BELL_THRESHOLD` config options. Permissions Mark ================ The ``:`` mark between the hostname and the current directory was a constant string, but now it has a config option: :attr:`LP_MARK_PERM`. Preset Color Aliases ==================== The ``5`` value of the basic colors is often named "magenta", but in Liquid Prompt it has always been "purple", and the bold version is "pink". To make the options more standard, an alias for ``PURPLE`` is ``MAGENTA``, and ``PINK`` now has aliases of ``BOLD_PURPLE`` and ``BOLD_MAGENTA``. Speed Improvements ================== Improvements to the startup process have cut startup times by at least 30% in all cases. liquidprompt-2.2.1/docs/release-notes/v2.0.rst000066400000000000000000000066111464055045500211760ustar00rootroot00000000000000Version 2.0 Release Notes ************************* Version 2.0 had to break a few eggs, but got a lot of reward out of it. This release is full of new features and improvements. .. contents:: :local: Speed Improvements ================== By removing subshells, ``exec``, and other ``fork``\ :spelling:word:`ing` calls, the whole project has seen incredible speed improvements, anywhere from 1.5 to 10 times as fast. Theme Engine ============ Thanks to the new data source functions (see below), themes are able to change *everything* about how the prompt is displayed, instead of only color and element order. See :doc:`../theme`. Example Themes ============== Liquid Prompt now ships with some example themes showcasing how the new theme engine works. They are also fulling working themes that you can use as your daily drivers. See :doc:`../theme/included`. Data Sources ============ To power the themes, all of the data sources in Liquid Prompt have been broken out into individual data functions that can be called by themes. They are also documented in detail in :doc:`../functions/data`. Path Advanced Formatting ======================== The current directory path has had an overhaul, now supporting formatting for different path sections, highlighting the last directory and the VCS repository root directory. Any shortened directories are lowlighted instead. Multiple path shortening methods are now supported as well. See :attr:`LP_PATH_METHOD` and :attr:`LP_COLOR_PATH` for more information. Version Control Interface ========================= Before, each version control provider had its own function for displaying repository information. Now there is a unifying interface over all VCS providers that themes can use to display any VCS provider the same as all the others. See :doc:`../functions/data/vcs`. The default theme now uses this interface to display all VCS providers in the same way (similar to how Git was displayed before). See :doc:`../functions/theme`. Version Control Tracking updates without directory change ========================================================= Before, if ``git init`` or similar was run in a directory, Liquid Prompt would not display any repository information until the current directory was changed. Thanks to the speed improvements, Liquid Prompt now checks for a repository at each prompt, while still being faster than version 1.12. Activate Function ================= Before, when changing the user config file, a user needed to source ``liquidprompt`` again to load their config changes (or ``exec bash`` or ``exec zsh``). Now that all of the initialization code has been refactored into :attr:`lp_activate`, running :attr:`lp_activate` after modifying the config file or installing a new feature dependent program like ``git`` is all that is needed! Documentation ============= The often lacking README documentation has been re-written with Sphinx to make this much improved documentation source. Unit Tests ========== A whole suite of unit tests has been added to test the data and utility functions. A handful of bugs were caught using the tests, so the investment has already paid off! Directory Stack Feature ======================= Shell directory stack display is now in the prompt! If there are directories on the stack (from ``pushd``), the number of directories in the stack is shown next to the current path. See :attr:`LP_ENABLE_DIRSTACK` for more information. liquidprompt-2.2.1/docs/release-notes/v2.1.rst000066400000000000000000000037041464055045500211770ustar00rootroot00000000000000Version 2.1 Release Notes ************************* Version 2.1 has a whole host of new data sources, features, and compatibility fixes. .. contents:: :local: Title Command ============= Liquid Prompt can now display the currently running command as part of the terminal title. See :attr:`LP_ENABLE_TITLE_COMMAND` for more information. Development Environments ======================== Multiple new development environments are now detected and displayed, including AWS profiles, container environment, ``kubectl`` context, Node.js, Ruby, and Terraform workspace. Some of these sections are disabled by default, so see their respective config options for more details and how to enable them: - :attr:`LP_ENABLE_AWS_PROFILE` - :attr:`LP_ENABLE_CONTAINER` - :attr:`LP_ENABLE_KUBECONTEXT` - :attr:`LP_ENABLE_NODE_VENV` - :attr:`LP_ENABLE_RUBY_VENV` - :attr:`LP_ENABLE_TERRAFORM` Linux sysfs interface ===================== Both battery and temperature information now support reading from the sysfs interface on Linux. This means ``sensors`` and ``acpi`` are no longer required to get battery and temperature information, and the data source is much faster. Wireless Signal Strength ======================== A new feature exists to track wireless signal strength, and display the value if it falls below a threshold, similar to the battery feature. See :attr:`LP_ENABLE_WIFI_STRENGTH` for more information. Shell Nesting Level =================== A new feature to display the number of nested shells. See :attr:`LP_ENABLE_SHLVL` for more information. ShellCheck ========== The whole project is now checked with `ShellCheck`_, which has already caught a few issues, and will help prevent regressions. .. _ShellCheck: https://www.shellcheck.net/ Bash-preexec Compatibility ========================== Liquid Prompt now supports running along side `bash-preexec`_. Simply load Liquid Prompt `after` bash-preexec. .. _bash-preexec: https://github.com/rcaloras/bash-preexec liquidprompt-2.2.1/docs/requirements.txt000066400000000000000000000004331464055045500204710ustar00rootroot00000000000000sphinx>=5.2.0,<5.3.0 sphinx_rtd_theme>=1.0.0,<1.1.0 # Might need libenchant installed from OS package manager to work. sphinxcontrib-spelling>=7.6.1,<7.7.0 # Claims to need Python 3.7+, but works fine on Python 3.6. Installed using --ignore-requires-python sphinx-lint>=0.6.7,<0.7.0 liquidprompt-2.2.1/docs/spelling_wordlist.txt000066400000000000000000000012231464055045500215100ustar00rootroot00000000000000Archlinux CMake Ctrl Cygwin DragonFly FreeBSD Github Homebrew KiB Makefiles MinGW OpenBSD Perlbrew PiB SunOS Tmux Unicode ada autocompletion backend backends basename chroot codename conda config customizable dBm deprecations filename filepath hostname incrementing js kibi kubernetes liquidprompt lowlighted multi namespace podman postpend postpended postpends powerline pre preexec rc rebase refactored runtime shareable startup stdout stdout subdirectory subshells substring substrings subtype subtypes sysfs systemd templated templating terraform theming tmux ubuntu unstaged untracked username virtualenv whitespace wifi workspace worktree worktrees zsh liquidprompt-2.2.1/docs/theme.rst000066400000000000000000000043241464055045500170440ustar00rootroot00000000000000Theming ******* Liquid Prompt has a strong data and theming engine, allowing it to be extremely flexible and customizable. The :doc:`theme/default` has a templating engine (previously called "themes" in Liquid Prompt version 1), that allows for custom prompt ordering in the default theme. If you just want to change icons and/or colors, you can just rely on "presets", which are just regular configuration files. Presets can generally be combined, and some themes may use —or be compatible with— different presets. See :doc:`config`. Liquid Prompt ships with some :doc:`theme/included` other than the default as well. See the `Liquid Prompt Theme List`_ on the wiki for user created themes. If you want to create your own theme, see :doc:`theme/custom`. .. _`Liquid Prompt Theme List`: https://github.com/liquidprompt/liquidprompt/wiki/Themes .. toctree:: :maxdepth: 2 theme/default theme/included theme/custom .. contents:: :local: Switching Themes ================ In a nutshell ------------- To use a theme, just source its file in your shell configuration file, after having load the liquidprompt, and then call ``lp_theme``:: source /liquidprompt source /themes/unfold/unfold.theme lp_theme unfold More Details ------------ Liquid Prompt can switch between themes on the fly. The shell does not need to be reloaded, and no files need to be sourced after the initial source. To load (but not activate) a theme, simply source the theme file. For example, to load the included Alternate VCS Details theme, source the theme file:: $ source themes/alternate_vcs/alternate_vcs.theme Now both the default theme and Alternate VCS are loaded. To show what themes are loaded and available, run :func:`lp_theme`:: $ lp_theme --list default alternate_vcs To switch to a different theme, call :func:`lp_theme` with the name of the theme as the argument:: $ lp_theme alternate_vcs The prompt will immediately take on the new theme. To switch back to the default theme, call :func:`lp_theme` again with ``default`` as the argument instead. If you add the theme source commands to your shell startup file, you will have your favorite themes ready to be switched to at any time. liquidprompt-2.2.1/docs/theme/000077500000000000000000000000001464055045500163075ustar00rootroot00000000000000liquidprompt-2.2.1/docs/theme/custom.rst000066400000000000000000000070321464055045500203550ustar00rootroot00000000000000Custom Themes ************* .. contents:: :local: Defining a Theme ================ A theme should be contained in one file with a ``.theme`` file suffix. There should be no "top level" code in the file, or in other words, all code should be contained in functions. Sourcing the file should run no code, as a user sourcing the theme file might not want to activate it yet. Prompt Function --------------- Every theme must have a prompt function that is called for every prompt to generate the prompt. It *must* be set to ``_lp__theme_prompt()``. This function could do anything, but generally it should generate a prompt and store it in :envvar:`PS1`. Directory Function ------------------ Optionally, a theme can have a directory function. It must be set to ``_lp__theme_directory()``. This function is called every time the user changes directories. This allows the theme to only run generating code that depends on the current directory when it is needed. Activate Function ----------------- Optionally, a theme can have an activate function. It must be set to ``_lp__theme_activate()``. This function is called when the theme is first activated, and every time the user runs :func:`lp_activate`. Prompt pieces that never change (such as hostname and username) should be generated here. This is also where the theme's default values should be set. This function will always be called after the user config is already loaded. Version Check Function ---------------------- Optionally, a theme can have a Liquid Prompt version check function. It must be set to ``_lp__theme_version_check()``. This function is called when the theme is first activated. It is used to validate that the version of Liquid Prompt is equal to or greater than what the theme requires. Liquid Prompt handles the checking and error handling. Simply set the array variable ``lp_version_check`` with the version your theme requires:: _lp_custom_theme_version_check() { lp_version_check=(2 2 0 rc 3) } The format of the ``lp_version_check`` variable matches the inputs of the :func:`_lp_version_greatereq` function. A theme can support more than one version of Liquid Prompt by only enabling parts of the theme if the Liquid Prompt version is high enough. For example:: if _lp_version_greatereq 2 2 0 ; then if _lp_disk ; then PS1+="my disk status: $lp_disk" fi fi Other Functions --------------- If a theme is moderately complicated, it will need other functions defined to help generate a prompt. These should be named following the :doc:`../functions` guidelines concerning underscore prefixes. The prefix of a function should always be either ``__`` or ``_lp__`` to prevent overwriting functions already defined by the user. Getting Data ============ A theme must call :doc:`../functions/data` to be able to display useful information to the user. A theme might also need to use :doc:`../functions/util` to process that data. Examples ======== The :doc:`included/alternate_vcs` is a good example of creating a theme based on the default theme. The :doc:`included/powerline` is a good example of creating a detailed theme. Sharing Your Theme ================== First see the `Theme sharing`_ wiki page for things you should do to make your theme shareable. The `Themes`_ wiki page is where you can share your theme with other users. .. _`Themes`: https://github.com/liquidprompt/liquidprompt/wiki/Themes .. _`Theme sharing`: https://github.com/liquidprompt/liquidprompt/wiki/Theme-sharing liquidprompt-2.2.1/docs/theme/default-long.png000066400000000000000000000204071464055045500214010ustar00rootroot00000000000000PNG  IHDRk9V.gAMA asRGB pHYs+ IDATxkև`Cco:̌ C24Yp .~! x7,@JpiÐlz;w5[J8UJC/ZRRգS$ &'Ioke tؗh俿&e!Nw{1::~E?y.}˯:m-Lp±}m Cn3hMWg{O[9&b4?w,bh"8Fc Mg0٭ gbcsm ;gƠ56qʴhg`Ц7(4F3}??_֥H8FC uas!ջvZՇO>}P6m}=nbhvg~o֭+:ۓ;j($$'7HU0h &ϊAkrm.)UzgIE0h7[WR2R',A+V}m#G{?{(vϛݵ!uG=գ {8WKfN/6??[Mb0긟]iѻ'+Lkog"c?YE=gĠ56m߻4WuU, ,VF{(Gv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docs/theme/default-med.png000066400000000000000000000043221464055045500212050ustar00rootroot00000000000000PNG  IHDR69gAMA asRGB pHYs+gIDATxѣ,@d ڙ--l&upeT`+[waT~ks$(Y!e\ՒvtסOXorZkVك1,jQrRiokvxS⹎R` aD^2)-OML_ƕ+ ^{?ZI4_ r-:1\[kݥ5ZC=o~.)q:C/],PUw4Ri=ä:9TlLk϶n<"R_JHQ̝l?l&aYj~ne[FSjbEHC-U()˒ѹ˚QGEUP;*jzy.Pq.f3F)]SRk׮'Qq.6)=ev-J箼s(j R)QKOHuOk9Dds?) 'BEܡ4ޏtز$4J”H'GEUP-cDkj麮Bi+^ҥ]^QýޥO{2=+]7ƓCTy>j hj w2dP{uҳAw!NRa-z?E;\b@Qc R"rE\# .wقxdNڏ&ObGEyҥHEy&]mhe.RTG弽}CAQiE՗IQщXi(EIa? QR6j>jˤ0!"ʛ\vGղ~"{eúXSUTL2 oUWyX"EU%W_@QaeIe=~UmyE+R FVfNWܪ$jR^2>p:H !>*__r{)jg<+tQ(+*J!r;)J~D>?| WS(JizSPcDVT4Ч2)e3ҰfSQI`:Q[NK̟nk$>EQ+qK12sDzہq0rVHyyE- ýrq$֜%TT"EVQhsl$ 5v~h0Odrϓ@QDQ/S+CQU$TfM)*I L.5%K1IW"N%KTy,GQeIT+jmJ}z}.)E;GQm}a=XC{m_)CN85ε\[%1մjߛJ.|K$ʝkSYzd挾6EU3 E}Dzhwm**r5Z{)R*cs9₌ )ƴEyڮ ;=qvuVr6H^PEI쨨EO=t^x,*\=%h#gE)&!Du]םAQ6<*c#/^,yDvQTť%J?y|oN m"4H$&,Ȋя}_EﬨuJ>: uKMUYQU]Tޢ**xd*&UtDeкfYE!&kHݗ yN #š]H,6SqDUz(OQ"XknZK.J QsKt@6Vk_qos\ӌa(=>fDP'E/ ᵴI~wYdsx=B5Qԛ E(oE}v;PJi鼼RIENDB`liquidprompt-2.2.1/docs/theme/default-short.png000066400000000000000000000013071464055045500215770ustar00rootroot00000000000000PNG  IHDR9]gAMA asRGB pHYs+\IDATxۙ Fta@,dlb+H+a:9ߟa0drࠌ*o߬XEDr"<ܠ +CwTe O"&]aQe1vV3:}O|p_Sg=ysgԵSOj&g/YM#;2Fp e,Ξ~uMh|rS*ËX{e#|DYݷ3C?TR+je,M0oNPf͏bZ'x Ϩ[wC@tͯh,cߐ&) 3amvϞǣ7\{e(YBym2YpG{FWFQ=@Ƨ6b+cTHU膾BệOu2EJ:ťRƬ!2zǨ O-@jVXH5jN(;YH)]PIR2;T 8*H /k#jX IENDB`liquidprompt-2.2.1/docs/theme/default.rst000066400000000000000000000246211464055045500204720ustar00rootroot00000000000000Default Theme ************* .. contents:: :local: Preview ======= If there is nothing special about the current context, the appearance of Liquid Prompt is similar to that of a default prompt: .. image:: default-short.png :alt: [user:~] $ If you are running a background command and are also in the "main" branch of a Git repository on a server: .. image:: default-med.png :alt: 1& [user@server:~/liquidprompt] main ± When Liquid Prompt is displaying nearly everything (a rare event!), it may look like this: .. image:: default-long.png :alt: 🕤 ⌁24% ⌂1.68 θ90° 3d/2&/1z [user@server:~/ … /liquidprompt/docs/theme ⚞3] [pyenv] main(+10/-5,+3/-1)+* 20s 125 ± See :ref:`Templates ` for what each section will look like. Configuration ============= As the default theme, all of the normal :doc:`../config` are respected. .. attribute:: LP_PS1_FILE :type: string :value: "" A template file that is sourced for each prompt. Must set :attr:`LP_PS1`. See :ref:`Templates ` for details. .. attribute:: LP_PS1 :type: string :value: "" If set, the default theme sets :envvar:`PS1` to this value. Not very useful to set it in the config, instead set it in the :attr:`LP_PS1_FILE`. .. _templates: Templates ========= The default theme supports templated sections. Each piece of the theme is saved to a variable, and can be arranged in any order in a template. If you want to change the theme enough to move things around, but not enough to make your own theme, templates will let you change the order of the default theme's pieces. As the default theme of Liquid Prompt was the only theme until version 2.0, templates were sometimes referred to as "themes" in version 1.X. For a template file to be loaded, its filepath must be set in :attr:`LP_PS1_FILE`. A template file does nothing more than set :attr:`LP_PS1` to a value. The following sections are available to be used. An example template file is available: minimal.ps1_. .. _minimal.ps1: https://github.com/liquidprompt/liquidprompt/blob/master/templates/minimal/minimal.ps1 Template Sections ----------------- All of the available template sections are listed below. Their order is the default order if the user does not configure a different template. .. image:: template.svg :alt: Sections of the prompt. .. note:: Omitting a template section from your template will **not** disable that feature. While it will not be displayed in the prompt, Liquid Prompt does not know that, and will still generate that template section. If you want to speed up your prompt by disabling a section, you must disable it with its respective ``LP_ENABLE_*`` option. :attr:`LP_PS1_PREFIX`: Not actually a part of the default theme, it is used in the default template as the starting section. See :attr:`LP_PS1_PREFIX` and :func:`prompt_tag` for details. .. attribute:: LP_TIME The current time, displayed as either numeric values or as an analog clock, depending on the value of :attr:`LP_TIME_ANALOG`. See :attr:`LP_ENABLE_TIME`. .. attribute:: LP_BATT The current battery status: * a green ⏚ (:attr:`LP_MARK_BATTERY`) if charging, above the given threshold, but not charged * a yellow ⏚ if charging and under the given threshold * a yellow ⌁ (:attr:`LP_MARK_ADAPTER`) if discharging but above the given threshold * a red ⌁ if discharging and under the given threshold And if :attr:`LP_PERCENTS_ALWAYS` is enabled, also the current battery percent. See :attr:`LP_ENABLE_BATT`. .. attribute:: LP_LOAD The average of the processors load, displayed with an intensity color map as load increases. See :attr:`LP_ENABLE_LOAD`. .. attribute:: LP_TEMP The highest temperature of the available system sensors, displayed with an intensity color map as temperature increases. See :attr:`LP_ENABLE_TEMP`. .. attribute:: LP_WIFI The lowest wireless signal strength, displayed with an intensity color map as strength decreases. See :attr:`LP_ENABLE_WIFI_STRENGTH`. .. versionadded:: 2.1 .. attribute:: LP_JOBS The number of detached sessions. See :attr:`LP_ENABLE_DETACHED_SESSIONS`. Also the number of running and sleeping shell jobs. See :attr:`LP_ENABLE_JOBS`. .. attribute:: LP_BRACKET_OPEN An opening bracket, designed to go around the core of the prompt (generally user, host, current working directory). See :attr:`LP_MARK_BRACKET_OPEN`. If running in a terminal multiplexer, will be colored. See :attr:`LP_COLOR_IN_MULTIPLEXER`. .. attribute:: LP_USER The current user, in bold yellow if it is root and in light white if it is not the same as the login user. See :attr:`LP_USER_ALWAYS`. .. attribute:: LP_HOST A green ``@`` if the connection has X11 support; a yellow one if not. The current host – in bold red if you are connected via a ``telnet`` connection and blue (or other unique colors) if connected via SSH. See :attr:`LP_HOSTNAME_ALWAYS`. .. attribute:: LP_PERM A green colon (:attr:`LP_MARK_PERM`) if the user has write permissions in the current directory and a red one if not. See :attr:`LP_ENABLE_PERM`. .. attribute:: LP_PWD The current working directory in bold, shortened if it takes too much space. See :attr:`LP_ENABLE_SHORTEN_PATH`. .. attribute:: LP_DIRSTACK The size of the directory stack, prefixed with :attr:`LP_MARK_DIRSTACK`, all colored with :attr:`LP_COLOR_DIRSTACK`. Can be enabled by :attr:`LP_ENABLE_DIRSTACK`. .. versionadded:: 2.0 .. attribute:: LP_BRACKET_CLOSE A closing bracket, designed to go around the core of the prompt (generally user, host, current working directory). See :attr:`LP_MARK_BRACKET_CLOSE`. If running in a terminal multiplexer, will be colored. See :attr:`LP_COLOR_IN_MULTIPLEXER`. .. attribute:: LP_PROXY A ↥ (:attr:`LP_MARK_PROXY`) if an HTTP proxy is in use. See :attr:`LP_ENABLE_PROXY`. .. attribute:: LP_ENVVARS Some user-defined environment variable's states. Watched variables should be defined in the :attr:`LP_ENV_VARS` array. Set variables are displayed in bold blue, unset variables in blue. See also :attr:`LP_ENABLE_ENV_VARS`. .. versionadded:: 2.2 .. attribute:: LP_SHLVL The number of nested shells, prefixed with :attr:`LP_MARK_SHLVL`, all colored with :attr:`LP_COLOR_SHLVL`. Can be disabled by :attr:`LP_ENABLE_SHLVL`. .. versionadded:: 2.1 .. attribute:: LP_DEV_ENV Sections related to development environments (see section `dev_env`_ below). See also :attr:`LP_MARK_DEV_OPEN`, :attr:`LP_MARK_DEV_MID`, and :attr:`LP_MARK_DEV_CLOSE`. .. versionadded:: 2.2 .. attribute:: LP_VCS * The name of the current branch if you are in a version control repository (Git, Mercurial, Subversion, Bazaar, or Fossil): * in green if everything is up-to-date * in red if there are changes * in yellow if there are pending commits to push * The number of added/deleted lines if changes have been made and the number of pending commits * The number of commits ahead/behind the remote tracking branch * A yellow + (:attr:`LP_MARK_STASH`) if there are stashed modifications * a red \* (:attr:`LP_MARK_UNTRACKED`) if there are untracked files in the repository .. attribute:: LP_RUNTIME The runtime of the last command, if it has exceeded a certain threshold. See :attr:`LP_ENABLE_RUNTIME`. .. attribute:: LP_ERR The error code of the last command, if it is non-zero. See :attr:`LP_ENABLE_ERROR`. .. attribute:: LP_ERR_MEANING A guess on the meaning of the last error. See :attr:`LP_ENABLE_ERROR_MEANING` and :attr:`LP_ERR`. .. versionadded:: 2.2 :attr:`LP_MARK_PREFIX` Not actually a part of the default theme, it is used in the default template as the last thing before the prompt mark. See :attr:`LP_MARK_PREFIX` for details. :attr:`LP_COLOR_MARK` Bold normally, red if you have ``sudo`` rights or for the root user. Separate from :attr:`LP_MARK` for historical reasons. .. attribute:: LP_MARK A smart mark at the end of the prompt: * $ or % (:attr:`LP_MARK_DEFAULT`) for a simple user * # for the root user * ⌘ (:attr:`LP_MARK_FOSSIL`) for Fossil * ± (:attr:`LP_MARK_GIT`) for Git * ☿ (:attr:`LP_MARK_HG`) for Mercurial * ‡ (:attr:`LP_MARK_SVN`) for Subversion * ‡± for Git-Subversion * \|±\| (:attr:`LP_MARK_VCSH`) for VCSH :attr:`LP_PS1_POSTFIX` Not actually a part of the default theme, it is used in the default template as the final section. See :attr:`LP_PS1_POSTFIX` for details. .. _dev_env: Development environment sections ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Version 2.2 of Liquid Prompt introduced a new way to display all sections related to development environments. All the data below are now items in the :attr:`LP_DEV_ENV` list, joined by :attr:`LP_MARK_DEV_MID` and surrounded by :attr:`LP_MARK_DEV_OPEN` and :attr:`LP_MARK_DEV_CLOSE`. If you want to change the ordering or have different marks for different items, you can derive your own theme template and use the following sections. .. attribute:: LP_SCLS The current Red Hat Software Collections environment. See :attr:`LP_ENABLE_SCLS`. .. attribute:: LP_AWS_PROFILE The current active AWS Profile. See :attr:`LP_ENABLE_AWS_PROFILE`. .. versionadded:: 2.1 .. attribute:: LP_CONTAINER The container status for the current shell. See :attr:`LP_ENABLE_CONTAINER`. .. versionadded:: 2.1 .. attribute:: LP_VENV The current Python (or Conda) virtual environment. See :attr:`LP_ENABLE_VIRTUALENV`. .. attribute:: LP_NODE_VENV The current Node.js virtual environment. See :attr:`LP_ENABLE_NODE_VENV`. .. versionadded:: 2.1 .. attribute:: LP_PERL_VENV The current Perl virtual environment. See :attr:`LP_ENABLE_PERL_VENV`. .. versionadded:: 2.2 .. attribute:: LP_RUBY_VENV The current Ruby virtual environment. See :attr:`LP_ENABLE_RUBY_VENV`. .. versionadded:: 2.1 .. attribute:: LP_TFSPACE The current Terraform workspace. See :attr:`LP_ENABLE_TERRAFORM`. .. versionadded:: 2.1 .. attribute:: LP_KUBECONTEXT The current Kubernetes context. See :attr:`LP_ENABLE_KUBECONTEXT`. .. versionadded:: 2.1 .. attribute:: LP_CMAKE Variables from CMake cache configured in this directory: - the base name of the compiler (without the path), - the configured generator (without spaces, some of them shortened), - the build type. See :attr:`LP_ENABLE_CMAKE`. .. versionadded:: 2.2 liquidprompt-2.2.1/docs/theme/included.rst000066400000000000000000000003741464055045500206340ustar00rootroot00000000000000Included Themes *************** Liquid Prompt ships with some included themes that will have features added to them as they are added to Liquid Prompt. .. toctree:: :maxdepth: 2 included/alternate_vcs included/powerline included/unfold liquidprompt-2.2.1/docs/theme/included/000077500000000000000000000000001464055045500200765ustar00rootroot00000000000000liquidprompt-2.2.1/docs/theme/included/alternate_vcs-demo.png000066400000000000000000000421271464055045500243660ustar00rootroot00000000000000PNG  IHDRugAMA asRGB pHYs+CIDATx鵬@ɇTȄDUï^AƇ" it5%P\_9U{+_'c^Wkc>k?+[{||(:u v\UCӅz.fu5h+RMa^r*PTUGV( ٤M6SOslwqp11!7b1luiTM4\.aC5-O>F!\G4_>TϣC^w֏PUe K' gl|䚰쟟ׂ#\ѱgDW%/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PcDVT4Ч2)e3ҰfSQI`:Q[NK̟nk$>EQ+qK12sDzہq0rVHyyE- ýrq$֜%TT"EVQhsl$ 5v~h0Odrϓ@QDQ/S+CQU$TfM)*I L.5%K1IW"N%KTy,GQeIT+jmJ}z}.)E;GQm}a=XC{m_)CN85ε\[%1մjߛJ.|K$ʝkSYzd挾6EU3 E}Dzhwm**r5Z{)R*cs9₌ )ƴEyڮ ;=qvuVr6H^PEI쨨EO=t^x,*\=%h#gE)&!Du]םAQ6<*c#/^,yDvQTť%J?y|oN m"4H$&,Ȋя}_EﬨuJ>: uKMUYQU]Tޢ**xd*&UtDeкfYE!&kHݗ yN #š]H,6SqDUz(OQ"XknZK.J QsKt@6Vk_qos\ӌa(=>fDP'E/ ᵴI~wYdsx=B5Qԛ E(oE}v;PJi鼼RIENDB`liquidprompt-2.2.1/docs/theme/included/alternate_vcs-short.png000066400000000000000000000013071464055045500245740ustar00rootroot00000000000000PNG  IHDR9]gAMA asRGB pHYs+\IDATxۙ Fta@,dlb+H+a:9ߟa0drࠌ*o߬XEDr"<ܠ +CwTe O"&]aQe1vV3:}O|p_Sg=ysgԵSOj&g/YM#;2Fp e,Ξ~uMh|rS*ËX{e#|DYݷ3C?TR+je,M0oNPf͏bZ'x Ϩ[wC@tͯh,cߐ&) 3amvϞǣ7\{e(YBym2YpG{FWFQ=@Ƨ6b+cTHU膾BệOu2EJ:ťRƬ!2zǨ O-@jVXH5jN(;YH)]PIR2;T 8*H /k#jX IENDB`liquidprompt-2.2.1/docs/theme/included/alternate_vcs.rst000066400000000000000000000053061464055045500234660ustar00rootroot00000000000000*************************** Alternate VCS Details Theme *************************** The included ``themes/alternate_vcs/alternate_vcs.theme`` file includes a theme extending the default theme but replacing the VCS details display. .. contents:: :local: Alternate VCS ************* The ``alternate_vcs`` theme is an extension of the default theme. This prompt is a fully usable theme, designed to be more flexible than the default theme in terms of what VCS information is shown in the prompt. It is also an example of how to build a theme extending the default theme while replacing one of the template sections. .. versionadded:: 2.0 Preview ======= If there is nothing special about the current context, the appearance of Alternate VCS might be as simple as this: .. image:: alternate_vcs-short.png :alt: [user:~] $ If you are running a background command and are also in the "main" branch of a Git repository on a server: .. image:: alternate_vcs-med.png :alt: 1& [user@server:~/liquidprompt] main ± When Liquid Prompt is displaying nearly everything, it may look like this: .. image:: alternate_vcs-long.png :alt: 🕤 ⌁24% ⌂1.68 θ90° 3d/2&/1z [user@server:~/ … /liquidprompt/docs/theme ⚞3] [pyenv] main(U2 ?1 +10/-5,+3/-1)+ 20s 125 ± A demo of what disabling the configuration options might look like: .. image:: alternate_vcs-demo.png :alt: [user@server:~/liquidprompt] main(U1 ?1 +8/-1,+1/-3)+ ± Configuration ============= Liquid Prompt Configuration --------------------------- All Liquid Prompt config options are respected, **except for**: * :attr:`LP_MARK_UNTRACKED` when :attr:`LP_ENABLE_ALT_VCS_STATUS` is enabled. Theme Configuration ------------------- Alternate VCS adds these config options: Features ________ .. attribute:: LP_ALWAYS_ALT_VCS_TAG :type: bool :value: 0 Determine when a matching VCS tag should be displayed: * ``0`` - Only when there is no current branch or bookmark * ``1`` - Always .. attribute:: LP_ENABLE_ALT_VCS_COMMITS :type: bool :value: 1 Display commits ahead or behind the remote tracking branch. .. attribute:: LP_ENABLE_ALT_VCS_DIFF :type: bool :value: 1 Display the number of changed lines. .. attribute:: LP_ENABLE_ALT_VCS_STATUS :type: bool :value: 1 Display the number(s) of changed files, of type staged (if VCS supports staging), non-staged (or non-committed if no staging), and untracked. If disabled, a marker will be added to the end of the display to show if there are untracked files (the behavior of the default theme). Markers _______ .. attribute:: LP_MARK_ALT_VCS_TAG :type: string :value: "🔖" The marker string used to indicate the following string is a VCS tag. liquidprompt-2.2.1/docs/theme/included/powerline-long.png000066400000000000000000000132461464055045500235530ustar00rootroot00000000000000PNG  IHDR^9AgAMA asRGB pHYs+;IDATxMhWJV!W˙@E `Bn/bCf92vÌA BtɈЃA0˛6l#hEiի^i[w*pQT\|wb[ZFsۃWk*pyecxWfAs;oa BpH0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{$B$K/ɭq,DH;3M玬ku?')Y=!Z^:7{wEn>SHxuGHq&pDbBUhL=^#}MH4WVa툩$eW#Q:z9)Ҹr2i\>uR|TV-ߪt$Tbx=6&uu  YPtўeʠ-O*kt-ZXGr}EߪxG.tʏo#RYUEYBvkFd:bѾudqYN9Ibu86 rqw.LH+x Kp'^lC^;uլ.Syyl{fI:.OGI^ ؒoGժz%c,{Kd%?FzLϬ)8YxMVʷde).bBG*u]Z>U& d=ff:bETele6Vs5Ezv :<ƌStH=:cE=).=5EjH]EGБܿٸފ43uiqSTcq'fI]EGБpV+~qSif*:ZQG xIaU~pq2 k~XX;m Z$4$QB#L^<ЍILg'Kqäo0 0iD#g|oNXuoIENDB`liquidprompt-2.2.1/docs/theme/included/powerline.rst000066400000000000000000000347041464055045500226440ustar00rootroot00000000000000*************** Powerline Theme *************** .. deprecated:: 2.2 Use the spun off project `Liquid Prompt Powerline`_ instead. .. _`Liquid Prompt Powerline`: https://github.com/liquidprompt/liquidprompt-powerline The included ``themes/powerline/powerline.theme`` file includes two themes: .. contents:: :local: Powerline ********* The ``powerline`` theme is a clone of the `Powerline prompt`_. It copies the `default segments`_ of the Powerline prompt for Shell. This prompt is a proof of (a specific) concept: that Liquid Prompt can do what Powerline does, but faster. That said, this is a fully usable theme. .. versionadded:: 2.0 .. deprecated:: 2.2 Use the spun off project `Liquid Prompt Powerline`_ instead. .. _`Powerline prompt`: https://github.com/powerline/powerline .. _`default segments`: https://github.com/powerline/powerline/blob/2.8/powerline/config_files/themes/shell/default.json Preview ======= If there is nothing special about the current context, the appearance of Powerline might be as simple as this: .. image:: powerline-short.png :alt:  user  ~   If you are running a background command and are also in the "main" branch of a Git repository on a server: .. image:: powerline-med.png :alt:   server  user  ~  liquidprompt  1   main   When Liquid Prompt is displaying nearly everything, it may look like this: .. image:: powerline-long.png :alt:   server  user  (e) pyenv  ~   …   liquidprompt   …   theme   3   main  ST 1  125   .. note:: The above "everything" image looks like it is missing some parts because this theme does not implement all data sources of Liquid Prompt. This is by design to clone basic Powerline. For a Powerline theme that does show all data sources, see :ref:`Powerline Full ` below. Setup ===== By default, the dividers and markers used are the Powerline private characters. You will either need a compatible font, or to configure the dividers and markers to use other characters. See the `Powerline Fonts installation docs`_ for help. .. _`Powerline fonts installation docs`: https://powerline.readthedocs.io/en/latest/installation.html#fonts-installation Configuration ============= Liquid Prompt Configuration --------------------------- The following Liquid Prompt config options are respected: * :attr:`LP_DISABLED_VCS_PATHS` * :attr:`LP_ENABLE_BZR` * :attr:`LP_ENABLE_COLOR` * :attr:`LP_ENABLE_ERROR` * :attr:`LP_ENABLE_FOSSIL` * :attr:`LP_ENABLE_FQDN` * :attr:`LP_ENABLE_GIT` * :attr:`LP_ENABLE_HG` * :attr:`LP_ENABLE_JOBS` * :attr:`LP_ENABLE_RUNTIME_BELL` * :attr:`LP_ENABLE_SCREEN_TITLE` * :attr:`LP_ENABLE_SHORTEN_PATH` * :attr:`LP_ENABLE_SVN` * :attr:`LP_ENABLE_TITLE` * :attr:`LP_ENABLE_VCS_ROOT` * :attr:`LP_ENABLE_VIRTUALENV` * :attr:`LP_HOSTNAME_ALWAYS` * :attr:`LP_PATH_CHARACTER_KEEP` * :attr:`LP_PATH_KEEP` * :attr:`LP_PATH_LENGTH` * :attr:`LP_PATH_METHOD` * :attr:`LP_PATH_VCS_ROOT` * :attr:`LP_RUNTIME_BELL_THRESHOLD` * :attr:`LP_USER_ALWAYS` Theme Configuration ------------------- Powerline adds these config options: Markers _______ .. attribute:: POWERLINE_HARD_DIVIDER :type: string :value: "" # U+E0B0 The divider character between sections, defaults to the private character used in Powerline fonts that looks like a solid right arrow. .. attribute:: POWERLINE_PYTHON_ENV_MARKER :type: string :value: "(e) " The marker string used to indicate the following string is a Python environment. .. attribute:: POWERLINE_ROOT_MARKER :type: string :value: "#" The marker character used to indicate a root session. .. attribute:: POWERLINE_SECURE_MARKER :type: string :value: "" # U+E0A2 The marker character used to indicate a SSH session, defaults to the private character used in Powerline fonts that looks like a lock. .. attribute:: POWERLINE_SOFT_DIVIDER :type: string :value: "" # U+E0B1 The divider character between similar sections, defaults to the private character used in Powerline fonts that looks like a thin right arrow. .. attribute:: POWERLINE_SPACER :type: string :value: " " # U+00A0: non-breaking space The marker character used to pad sections, defaults to the non-breaking space character. To add more padding, add more spaces to this string. A non-breaking space is needed in some fonts to prevent multiple spaces from collapsing to one space, loosing the padding. .. attribute:: POWERLINE_STASH_MARKER :type: string :value: "ST" The marker string used to indicate stashes exist in the VCS repository. .. attribute:: POWERLINE_VCS_MARKER :type: string :value: "" # U+E0A0 The marker character used to indicate a VCS repository, defaults to the private character used in Powerline fonts that looks like a branching commit history. Colors ______ These color config options take an array of integers, which are arguments to :func:`lp_terminal_format`. .. note:: Arrays are set without commas (``,``). The default values are displayed with commas for clarity. .. attribute:: POWERLINE_ERROR_COLOR :type: array :value: (231, 52, 0, 0, 7, 1) Color for the error code section. .. attribute:: POWERLINE_HOST_COLOR :type: array :value: (220, 166, 0, 0, 3, 2) Color for the hostname section. .. attribute:: POWERLINE_JOBS_COLOR :type: array :value: (220, 166, 0, 0, 3, 2) Color for the shell jobs section. .. attribute:: POWERLINE_PATH_COLOR :type: array :value: (250, 240, 0, 0, 7, 0) Color for the current working directory section. .. attribute:: POWERLINE_PATH_LAST_COLOR :type: array :value: (252, 240, 1, 0, 7, 0) Color for the current working directory last subsection. .. attribute:: POWERLINE_PATH_SEPARATOR_COLOR :type: array :value: (245, 240, 0, 0, 7, 0) Color for the current working directory subsection separator. .. attribute:: POWERLINE_PATH_SHORTENED_COLOR :type: array :value: (245, 240, 0, 0, 7, 0) Color for any sections in the current working directory that are shortened to make the path fit in :attr:`LP_PATH_LENGTH`. .. attribute:: POWERLINE_PATH_VCS_COLOR :type: array :value: (147, 240, 1, 0, 4, 0) Color for the current working directory segment corresponding to the current VCS repository root directory. :attr:`LP_PATH_VCS_ROOT` must be enabled to have any effect. .. attribute:: POWERLINE_PYTHON_ENV_COLOR :type: array :value: (231, 74, 0, 0, 7, 4) Color for the Python environment section. .. attribute:: POWERLINE_USER_COLOR :type: array :value: (231, 31, 1, 0, 7, 6) Color for the username section. .. attribute:: POWERLINE_VCS_CLEAN_COLOR :type: array :value: (250, 236, 0, 0, 7, 0) Color for the VCS section if the repository is clean. .. attribute:: POWERLINE_VCS_DIRTY_COLOR :type: array :value: (220, 236, 0, 0, 3, 0) Color for the VCS section if the repository is not clean. .. attribute:: POWERLINE_VCS_STASH_COLOR :type: array :value: (220, 236, 0, 0, 3, 0) Color for the VCS stash subsection. .. _powerline_full: Powerline Full ************** An extension of the ``powerline`` theme, ``powerline_full`` includes all data sources that Liquid Prompt provides. The ordering is the same as the default theme. .. versionadded:: 2.0 .. deprecated:: 2.2 Use the spun off project `Liquid Prompt Powerline`_ instead. Preview ======= If there is nothing special about the current context, the appearance of Powerline might be as simple as this: .. image:: powerline_full-short.png :alt:  user  ~   If you are running a background command and are also in the "main" branch of a Git repository on a server: .. image:: powerline_full-med.png :alt:  1&  user   server  ~  liquidprompt  main   When Liquid Prompt is displaying nearly everything, it may look like this: .. image:: powerline_full-long.png :alt:  🕤  ⌁24%  ⌂1.68  θ90°  3d/2&/1z  user   server  ~   …    liquidprompt   …   theme  ⚞3  (e) pyenv  main(+10/-5,+3/-1)+*  20s   125   Setup ===== Like the ``powerline`` theme, you will need a compatible font. See the `Powerline Fonts installation docs`_ for help. Configuration ============= Liquid Prompt Configuration --------------------------- All Liquid Prompt config options are respected, **except for**: * :attr:`LP_COLOR_AWS_PROFILE` * :attr:`LP_COLOR_CONTAINER` * :attr:`LP_COLOR_DIRSTACK` * :attr:`LP_COLOR_ERR` * :attr:`LP_COLOR_HOST` * :attr:`LP_COLOR_IN_MULTIPLEXER` * :attr:`LP_COLOR_JOB_D` * :attr:`LP_COLOR_JOB_R` * :attr:`LP_COLOR_JOB_Z` * :attr:`LP_COLOR_KUBECONTEXT` * :attr:`LP_COLOR_MARK_ROOT` * :attr:`LP_COLOR_MARK_SUDO` * :attr:`LP_COLOR_MARK` * :attr:`LP_COLOR_NODE_VENV` * :attr:`LP_COLOR_NOWRITE` * :attr:`LP_COLOR_PATH_ROOT` * :attr:`LP_COLOR_PATH` * :attr:`LP_COLOR_PERL_VENV` * :attr:`LP_COLOR_PROXY` * :attr:`LP_COLOR_RUBY_VENV` * :attr:`LP_COLOR_RUNTIME` * :attr:`LP_COLOR_SHLVL` * :attr:`LP_COLOR_SSH` * :attr:`LP_COLOR_SU` * :attr:`LP_COLOR_TELNET` * :attr:`LP_COLOR_TERRAFORM` * :attr:`LP_COLOR_TIME` * :attr:`LP_COLOR_USER_ALT` * :attr:`LP_COLOR_USER_LOGGED` * :attr:`LP_COLOR_USER_ROOT` * :attr:`LP_COLOR_VIRTUALENV` * :attr:`LP_COLOR_WRITE` * :attr:`LP_COLOR_X11_OFF` * :attr:`LP_COLOR_X11_ON` * :attr:`LP_ENABLE_PERM` * :attr:`LP_ENABLE_SSH_COLORS` * :attr:`LP_ENABLE_SUDO` * :attr:`LP_MARK_BRACKET_CLOSE` * :attr:`LP_MARK_BRACKET_OPEN` * :attr:`LP_MARK_BZR` * :attr:`LP_MARK_DEFAULT` * :attr:`LP_MARK_DISABLED` * :attr:`LP_MARK_FOSSIL` * :attr:`LP_MARK_GIT` * :attr:`LP_MARK_HG` * :attr:`LP_MARK_PERM` * :attr:`LP_MARK_PREFIX` * :attr:`LP_MARK_PROXY` * :attr:`LP_MARK_SVN` * :attr:`LP_MARK_VCSH` Theme Configuration ------------------- Powerline Full uses all the config options of the above Powerline theme, **except for**: * :attr:`POWERLINE_STASH_MARKER` * :attr:`POWERLINE_VCS_DIRTY_COLOR` * :attr:`POWERLINE_VCS_MARKER` * :attr:`POWERLINE_VCS_STASH_COLOR` Powerline Full adds these config options: Markers _______ .. attribute:: POWERLINE_AWS_PROFILE_MARKER :type: string :value: "AWS: " The marker string used to indicate the following string is the name of an AWS profile. .. versionadded:: 2.1 .. attribute:: POWERLINE_CHROOT_MARKER :type: string :value: "chroot: " The marker string used to indicate the following string is a chroot. .. attribute:: POWERLINE_KUBECONTEXT_MARKER :type: string :value: $LP_MARK_KUBECONTEXT The marker string used to indicate the following string is the name of a ``kubectl`` context. .. versionadded:: 2.1 .. attribute:: POWERLINE_NODE_ENV_MARKER :type: string :value: "node: " The marker string used to indicate the following string is a Node.js environment. .. versionadded:: 2.1 .. attribute:: POWERLINE_PERL_ENV_MARKER :type: string :value: "perl: " The marker string used to indicate the following string is a Perl environment. .. attribute:: POWERLINE_PROXY_MARKER :type: string :value: "proxy: " The marker string used to indicate the following string is a HTTP proxy. .. attribute:: POWERLINE_RUBY_ENV_MARKER :type: string :value: "ruby: " The marker string used to indicate the following string is a Ruby environment. .. versionadded:: 2.1 .. attribute:: POWERLINE_SOFTWARE_COLLECTION_MARKER :type: string :value: "(sc) " The marker string used to indicate the following string is a Red Hat Software Collection. .. attribute:: POWERLINE_TERRAFORM_ENV_MARKER :type: string :value: "(tf) " The marker string used to indicate the following string is a Terraform workspace. .. versionadded:: 2.1 Colors ______ .. attribute:: POWERLINE_AWS_PROFILE_COLOR :type: array :value: (190, 236, 0, 0, 3, 0) Color for the AWS profile section. .. versionadded:: 2.1 .. attribute:: POWERLINE_BATTERY_COLOR :type: array :value: (-1, 238, 0, 0, -1, 0) Color for the battery section. .. attribute:: POWERLINE_CHROOT_COLOR :type: array :value: (219, 30, 0, 0, 7, 4) Color for the chroot section. .. attribute:: POWERLINE_CONTAINER_COLOR :type: array :value: $POWERLINE_NEUTRAL_COLOR Color for the container indicator section. .. versionadded:: 2.1 .. attribute:: POWERLINE_DIRSTACK_COLOR :type: array :value: $POWERLINE_NEUTRAL_COLOR Color for the directory stack section. .. attribute:: POWERLINE_KUBECONTEXT_COLOR :type: array :value: (231, 74, 0, 0, 7, 4) Color for the Kubernetes context section. .. versionadded:: 2.1 .. attribute:: POWERLINE_LOAD_COLOR :type: array :value: (-1, 148, 0, 0, -1, 3) Color for the CPU load section. .. attribute:: POWERLINE_NEUTRAL_COLOR :type: array :value: (252, 234, 0, 0, 7, 0) Color for all neutral sections, :attr:`LP_PS1_PREFIX` and :attr:`LP_PS1_POSTFIX`. .. attribute:: POWERLINE_NODE_ENV_COLOR :type: array :value: $POWERLINE_PYTHON_ENV_COLOR Color for the Node.js environment section. .. versionadded:: 2.1 .. attribute:: POWERLINE_PROXY_COLOR :type: array :value: (21, 219, 1, 0, 4, 7) Color for the HTTP proxy section. .. attribute:: POWERLINE_RUBY_ENV_COLOR :type: array :value: $POWELINE_PYTHON_ENV_COLOR Color for the Ruby environment section. .. versionadded:: 2.1 .. attribute:: POWERLINE_RUNTIME_COLOR :type: array :value: (226, 17, 0, 0, 3, 4) Color for the command runtime section. .. attribute:: POWERLINE_SHLVL_COLOR :type: array :value: (231, 58, 0, 0, 7, 2) Color for the nested shell level section. .. versionadded:: 2.1 .. attribute:: POWERLINE_SOFTWARE_COLLECTIONS_COLOR :type: array :value: (231, 62, 0, 0, 7, 5) Color for the Red Hat Software Collections section. .. attribute:: POWERLINE_TEMPERATURE_COLOR :type: array :value: (-1, 240, 0, 0, -1, 0) Color for the temperature section. .. attribute:: POWERLINE_TERRAFORM_ENV_COLOR :type: array :value: (231, 182, 0, 0, 7, 4) Color for the Terraform workspace. .. versionadded:: 2.1 .. attribute:: POWERLINE_TIME_COLOR :type: array :value: (33, 17, 0, 0, 5, 4) Color for the current time section. .. attribute:: POWERLINE_WIFI_STRENGTH_COLOR :type: array :value: (-1, 148, 0, 0, -1, 3) Color for the wireless signal strength section. .. versionadded:: 2.1 liquidprompt-2.2.1/docs/theme/included/powerline_full-long.png000066400000000000000000000253221464055045500245730ustar00rootroot00000000000000PNG  IHDRt9ygAMA asRGB pHYs+*gIDATx_hG1-J8Z6#{V[B|dciaDہ=3G |tȈk#s,hc }b]j|uwUwuwUO.QMux&}s9ڃ]|ܵ8!m,?8#pER"Fȸ*3kδ+wwzwpN/onooN_HfcݸyE@S9Ж?x+IJD܁WFk'Y&w>|SݯarZˆ_>++-W>~وғOjU9~h'y ϟq䂊O~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lr݈qfMS^wSPkk}^K $#H`+BhO#0CQk=GDPbDŒfa(+')%XYk:CJOPE6$EqQR%Q%8ӡ;RD+( LIAarY:I5=ç.|xkgf'd$IXI1׾{QrPN\lv3KF3JNZ5Oee.gG{⿎#bfǀh~%(Z=2&(sΌC4;g/nB~g(RY旤RqsRO!(H>$t'av*pS3qI%(]UfTղkxTE F<֡|ÂF_Z2 2g^12'QD+WVP&F$[5A)q2J2~KQty3 JTٔ2K(4il ReKT96Ja$4I]iGYI{yH;꟝ElŠ,AP*BP<ϐd M)(NOPBDa-} si>I wRN*[mAIZ;\WN~zPkN (O&vVrb`'I (OdB`'II'xTNz`'o'U/fp$IENDB`liquidprompt-2.2.1/docs/theme/included/powerline_full-short.png000066400000000000000000000014071464055045500247710ustar00rootroot00000000000000PNG  IHDR9gAMA asRGB pHYs+IDATx=@@{ J2BZ+iD4tSriDM7 23 v { yww/sY.00 {L}}L2a2a2a2-!8imH>IaU~pq2 k~XX;m Z$4$QB#L^<ЍILg'Kqäo0 0iD#g|oNXuoIENDB`liquidprompt-2.2.1/docs/theme/included/unfold-long.png000066400000000000000000000462611464055045500230410ustar00rootroot00000000000000PNG  IHDR4OnzTXtRaw profile type exifxڭW[$)s$!$C2lj̪ݝ1xw*Լ+>m7^_񜩶|V}"Ipףו& s^ {ʝqsv~;2uӇ۷%?"􉨾׆f@(&/˼ϹuBHȷ}\k 7?_Z~>w 7?X>#?Ee9oxnD[QݎWoq{{ YѡII\7m8pe,O H=(ds?cg̷1!te`_~'G"z]Ve PyM",H cK釶YOq}{AanE0$`vN՘8:ArdK1vs/+w&͐ ZSǚCC)T:ֵn4fj܆Mo}<>ƘDcMhYd/[ƚm۶#6qgTN-4zXx dK͞#'koV9kfn?d cv30ƍ] hU2w9R/7e  ֤O~0x+7̕Kݿ\uέsa악*ȾDe Yuœ'y9֮'uN i-S|&?rKu kL=9`[ۻJ"|$h3OΡIJ+ r\1\8&L4aƯF}Oӳ1툡È/I{RTk`6w[Za؂6!;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GKӉhߗɷRv(*wj`Ȑ!$$$l2'&%ÿX?gXV6nHEEa0f;֭[ ,g޽'`M~x75kQQQ\^pwN/iӦx:tzmwѢE̙3-Zf;x5 ?~g/.igΜI~ ?zo޼y^t&X]ۿ-[C=3:uıc~].Y2cAPfN1 ? 0Պ{{X v"ߠ8x 6gR bŻ߳W{6$whƸѭ7wÝ%O㩪{%##ѣG3B_€x饗9s&f &x=At2rH^uˬY|ӧO3{lә1cȧ^}]t)gϦr>̙S999TVVzRsp5ܹ"ڛHk!:Į)[2k^S}};,V3DDDDDD.Ǚ3-/p80~վZp8ƪUukl6#""p8ƌ3;ҠX>,eX׊Uۭ00vhmc!m&ҒRBIaa!`HɁUZZС粝V,cnϽvxy.4O!""""""MOk 6.a "PxD\3|fHfa"""""""""MYC """"""""MX""""""""Ҥ)%""""""""MX""""""""Ҥ)%""""""""MRRRӧIiWZ`k֬cǎIiZB(""""""""M*[vkn'44J5"""""""" LQ7x#Whu1a4-!&f`oуCX""""""""Ҥ)%""""""""M%-!#$$uN'eeeYiKܫW/=PDDDDDDDD*-!&튞B(""""""""4KDDDDDDDD4DDDDDDDDISKDDDDDDDD4DDDDDDDDISKDDDDDDDD4DDDDDDDDISKDDDDDDDDgNxIENDB`liquidprompt-2.2.1/docs/theme/included/unfold-short.png000066400000000000000000000064661464055045500232440ustar00rootroot00000000000000PNG  IHDR1ʂP=zTXtRaw profile type exifxڭk& ,I;s;ܙ2|߿V CR+s8'AJ19Z ;_vJ# {-{ >Dِ * B<$k"}m?̗;Gg^D~^| M|k?ZX-ЗZ5Քh3M7Mkp*vl0vb%Ti<}O6̝؊;w0"Ib!: 3?c:<Sib;& nnz~XX´-skl[r8 )H@$J1t,T9KAr|-^yQظTJI? rhRլ%k͒S֜]䪉%SfV̭)hJ)^ jzvrXW K&-5mY+[Hܭ2P&F6Q'J1ԙ2}օ\[ҕ|'jtSCjϳ'5Xrq"M ͛Y,orYtG u 61 LX=}[OF @jc~]_4 %j k-!sU[w.aJ ¥?K5VQc3FfQ(A;Ǔ&+|T8LVP5'5ď\W<~sY!3'&VMx8j: )U[b_+\9 "Q@6"XH~KRU#J ~?ݭQq>]VqcǩgJoKU`JC uCSɐMٕ4lx?oJ}@`뭾 I]oC`8G-ۿgrbKGDC pHYs+tIME 98/D_;IDATxohelkbQaZ2  +Zj &L+Ȣ"BQ/'irQ9Mm*-/\к7|]u]x8$`H & (j,ZAU]]oɚ5kLM69G=Օn!cǎG}deg 9IߟTTThXaXw}w3{QPt|)--M}}inkk+;v9?CA,O=Ttwwg߾}Y|y&Oxyg "1*+N<<9vX>ݻ77oN[[иӧ:g?T^^ygO9gZzu5P;Ǐ7[vuu~Up !1Z@1`PX5E/X .ÇuQeEmV]]]y455&_|Emۖz`ĕg%\ݻwrVWWݻ7|0{Ieeeڲdɒ9r$555{ $I{{{~$Iggg|M`T +:x`d矟$$555C_5z}QA#$vpooosEeԩ;vl2gΜfǎ:  k…y{`&LYW1z aiiY===Yti$_~0UrgƍCniѣGu5, ihh@ƌ3֭[s `D k *)--͛7gҥQF{*SLɗ_~`B & R IENDB`liquidprompt-2.2.1/docs/theme/included/unfold.rst000066400000000000000000000022621464055045500221210ustar00rootroot00000000000000************ Unfold Theme ************ The included ``themes/unfold/unfold.theme`` file includes a theme reformatting the default theme to spread it on two lines, with a part of the first line being right-aligned. .. contents:: :local: Unfold ****** The ``unfold`` theme is an reconfiguration of the default theme's structure. This prompt is a fully usable theme, designed so that: - The prompt location is more stable (on the second line). - There is a clearer hierarchy between important data (display on the first line, left side), and less important information (first line, right side). It is also an example of how to rearrange the prompt's template sections, without touching anything else. As such, all the configuration of the default theme is honored. .. versionadded:: 2.2 Preview ======= If there is nothing special about the current context, the appearance of Alternate VCS might be as simple as this: .. image:: unfold-short.png If you are running a background command and are also in the "main" branch of a Git repository on a server: .. image:: unfold-med.png When Liquid Prompt is displaying nearly everything, it may look like this: .. image:: unfold-long.png liquidprompt-2.2.1/docs/theme/template.svg000066400000000000000000001143001464055045500206420ustar00rootroot00000000000000 Liquid PromptmycodePersonaltagTimeLoadBatteryTemperatureJobs- detached- background- sleepingUserHostWorking directoryTerminal multiplexer markersProxyVCSRuntimeErrorX displaySmartmarkPermissionVCS repoDirstackEnvironmentsShell levelLiquid Prompt2022-11-05nojhan liquidprompt-2.2.1/docs/upgrading.rst000066400000000000000000000006731464055045500177250ustar00rootroot00000000000000Upgrading Liquid Prompt *********************** We try our best to make new versions of Liquid Prompt backwards compatible with previous versions, but sometimes things need to change to make forward progress. If a version introduces breaking changes or deprecation notices, a detailed document describing what changes a user needs to make will be linked below. .. toctree:: :maxdepth: 2 :reversed: upgrading/v2.0 upgrading/v2.1 liquidprompt-2.2.1/docs/upgrading/000077500000000000000000000000001464055045500171655ustar00rootroot00000000000000liquidprompt-2.2.1/docs/upgrading/v2.0.rst000066400000000000000000000317531464055045500204150ustar00rootroot00000000000000Version 2.0 Upgrade Notes ************************* Most of the changes in 2.0 are in private functions and variables. There are a few public API changes that could impact users: :ref:`$lp_err `, :ref:`$LP_DISABLED_VCS_PATH `, :ref:`$LP_PATH_DEFAULT `, :ref:`$PROMPT_DIRTRIM `, :ref:`$LP_PATH_KEEP=-1 `, and :ref:`_lp_title() `. The rest are private API changes, but are still documented here. .. contents:: :local: .. spelling:word-list:: acpi bool bzr dirtrim hg jobcount lp sb sl sr svn Breaking Changes ++++++++++++++++ Public Breaking Changes ======================= .. _lp_err: $lp_err ------- Renamed to ``$lp_error``. Instead of referencing it directly, use :func:`_lp_error`. Private Breaking Changes ======================== $_LP_SHELL_bash --------------- Now returns ``1`` or ``0`` instead of ``true`` or ``false`` Replace test statements like:: if $_LP_SHELL_bash; then with:: if (( $_LP_SHELL_bash )); then $_LP_SHELL_zsh -------------- Now returns ``1`` or ``0`` instead of ``true`` or ``false`` Replace test statements like:: if $_LP_SHELL_zsh; then with:: if (( $_LP_SHELL_zsh )); then _lp_battery() ------------- Return changed from stdout to ``$lp_battery`` Replace assignment statements like:: battery="$(_lp_battery)" with:: local lp_battery _lp_battery battery=$lp_battery See also: :func:`_lp_battery`. _lp_battery_color() ------------------- Return changed from stdout to ``$lp_battery_color`` Replace assignment statements like:: battery_color="$(_lp_battery_color)" with:: local lp_battery_color _lp_battery_color battery_color=$lp_battery_color See also: :func:`_lp_battery_color`. _lp_bzr_branch() ---------------- Return changed from stdout to ``$lp_vcs_branch`` Recommended that :func:`_lp_vcs_branch` is used instead. Replace assignment statements like:: branch="$(_lp_bzr_branch)" with:: local lp_vcs_branch if _lp_bzr_branch; then branch=$lp_vcs_branch fi _lp_bzr_branch_color() ---------------------- Removed, replace by :func:`_lp_vcs_details_color`. If the exact previous output is needed, you can implement a theme function using :doc:`../functions/data/vcs`. Replace assignment statements like:: LP_VCS="$(_lp_bzr_branch_color)" with:: if _lp_find_vcs; local lp_vcs_details_color _lp_vcs_details_color LP_VCS=$lp_vcs_details_color fi _lp_color_map() --------------- Return changed from stdout to ``$ret`` Replace assignment statements like:: output="$(_lp_color_map "$input")" with:: local ret _lp_color_map "$input" output=$ret See also: :func:`_lp_color_map`. _lp_connection() ---------------- Return changed from stdout to ``$lp_connection`` Replace assignment statements like:: connection="$(_lp_connection)" with:: local lp_connection _lp_connection connection=$lp_connection See also: :func:`_lp_connection`. _lp_escape() ------------ Renamed to :attr:`__lp_escape`. Return changed from stdout to ``$ret`` Replace assignment statements like:: output="$(_lp_escape "$input")" with:: local ret __lp_escape "$input" output=$ret _lp_fossil_branch() ------------------- Return changed from stdout to ``$lp_vcs_branch`` Recommended that :func:`_lp_vcs_branch` is used instead. No longer returns "no-branch" if branch not found. Replace assignment statements like:: branch="$(_lp_fossil_branch)" with:: local lp_vcs_branch if _lp_fossil_branch; then branch=$lp_vcs_branch else branch="no-branch" fi _lp_fossil_branch_color() ------------------------- Removed, replace by :func:`_lp_vcs_details_color`. If the exact previous output is needed, you can implement a theme function using :doc:`../functions/data/vcs`. Replace assignment statements like:: LP_VCS="$(_lp_fossil_branch_color)" with:: if _lp_find_vcs; local lp_vcs_details_color _lp_vcs_details_color LP_VCS=$lp_vcs_details_color fi _lp_get_home_tilde_collapsed() ------------------------------ Renamed to :func:`__lp_pwd_tilde`. Return changed from stdout to ``$lp_pwd_tilde`` Recommended that :attr:`_lp_path_format` is used instead. Replace assignment statements like:: working_dir="$(_lp_get_home_tilde_collapsed)" with:: local lp_pwd_tilde __lp_pwd_tilde working_dir=$lp_pwd_tilde _lp_git_branch() ---------------- Return changed from stdout to ``$lp_vcs_branch`` Recommended that :func:`_lp_vcs_branch` is used instead. No longer returns commit hash if branch not found. Replace assignment statements like:: branch="$(_lp_git_branch)" with:: local lp_vcs_branch if _lp_git_branch; then branch=$lp_vcs_branch else local lp_vcs_commit_id _lp_git_commit_id branch=$lp_vcs_commit_id fi _lp_git_branch_color() ---------------------- Removed, replace by :func:`_lp_vcs_details_color`. Replace assignment statements like:: LP_VCS="$(_lp_git_branch_color)" with:: if _lp_find_vcs; local lp_vcs_details_color _lp_vcs_details_color LP_VCS=$lp_vcs_details_color fi _lp_git_head_status() --------------------- Return changed from stdout to ``$lp_vcs_head_status`` Recommended that :func:`_lp_vcs_head_status` is used instead. Replace assignment statements like:: head_status="$(_lp_git_head_status)" with:: local lp_vcs_head_status _lp_git_head_status head_status=$lp_vcs_head_status See also: :func:`_lp_git_head_status`. _lp_hg_branch() --------------- Return changed from stdout to ``$lp_vcs_branch`` Recommended that :func:`_lp_vcs_branch` is used instead. Replace assignment statements like:: branch="$(_lp_hg_branch)" with:: local lp_vcs_branch if _lp_hg_branch; then branch=$lp_vcs_branch fi _lp_hg_branch_color() --------------------- Removed, replace by :func:`_lp_vcs_details_color`. If the exact previous output is needed, you can implement a theme function using :doc:`../functions/data/vcs`. Replace assignment statements like:: LP_VCS="$(_lp_hg_branch_color)" with:: if _lp_find_vcs; local lp_vcs_details_color _lp_vcs_details_color LP_VCS=$lp_vcs_details_color fi _lp_jobcount_color() -------------------- Return changed from stdout to ``$lp_jobcount_color`` Replace assignment statements like:: jobcount_color="$(_lp_jobcount_color)" with:: local lp_jobcount_color _lp_jobcount_color jobcount_color=$lp_jobcount_color See also: :func:`_lp_jobcount_color`. _lp_load_color() ---------------- Return changed from stdout to ``$lp_load_color`` Replace assignment statements like:: load_color="$(_lp_load_color)" with:: local lp_load_color _lp_load_color load_color=$lp_load_color See also: :func:`_lp_load_color`. _lp_runtime() ------------- Renamed to :func:`_lp_runtime_color`. Return changed from stdout to ``$lp_runtime_color`` Replace assignment statements like:: runtime_color="$(_lp_runtime)" with:: local lp_runtime_color _lp_runtime_color runtime_color=$lp_runtime_color _lp_runtime_after() ------------------- Renamed to :func:`__lp_runtime_after`. Recommended to not use this internal function. _lp_runtime_before() -------------------- Renamed to :func:`__lp_runtime_before`. Recommended to not use this internal function. _lp_set_dirtrim() ----------------- Removed and replaced by :attr:`_lp_path_format`. Support for ``\w`` in ``PS1`` has been dropped. _lp_set_prompt() ---------------- Renamed to :attr:`__lp_set_prompt`. Recommended to not use this internal function. _lp_shorten_path() ------------------ Removed and replaced by :func:`_lp_path_format`. Replace assignment statements like:: cwd="$(_lp_shorten_path)" with:: local lp_path_format _lp_path_format "$LP_COLOR_PATH" "$LP_COLOR_PATH_LAST_DIR" "$LP_COLOR_PATH_VCS_ROOT" "$LP_COLOR_PATH_SHORTENED" "/" "$LP_COLOR_PATH_SEPARATOR" cwd=$lp_path_format _lp_smart_mark() ---------------- Return changed from stdout to ``$lp_smart_mark`` Replace assignment statements like:: mark="$(_lp_smart_mark)" with:: local lp_smart_mark _lp_smart_mark mark=$lp_smart_mark See also: :func:`_lp_smart_mark`. _lp_source_config() ------------------- Renamed to :attr:`__lp_source_config`. Recommended to not use this internal function. _lp_svn_branch() ---------------- Return changed from stdout to ``$lp_vcs_branch`` Recommended that :func:`_lp_vcs_branch` is used instead. No longer returns directory name if branch not found. Replace assignment statements like:: branch="$(_lp_svn_branch)" with:: local lp_vcs_branch if _lp_svn_branch; then branch=$lp_vcs_branch else local lp_vcs_commit_id _lp_svn_commit_id branch=$lp_vcs_commit_id fi _lp_svn_branch_color() ---------------------- Removed, replace by :func:`_lp_vcs_details_color`. If the exact previous output is needed, you can implement a theme function using :doc:`../functions/data/vcs`. Replace assignment statements like:: LP_VCS="$(_lp_svn_branch_color)" with:: if _lp_find_vcs; local lp_vcs_details_color _lp_vcs_details_color LP_VCS=$lp_vcs_details_color fi _lp_temp_acpi() --------------- Renamed to :func:`__lp_temp_acpi`. Recommended that :func:`_lp_temperature` is used instead. Return changed from ``$temperature`` to ``$lp_temperature``. Replace statements like:: _lp_temp_acpi # use $temperature with:: __lp_temp_acpi # use $lp_temperature _lp_temp_detect() ----------------- Renamed to :func:`__lp_temp_detect`. Recommended to not use this internal function. _lp_temp_sensors() ------------------ Renamed to :func:`__lp_temp_sensors`. Recommended that :func:`_lp_temperature` is used instead. Return changed from ``$temperature`` to ``$lp_temperature``. Replace statements like:: _lp_temp_sensors # use $temperature with:: __lp_temp_sensors # use $lp_temperature _lp_temperature() ----------------- Renamed to :func:`_lp_temperature_color`. Return changed from stdout to ``$lp_temperature_color`` Replace assignment statements like:: temp_color="$(_lp_temperature)" with:: local lp_temperature_color _lp_temperature_color temp_color=$lp_temperature_color Not to be confused with the new :func:`_lp_temperature`. _lp_time() ---------- Split into :func:`_lp_time()`, :func:`_lp_time_color()`, :func:`_lp_analog_time()`, and :func:`_lp_analog_time_color()`. The return value is no longer stored in ``LP_TIME``. Replace statements like:: _lp_time with:: local lp_time_color lp_analog_time_color if _lp_time_color; then LP_TIME="${lp_time_color} " elif _lp_analog_time_color; then LP_TIME="${lp_analog_time_color} " else LP_TIME= fi _lp_upwards_find() ------------------ Replaced by :func:`_lp_find_vcs`. Replace statements like:: _lp_upwards_find .hg || return with:: local lp_vcs_type lp_vcs_root _lp_find_vcs && [[ $lp_vcs_type == hg ]] || return Deprecations ++++++++++++ Public Deprecations =================== .. _lp_disabled_vcs_path: $LP_DISABLED_VCS_PATH --------------------- Replaced by :attr:`LP_DISABLED_VCS_PATHS` array variable. Replace a set statement like:: LP_DISABLED_VCS_PATH="/my/one/path:/my/other/path" with:: LP_DISABLED_VCS_PATHS=("/my/one/path" "/my/other/path") .. _lp_path_default: $LP_PATH_DEFAULT ---------------- Replaced by :attr:`LP_PATH_METHOD`. If one of the many new shortening methods does not effectively replace your use case, please open an enhancement request. .. _prompt_dirtrim: $PROMPT_DIRTRIM --------------- ``$PROMPT_DIRTRIM`` calculation is no longer supported. Replaced by :attr:`LP_PATH_METHOD` set to ``truncate_chars_from_path_left``. .. _lp_path_keep: $LP_PATH_KEEP=-1 ---------------- :attr:`LP_PATH_KEEP` set to ``-1`` is replaced by :attr:`LP_PATH_METHOD` set to ``truncate_to_last_dir``. .. _lp_title: _lp_title() ----------- Replaced by :func:`_lp_formatted_title`. Most likely would have been used in a template or ``.ps1`` file. Replace a call like:: LP_TITLE="$(_lp_title "$PS1")" PS1="${LP_TITLE}${PS1}" with:: _lp_formatted_title "$PS1" Private Deprecations ==================== _lp_bool() ---------- Replaced by manually storing return codes. Most often, the return code can be used in an ``if`` block, and never needs to be stored:: if _lp_http_proxy; then ... If the function returns a more complicated return code, you can store it like this:: _lp_user local -i code="$?" or like this if the code only matters if it is not zero:: _lp_user || local -i code="$?" _lp_sb() -------- Replaced by data functions indicating if they returned data or not. For example:: if _lp_http_proxy; then my_data="${lp_http_proxy} " else my_data="" fi If the string source is not a data function, you can replace this function with a structure like:: [[ -n $my_data ]] && my_data=" ${my_data} " With spaces before or after as needed. _lp_sl() -------- See ``_lp_sb()`` above. _lp_sr() -------- See ``_lp_sb()`` above. liquidprompt-2.2.1/docs/upgrading/v2.1.rst000066400000000000000000000012461464055045500204100ustar00rootroot00000000000000Version 2.1 Upgrade Notes ************************* Upgrading to version 2.1 is almost completely painless, as there is only one deprecation. .. contents:: :local: .. spelling:word-list:: lp Deprecations ++++++++++++ Public Deprecations =================== $LP_ENABLE_FQDN --------------- Replaced by :attr:`LP_HOSTNAME_METHOD`. Replace a set statement like:: LP_ENABLE_FQDN=1 with:: LP_HOSTNAME_METHOD=full Private Deprecations ==================== _lp_as_text() ------------- Replaced by :func:`__lp_strip_escapes`. Replace a statement like:: text="$(_lp_as_text "$string")" with:: local ret __lp_strip_escapes "$string" text="$ret" liquidprompt-2.2.1/example.bashrc000066400000000000000000000012331464055045500170730ustar00rootroot00000000000000 # If you want to use Liquid Prompt without bothering about its configuration, # just run the following command: # cp example.bashrc ~/.bashrc # The following is a minimalistic Bash config file # Use the system config if it exists if [ -f /etc/bashrc ]; then . /etc/bashrc # --> Read /etc/bashrc, if present. elif [ -f /etc/bash.bashrc ]; then . /etc/bash.bashrc # --> Read /etc/bash.bashrc, if present. fi # The following lines are only for interactive shells [[ $- = *i* ]] || return # Use Bash completion, if installed if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi # Use Liquid Prompt source ~/liquidprompt/liquidprompt liquidprompt-2.2.1/liquidprompt000077500000000000000000005154371464055045500167530ustar00rootroot00000000000000################################################################################ # LIQUID PROMPT # An intelligent and non-intrusive prompt for Bash and zsh ################################################################################ # shellcheck shell=bash _LP_VERSION=(2 2 1) # Licensed under the AGPL version 3 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # See the README.md file for a summary of features. # Issue #161: do not load if not an interactive shell # Do not exit if '--no-activate' flag was passed, as it overrides this check # shellcheck disable=SC2268 [ "x${-##*i}" = "x$-" ] || [ -z "${TERM-}" ] || [ "x${TERM-}" = xdumb ] || [ "x${TERM-}" = xunknown ] && [ "x${1-}" != "x--no-activate" ] && return if test -n "${BASH_VERSION-}"; then # Check for recent enough version of bash. if (( ${BASH_VERSINFO[0]:-0} < 3 || ( ${BASH_VERSINFO[0]:-0} == 3 && ${BASH_VERSINFO[1]:-0} < 2 ) )); then echo "liquidprompt: Bash version $BASH_VERSION not supported" >&2 return fi _LP_SHELL_bash=1 _LP_SHELL_zsh=0 _LP_OPEN_ESC="\[" _LP_CLOSE_ESC="\]" _LP_MARK_SYMBOL='$' _LP_FIRST_INDEX=0 _LP_PERCENT='%' # must be escaped on zsh # shellcheck disable=SC1003 _LP_BACKSLASH='\\' # must be escaped on bash # Escape the given strings # Must be used for all strings injected in PS1 that may comes from remote sources, # like $PWD, VCS branch names... __lp_escape() { ret="${1//\\/\\\\}" if shopt -q promptvars ; then ret="${ret//\$/\\\$}" ret="${ret//\`/\\\`}" fi } __lp_strip_escapes() { ret="$1" while [[ "$ret" == *"$_LP_OPEN_ESC"* ]]; do ret="${ret%%"$_LP_OPEN_ESC"*}${ret#*"$_LP_CLOSE_ESC"}" done ret="${ret//\\\\/\\}" if shopt -q promptvars ; then ret="${ret//\\\$/\$}" ret="${ret//\\\`/\`}" fi } elif test -n "${ZSH_VERSION-}" ; then # Check for recent enough version of zsh. if (( ${ZSH_VERSION:0:1} < 5 )); then echo "liquidprompt: Zsh version $ZSH_VERSION not supported" >&2 return fi _LP_SHELL_bash=0 _LP_SHELL_zsh=1 _LP_OPEN_ESC="%{" _LP_CLOSE_ESC="%}" _LP_MARK_SYMBOL='%%' if [[ -o ksh_arrays ]]; then _LP_FIRST_INDEX=0 else _LP_FIRST_INDEX=1 fi _LP_PERCENT='%%' # shellcheck disable=SC1003 _LP_BACKSLASH='\' __lp_escape() { ret="${1//\\/\\\\}" ret="${ret//\%/%%}" if [[ -o promptbang ]]; then ret="${ret//!/!!}" fi if [[ -o promptsubst ]]; then ret="${ret//\$/\\\$}" ret="${ret//\`/\\\`}" fi } __lp_strip_escapes() { # shellcheck disable=SC2296 ret="${(S)1//"${_LP_OPEN_ESC}"*"${_LP_CLOSE_ESC}"}" ret="${ret//\\\\/\\}" ret="${ret//\%\%/%}" if [[ -o promptbang ]]; then ret="${ret//!!/!}" fi if [[ -o promptsubst ]]; then ret="${ret//\\\$/\$}" ret="${ret//\\\`/\`}" fi } else echo "liquidprompt: shell not supported" >&2 return fi __lp_use_bash_preexec() { # If https://github.com/rcaloras/bash-preexec is present, we can (and should, because it interferes with # PROMPT_COMMAND and DEBUG) use the zsh-hook like behavior it provides. [[ "${__bp_imported-}" == "defined" ]] } __lp_array_contains() { local target="$1" shift for element; do if [[ $element == "$target" ]]; then return 0 fi done return 1 } ############### # OS specific # ############### # LP_OS detection, default to Linux case "$(uname)" in FreeBSD) LP_OS=FreeBSD ;; DragonFly) LP_OS=FreeBSD ;; OpenBSD) LP_OS=OpenBSD ;; Darwin) LP_OS=Darwin ;; SunOS) LP_OS=SunOS ;; *) LP_OS=Linux ;; esac _lp_os() { # Fine-grained OS detection: arch, family, kernel, distrib, version. (( LP_ENABLE_OS )) || return 2 # Output variables: lp_os_arch= lp_os_family= lp_os_kernel= lp_os_distrib= lp_os_version= local uname_sm kernel # Get the kernel (and possibly the arch). if (( LP_ENABLE_OS_ARCH )); then # We can get the arch along, with a single subshell. uname_sm="$(uname -s -m)" IFS=' ' read -r kernel lp_os_arch <<<"$uname_sm" else # In any case, we need to know the kernel. kernel="$(uname -s)" fi if (( LP_ENABLE_OS_KERNEL || LP_ENABLE_OS_FAMILY || LP_ENABLE_OS_DISTRIB || LP_ENABLE_OS_VERSION )); then case "$kernel" in FreeBSD) if (( LP_ENABLE_OS_FAMILY )); then lp_os_family=BSD; fi if (( LP_ENABLE_OS_KERNEL )); then lp_os_kernel=FreeBSD; fi ;; DragonFly) if (( LP_ENABLE_OS_FAMILY )); then lp_os_family=BSD; fi if (( LP_ENABLE_OS_KERNEL )); then lp_os_kernel=DragonFly; fi ;; OpenBSD) if (( LP_ENABLE_OS_FAMILY )); then lp_os_family=BSD; fi if (( LP_ENABLE_OS_KERNEL )); then lp_os_kernel=OpenBSD; fi ;; Darwin) if (( LP_ENABLE_OS_FAMILY )); then lp_os_family=BSD; fi if (( LP_ENABLE_OS_KERNEL )); then lp_os_kernel=Darwin; fi ;; SunOS) if (( LP_ENABLE_OS_FAMILY )); then lp_os_family=UNIX; fi if (( LP_ENABLE_OS_KERNEL )); then lp_os_kernel=SunOS; fi ;; CYGWIN*) if (( LP_ENABLE_OS_FAMILY )); then lp_os_family=Windows; fi if (( LP_ENABLE_OS_KERNEL )); then lp_os_kernel=Cygwin; fi ;; MSYS*) if (( LP_ENABLE_OS_FAMILY )); then lp_os_family=Windows; fi if (( LP_ENABLE_OS_KERNEL )); then lp_os_kernel=MSYS; fi ;; MINGW*) if (( LP_ENABLE_OS_FAMILY )); then lp_os_family=Windows; fi if (( LP_ENABLE_OS_KERNEL )); then lp_os_kernel=MinGW; fi ;; Linux) if (( LP_ENABLE_OS_KERNEL )); then lp_os_kernel=Linux; fi if (( LP_ENABLE_OS_FAMILY )); then if [[ "$kernel" == "Linux" ]]; then osfamily="$(uname -o)" if [[ "$osfamily" == "Android" ]]; then lp_os_family=Android return fi # Android fi # Linux lp_os_family=GNU fi # TODO parse HOME_URL and add an hyperlink. if (( LP_ENABLE_OS_DISTRIB && LP_ENABLE_OS_VERSION )); then if _lp_grep_fields "/etc/os-release" "=" "ID" "VERSION_CODENAME"; then lp_os_distrib=${lp_grep_fields[_LP_FIRST_INDEX+0]-} lp_os_version=${lp_grep_fields[_LP_FIRST_INDEX+1]-} fi elif (( LP_ENABLE_OS_DISTRIB )); then if _lp_grep_fields "/etc/os-release" "=" "ID"; then lp_os_distrib=${lp_grep_fields[_LP_FIRST_INDEX+0]-} fi elif (( LP_ENABLE_OS_VERSION )); then if _lp_grep_fields "/etc/os-release" "=" "VERSION_CODENAME"; then lp_os_version=${lp_grep_fields[_LP_FIRST_INDEX+0]-} fi fi ;; esac fi if [[ -z "${lp_os_arch}${lp_os_family}${lp_os_kernel}${lp_os_distrib}${lp_os_version}" ]]; then return 1 fi } _lp_os_color() { # Substitute lp_os_* names with icons/colored strings (from LP_MARK_OS), # or hash colored versions. # Join everything with LP_MARK_OS_SEP. lp_os_color= local lp_os_arch lp_os_family lp_os_kernel lp_os_distrib lp_os_version _lp_os || return "$?" local lp_substitute lp_hash_color lp_join local active active=() for value in \ "$lp_os_arch" "$lp_os_family" "$lp_os_kernel" "$lp_os_distrib" "$lp_os_version"; do if [[ -n "$value" ]]; then if _lp_substitute "$value" "${LP_MARK_OS[@]}"; then active+=("$lp_substitute") elif _lp_hash_color "$value"; then active+=("$lp_hash_color") else active+=("$value") fi fi done if [[ ${#active} -gt 0 ]]; then _lp_join "$LP_MARK_OS_SEP" "${active[@]}" lp_os_color="$lp_join" else return 1 fi } ################# # CONFIGURATION # ################# # Return true if the current Liquid Prompt version is greater than or equal to the specified version. # Return 1 if minor or less version difference, 2 if major difference. _lp_version_greatereq() { # major, minor, [patch], [string], [number] local major="$1" minor="$2" patch="${3-}" string="${4-}" number="${5-}" if (( major > _LP_VERSION[_LP_FIRST_INDEX+0] )); then return 2 elif (( major == _LP_VERSION[_LP_FIRST_INDEX+0] )); then if (( minor > _LP_VERSION[_LP_FIRST_INDEX+1] )); then return 1 elif (( minor == _LP_VERSION[_LP_FIRST_INDEX+1] )) && [[ -n $patch ]]; then if (( patch > _LP_VERSION[_LP_FIRST_INDEX+2] )); then return 1 elif (( patch == _LP_VERSION[_LP_FIRST_INDEX+2] )) && [[ -n $string && -n $number ]]; then if [[ $string == "${_LP_VERSION[_LP_FIRST_INDEX+3]-}" ]]; then if (( number > _LP_VERSION[_LP_FIRST_INDEX+4] )); then return 1 fi elif [[ ${_LP_VERSION[_LP_FIRST_INDEX+3]-} == "alpha" || \ ( ${_LP_VERSION[_LP_FIRST_INDEX+3]-} == "beta" && \ $string == "rc" ) ]]; then return 1 fi fi fi fi return 0 } # Load the user configuration and setup defaults. # shellcheck disable=SC2034 __lp_source_config() { local lp_terminal_format af_color='' ab_color='' # Colors: variables are local so they will have a value only # during config loading and will not conflict with other values # with the same names defined by the user outside the config. local BOLD="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${_LP_CLOSE_ESC}" # Foreground colors __lp_foreground_color 0 local BLACK="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}" local BOLD_GRAY="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${_LP_CLOSE_ESC}" __lp_foreground_color 1 local RED="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}" local BOLD_RED="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${_LP_CLOSE_ESC}" __lp_foreground_color 0 __lp_background_color 1 local WARN_RED="${_LP_OPEN_ESC}${af_color}${ab_color}${_LP_CLOSE_ESC}" __lp_foreground_color 7 local CRIT_RED="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${ab_color}${_LP_CLOSE_ESC}" __lp_foreground_color 3 local DANGER_RED="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${ab_color}${_LP_CLOSE_ESC}" __lp_foreground_color 2 local GREEN="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}" local BOLD_GREEN="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${_LP_CLOSE_ESC}" __lp_foreground_color 3 local YELLOW="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}" local BOLD_YELLOW="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${_LP_CLOSE_ESC}" __lp_foreground_color 4 local BLUE="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}" local BOLD_BLUE="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${_LP_CLOSE_ESC}" __lp_foreground_color 5 local PURPLE="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}" local MAGENTA="${PURPLE}" local PINK="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${_LP_CLOSE_ESC}" local BOLD_PURPLE="${PINK}" local BOLD_MAGENTA="${PINK}" __lp_foreground_color 6 local CYAN="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}" local BOLD_CYAN="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${_LP_CLOSE_ESC}" __lp_foreground_color 7 local WHITE="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}" local BOLD_WHITE="${_LP_OPEN_ESC}${_LP_TI_BOLD-}${af_color}${_LP_CLOSE_ESC}" # NO_COL is special: it will be used at runtime, not just during config loading NO_COL="${_LP_OPEN_ESC}${_LP_TI_RESET-}${_LP_CLOSE_ESC}" # compute the hash of the hostname and get the corresponding number in # [1-6] (red,green,yellow,blue,purple or cyan) local lp_hostname_hash __lp_hostname_hash __lp_foreground_color "$(( 1 + lp_hostname_hash % 6 ))" LP_COLOR_HOST_HASH="${_LP_OPEN_ESC}${af_color}${_LP_CLOSE_ESC}" # Default values (globals) LP_TIME_FORMAT=${LP_TIME_FORMAT:-"%H:%M:%S"} LP_BATTERY_THRESHOLD=${LP_BATTERY_THRESHOLD:-75} LP_DISK_THRESHOLD=${LP_DISK_THRESHOLD:-102400} # 100 MiB in KiB LP_DISK_THRESHOLD_PERC=${LP_DISK_THRESHOLD_PERC:-10} # 10% or less LP_DISK_PRECISION=${LP_DISK_PRECISION:-2} LP_RAM_THRESHOLD=${LP_RAM_THRESHOLD:-102400} # 100 MiB in KiB LP_RAM_THRESHOLD_PERC=${LP_RAM_THRESHOLD_PERC:-10} # 10% or less LP_RAM_PRECISION=${LP_RAM_PRECISION:-2} LP_LOAD_THRESHOLD=${LP_LOAD_THRESHOLD:-0.60} LP_LOAD_CAP=${LP_LOAD_CAP:-2.0} LP_TEMP_THRESHOLD=${LP_TEMP_THRESHOLD:-60} LP_WIFI_STRENGTH_THRESHOLD=${LP_WIFI_STRENGTH_THRESHOLD:-40} LP_RUNTIME_THRESHOLD=${LP_RUNTIME_THRESHOLD:-2} LP_RUNTIME_BELL_THRESHOLD=${LP_RUNTIME_BELL_THRESHOLD:-10} LP_PATH_LENGTH=${LP_PATH_LENGTH:-35} LP_PATH_KEEP=${LP_PATH_KEEP:-2} LP_PATH_CHARACTER_KEEP=${LP_PATH_CHARACTER_KEEP:-3} LP_PATH_METHOD=${LP_PATH_METHOD:-truncate_chars_from_path_left} LP_PATH_VCS_ROOT=${LP_PATH_VCS_ROOT:-1} LP_HOSTNAME_ALWAYS=${LP_HOSTNAME_ALWAYS:-0} LP_HOSTNAME_METHOD=${LP_HOSTNAME_METHOD:-short} LP_USER_ALWAYS=${LP_USER_ALWAYS:-1} LP_ALWAYS_DISPLAY_VALUES=${LP_ALWAYS_DISPLAY_VALUES:-1} LP_DISPLAY_VALUES_AS_PERCENTS=${LP_DISPLAY_VALUES_AS_PERCENTS:-0} LP_PS1=${LP_PS1:-""} LP_PS1_PREFIX=${LP_PS1_PREFIX:-""} LP_PS1_POSTFIX=${LP_PS1_POSTFIX:-""} LP_DELIMITER_KUBECONTEXT_SUFFIX=${LP_DELIMITER_KUBECONTEXT_SUFFIX:-""} LP_DELIMITER_KUBECONTEXT_PREFIX=${LP_DELIMITER_KUBECONTEXT_PREFIX:-""} LP_ENV_VARS=( ${LP_ENV_VARS[@]+"${LP_ENV_VARS[@]}"} ) LP_ENABLE_DISPLAY=${LP_ENABLE_DISPLAY:-1} LP_ENABLE_CHROOT=${LP_ENABLE_CHROOT:-1} LP_ENABLE_MULTIPLEXER=${LP_ENABLE_MULTIPLEXER:-1} LP_ENABLE_PERM=${LP_ENABLE_PERM:-1} LP_ENABLE_SHORTEN_PATH=${LP_ENABLE_SHORTEN_PATH:-1} LP_ENABLE_PROXY=${LP_ENABLE_PROXY:-1} LP_ENABLE_ENV_VARS=${LP_ENABLE_ENV_VARS:-1} LP_ENABLE_TEMP=${LP_ENABLE_TEMP:-1} LP_ENABLE_JOBS=${LP_ENABLE_JOBS:-1} LP_ENABLE_DETACHED_SESSIONS=${LP_ENABLE_DETACHED_SESSIONS:-1} LP_ENABLE_LOAD=${LP_ENABLE_LOAD:-1} LP_ENABLE_BATT=${LP_ENABLE_BATT:-1} LP_ENABLE_RAM=${LP_ENABLE_RAM:-1} LP_ENABLE_DISK=${LP_ENABLE_DISK:-0} LP_ENABLE_GIT=${LP_ENABLE_GIT:-1} LP_ENABLE_SVN=${LP_ENABLE_SVN:-1} LP_ENABLE_FOSSIL=${LP_ENABLE_FOSSIL:-1} LP_ENABLE_HG=${LP_ENABLE_HG:-1} LP_HG_COMMAND=${LP_HG_COMMAND:-hg} LP_ENABLE_BZR=${LP_ENABLE_BZR:-1} LP_ENABLE_VCS_REMOTE=${LP_ENABLE_VCS_REMOTE:-0} LP_ENABLE_TIME=${LP_ENABLE_TIME:-0} LP_TIME_ANALOG=${LP_TIME_ANALOG:-0} LP_ENABLE_RUNTIME=${LP_ENABLE_RUNTIME:-1} LP_ENABLE_RUNTIME_BELL=${LP_ENABLE_RUNTIME_BELL:-0} LP_ENABLE_VIRTUALENV=${LP_ENABLE_VIRTUALENV:-1} LP_ENABLE_NODE_VENV=${LP_ENABLE_NODE_VENV:-0} LP_ENABLE_RUBY_VENV=${LP_ENABLE_RUBY_VENV:-1} LP_RUBY_RVM_PROMPT_OPTIONS=( ${LP_RUBY_RVM_PROMPT_OPTIONS[@]+"${LP_RUBY_RVM_PROMPT_OPTIONS[@]}"} ) [[ ${#LP_RUBY_RVM_PROMPT_OPTIONS[@]} == 0 ]] && LP_RUBY_RVM_PROMPT_OPTIONS=(i v g s) LP_ENABLE_PERL_VENV=${LP_ENABLE_PERL_VENV:-1} LP_ENABLE_TERRAFORM=${LP_ENABLE_TERRAFORM:-0} LP_ENABLE_CONTAINER=${LP_ENABLE_CONTAINER:-0} LP_ENABLE_SCLS=${LP_ENABLE_SCLS:-1} LP_ENABLE_AWS_PROFILE=${LP_ENABLE_AWS_PROFILE:-1} LP_ENABLE_MODULES=${LP_ENABLE_MODULES:-1} LP_ENABLE_MODULES_VERSIONS=${LP_ENABLE_MODULES_VERSIONS:-1} LP_ENABLE_MODULES_HASHCOLOR=${LP_ENABLE_MODULES_HASHCOLOR:-0} LP_ENABLE_VCS_ROOT=${LP_ENABLE_VCS_ROOT:-0} LP_ENABLE_TITLE=${LP_ENABLE_TITLE:-0} LP_ENABLE_SCREEN_TITLE=${LP_ENABLE_SCREEN_TITLE:-0} LP_ENABLE_TITLE_COMMAND=${LP_ENABLE_TITLE_COMMAND:-1} LP_ENABLE_TMUX_TITLE_PANES=${LP_ENABLE_TMUX_TITLE_PANES:-1} LP_ENABLE_SSH_COLORS=${LP_ENABLE_SSH_COLORS:-0} LP_DISABLED_VCS_PATHS=( ${LP_DISABLED_VCS_PATHS[@]+"${LP_DISABLED_VCS_PATHS[@]}"} ) LP_TEMP_SYSFS_IGNORE_FILES=( ${LP_TEMP_SYSFS_IGNORE_FILES[@]+"${LP_TEMP_SYSFS_IGNORE_FILES[@]}"} ) LP_ENABLE_SUDO=${LP_ENABLE_SUDO:-0} LP_ENABLE_COLOR=${LP_ENABLE_COLOR:-1} LP_ENABLE_ERROR=${LP_ENABLE_ERROR:-1} LP_ENABLE_ERROR_MEANING=${LP_ENABLE_ERROR_MEANING:-0} LP_ENABLE_ERROR_MEANING_EXTENDED=${LP_ENABLE_ERROR_MEANING_EXTENDED:-0} LP_ENABLE_DIRSTACK=${LP_ENABLE_DIRSTACK:-0} LP_ENABLE_KUBECONTEXT=${LP_ENABLE_KUBECONTEXT:-0} LP_ENABLE_KUBE_NAMESPACE=${LP_ENABLE_KUBE_NAMESPACE:-0} LP_ENABLE_CMAKE=${LP_ENABLE_CMAKE:-0} LP_ENABLE_SHLVL=${LP_ENABLE_SHLVL:-1} LP_SHLVL_THRESHOLD=${LP_SHLVL_THRESHOLD:-2} LP_ENABLE_WIFI_STRENGTH=${LP_ENABLE_WIFI_STRENGTH:-0} LP_ENABLE_OS=${LP_ENABLE_OS:-0} LP_ENABLE_OS_ARCH=${LP_ENABLE_OS_ARCH:-0} LP_ENABLE_OS_FAMILY=${LP_ENABLE_OS_FAMILY:-0} LP_ENABLE_OS_KERNEL=${LP_ENABLE_OS_KERNEL:-1} LP_ENABLE_OS_DISTRIB=${LP_ENABLE_OS_DISTRIB:-0} LP_ENABLE_OS_VERSION=${LP_ENABLE_OS_VERSION:-1} LP_ENABLE_HYPERLINKS=${LP_ENABLE_HYPERLINKS:-0} LP_ENABLE_PATH=${LP_ENABLE_PATH:-1} LP_HIDE_EMPTY_ERROR=${LP_HIDE_EMPTY_ERROR:-1} LP_MARK_DEFAULT="${LP_MARK_DEFAULT:-$_LP_MARK_SYMBOL}" LP_MARK_BATTERY="${LP_MARK_BATTERY:-"⌁"}" LP_MARK_ADAPTER="${LP_MARK_ADAPTER:-"⏚"}" LP_MARK_LOAD="${LP_MARK_LOAD:-"⌂"}" LP_MARK_TEMP="${LP_MARK_TEMP:-"θ"}" LP_MARK_PROXY="${LP_MARK_PROXY:-"↥"}" LP_MARK_ENV_VARS_OPEN="${LP_MARK_ENV_VARS_OPEN:-"("}" LP_MARK_ENV_VARS_SEP="${LP_MARK_ENV_VARS_SEP:-" "}" LP_MARK_ENV_VARS_CLOSE="${LP_MARK_ENV_VARS_CLOSE:-")"}" LP_MARK_HG="${LP_MARK_HG:-"☿"}" LP_MARK_SVN="${LP_MARK_SVN:-"‡"}" LP_MARK_GIT="${LP_MARK_GIT:-"±"}" LP_MARK_VCSH="${LP_MARK_VCSH:-"|"}" LP_MARK_FOSSIL="${LP_MARK_FOSSIL:-"⌘"}" LP_MARK_BZR="${LP_MARK_BZR:-"⚯"}" LP_MARK_DISABLED="${LP_MARK_DISABLED:-"⌀"}" LP_MARK_UNTRACKED="${LP_MARK_UNTRACKED:-"*"}" LP_MARK_STASH="${LP_MARK_STASH:-"+"}" LP_MARK_VCS_REMOTE="${LP_MARK_VCS_REMOTE:-"⭚"}" LP_MARK_BRACKET_OPEN="${LP_MARK_BRACKET_OPEN:-"["}" LP_MARK_BRACKET_CLOSE="${LP_MARK_BRACKET_CLOSE:-"]"}" LP_MARK_MULTIPLEXER_OPEN="${LP_MARK_MULTIPLEXER_OPEN:-"$LP_MARK_BRACKET_OPEN"}" LP_MARK_MULTIPLEXER_CLOSE="${LP_MARK_MULTIPLEXER_CLOSE:-"$LP_MARK_BRACKET_CLOSE"}" LP_MARK_SHORTEN_PATH="${LP_MARK_SHORTEN_PATH:-" … "}" LP_MARK_PREFIX="${LP_MARK_PREFIX:-" "}" LP_MARK_PERM="${LP_MARK_PERM:-":"}" LP_MARK_DIRSTACK="${LP_MARK_DIRSTACK:-"⚞"}" LP_MARK_SHLVL="${LP_MARK_SHLVL:-"└"}" LP_MARK_WIFI="${LP_MARK_WIFI:-"📶"}" LP_MARK_DEV_OPEN="${LP_MARK_DEV_OPEN:-"<"}" LP_MARK_DEV_CLOSE="${LP_MARK_DEV_CLOSE:-">"}" LP_MARK_DEV_MID="${LP_MARK_DEV_MID:-"|"}" LP_MARK_MODULES_OPEN="${LP_MARK_MODULES_OPEN:-""}" LP_MARK_MODULES_SEP="${LP_MARK_MODULES_SEP:-":"}" LP_MARK_MODULES_CLOSE="${LP_MARK_MODULES_CLOSE:-""}" LP_MARK_CMAKE="${LP_MARK_CMAKE:-":"}" LP_MARK_KUBECONTEXT=${LP_MARK_KUBECONTEXT:-"⎈"} LP_MARK_JOBS_SEPARATOR="${LP_MARK_JOBS_SEPARATOR:-"/"}" LP_MARK_OS_SEP=${LP_MARK_OS_SEP:-"/"} LP_MARK_OS=( ${LP_MARK_OS[@]+"${LP_MARK_OS[@]}"} ) LP_MARK_DISK="${LP_MARK_DISK:-"🖴 "}" LP_MARK_RAM="${LP_MARK_RAM:-"M"}" LP_COLOR_CMAKE_DEBUG=${LP_COLOR_CMAKE_DEBUG:-$MAGENTA} LP_COLOR_CMAKE_RWDI=${LP_COLOR_CMAKE_RWDI:-$BLUE} LP_COLOR_CMAKE_RELEASE=${LP_COLOR_CMAKE_RELEASE:-$CYAN} LP_COLOR_PATH=${LP_COLOR_PATH:-$NO_COL} lp_terminal_format 8 -1 0 0 -1 LP_COLOR_PATH_SEPARATOR=${LP_COLOR_PATH_SEPARATOR:-$lp_terminal_format} LP_COLOR_PATH_SHORTENED=${LP_COLOR_PATH_SHORTENED:-$lp_terminal_format} lp_terminal_format -1 -1 1 0 LP_COLOR_PATH_VCS_ROOT=${LP_COLOR_PATH_VCS_ROOT:-$lp_terminal_format} LP_COLOR_PATH_LAST_DIR=${LP_COLOR_PATH_LAST_DIR:-$lp_terminal_format} LP_COLOR_PATH_ROOT=${LP_COLOR_PATH_ROOT:-$BOLD_YELLOW} LP_COLOR_PROXY=${LP_COLOR_PROXY:-$BOLD_BLUE} LP_COLOR_ENV_VARS_UNSET=${LP_COLOR_ENV_VARS_UNSET:-$BLUE} LP_COLOR_ENV_VARS_SET=${LP_COLOR_ENV_VARS_SET:-$BOLD_BLUE} LP_COLOR_JOB_D=${LP_COLOR_JOB_D:-$YELLOW} LP_COLOR_JOB_R=${LP_COLOR_JOB_R:-$BOLD_YELLOW} LP_COLOR_JOB_Z=${LP_COLOR_JOB_Z:-$BOLD_YELLOW} LP_COLOR_ERR=${LP_COLOR_ERR:-$PURPLE} LP_COLOR_ERR_MEANING=${LP_COLOR_ERR_MEANING:-$LP_COLOR_ERR} LP_COLOR_MARK=${LP_COLOR_MARK:-$BOLD} LP_COLOR_MARK_ROOT=${LP_COLOR_MARK_ROOT:-$BOLD_RED} LP_COLOR_MARK_SUDO=${LP_COLOR_MARK_SUDO:-$LP_COLOR_MARK_ROOT} LP_COLOR_USER_LOGGED=${LP_COLOR_USER_LOGGED:-""} LP_COLOR_USER_ALT=${LP_COLOR_USER_ALT:-$BOLD} LP_COLOR_USER_ROOT=${LP_COLOR_USER_ROOT:-$BOLD_YELLOW} LP_COLOR_HOST=${LP_COLOR_HOST:-""} LP_COLOR_SSH=${LP_COLOR_SSH:-$BLUE} LP_COLOR_SU=${LP_COLOR_SU:-$BOLD_YELLOW} LP_COLOR_TELNET=${LP_COLOR_TELNET:-$WARN_RED} LP_COLOR_X11_ON=${LP_COLOR_X11_ON:-$GREEN} LP_COLOR_X11_OFF=${LP_COLOR_X11_OFF:-$YELLOW} LP_COLOR_WRITE=${LP_COLOR_WRITE:-$GREEN} LP_COLOR_NOWRITE=${LP_COLOR_NOWRITE:-$RED} LP_COLOR_UP=${LP_COLOR_UP:-$GREEN} LP_COLOR_COMMITS=${LP_COLOR_COMMITS:-$YELLOW} LP_COLOR_COMMITS_BEHIND=${LP_COLOR_COMMITS_BEHIND:-$BOLD_RED} LP_COLOR_CHANGES=${LP_COLOR_CHANGES:-$RED} LP_COLOR_DIFF=${LP_COLOR_DIFF:-$PURPLE} LP_COLOR_CHARGING_ABOVE=${LP_COLOR_CHARGING_ABOVE:-$GREEN} LP_COLOR_CHARGING_UNDER=${LP_COLOR_CHARGING_UNDER:-$YELLOW} LP_COLOR_DISCHARGING_ABOVE=${LP_COLOR_DISCHARGING_ABOVE:-$YELLOW} LP_COLOR_DISCHARGING_UNDER=${LP_COLOR_DISCHARGING_UNDER:-$RED} LP_COLOR_TIME=${LP_COLOR_TIME:-$BLUE} LP_COLOR_IN_MULTIPLEXER=${LP_COLOR_IN_MULTIPLEXER:-$BOLD_BLUE} LP_COLOR_RUNTIME=${LP_COLOR_RUNTIME:-$YELLOW} LP_COLOR_VIRTUALENV=${LP_COLOR_VIRTUALENV:-$CYAN} LP_COLOR_NODE_VENV=${LP_COLOR_NODE_VENV:-$LP_COLOR_VIRTUALENV} LP_COLOR_RUBY_VENV=${LP_COLOR_RUBY_VENV:-$LP_COLOR_VIRTUALENV} LP_COLOR_PERL_VENV=${LP_COLOR_PERL_VENV:-$LP_COLOR_VIRTUALENV} LP_COLOR_TERRAFORM=${LP_COLOR_TERRAFORM:-$PINK} LP_COLOR_CONTAINER=${LP_COLOR_CONTAINER:-$BOLD_BLUE} LP_COLOR_DIRSTACK=${LP_COLOR_DIRSTACK:-$BOLD_YELLOW} LP_COLOR_KUBECONTEXT=${LP_COLOR_KUBECONTEXT:-$CYAN} LP_COLOR_AWS_PROFILE=${LP_COLOR_AWS_PROFILE:-$YELLOW} LP_COLOR_MODULES=${LP_COLOR_MODULES:-$BLUE} LP_COLOR_SHLVL=${LP_COLOR_SHLVL:-$BOLD_GREEN} LP_COLOR_DISK=${LP_COLOR_DISK:-$BOLD_RED} LP_COLOR_DISK_UNITS=${LP_COLOR_DISK_UNITS:-$RED} LP_COLOR_RAM=${LP_COLOR_RAM:-$BOLD_RED} LP_COLOR_RAM_UNITS=${LP_COLOR_RAM_UNITS:-$RED} LP_COLORMAP=( ${LP_COLORMAP[@]+"${LP_COLORMAP[@]}"} ) if [[ ${#LP_COLORMAP[@]} == 0 ]]; then LP_COLORMAP=( "" # 0 "$GREEN" # 1 "$BOLD_GREEN" # 2 "$YELLOW" # 3 "$BOLD_YELLOW" # 4 "$RED" # 5 "$BOLD_RED" # 6 "$WARN_RED" # 7 "$CRIT_RED" # 8 "$DANGER_RED" # 9 ) fi # For mocking tests. _LP_LINUX_POWERSUPPLY_PATH="/sys/class/power_supply" _LP_LINUX_WIRELESS_FILE="/proc/net/wireless" _LP_AIRPORT_BIN="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport" _LP_LINUX_RAM_FILE="/proc/meminfo" _LP_BSD_RAM_FILE="/var/run/dmesg.boot" if (( _LP_SHELL_zsh )); then setopt local_options nullglob fi _LP_LINUX_TEMPERATURE_FILES=( /sys/class/hwmon/hwmon*/temp*_input # CentOS has an intermediate /device directory: /sys/class/hwmon/hwmon*/device/temp*_input /sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_input # Older, fallback option /sys/class/thermal/thermal_zone*/temp ) # Debugging flags LP_DEBUG_TIME=${LP_DEBUG_TIME:-0} if [[ ${1-} == --no-config ]]; then shift else # Default config file may be the XDG standard ~/.config/liquidpromptrc, # but heirloom dotfile has priority. local -a configfiles configfiles=("$HOME/.liquidpromptrc" "${XDG_CONFIG_HOME:-"$HOME/.config"}/liquidpromptrc") # trailing ":" is so that ${search#*:} always removes something local configfile search="${XDG_CONFIG_DIRS:-/etc/xdg}:" while [[ -n "$search" ]]; do configfiles+=("${search%%:*}/liquidpromptrc") search="${search#*:}" done configfiles+=("/etc/liquidpromptrc") for configfile in "${configfiles[@]}"; do if [[ -f "$configfile" ]]; then # shellcheck source=/dev/null source "$configfile" break fi done fi for file in "$@"; do # shellcheck disable=SC1090 . "$file" done # Deprecations and compatibility shims if [[ -n "${LP_DISABLED_VCS_PATH-}" ]]; then echo "liquidprompt: LP_DISABLED_VCS_PATH is deprecated. Update your config to use LP_DISABLED_VCS_PATHS array." >&2 (( _LP_SHELL_zsh )) && setopt local_options && setopt sh_word_split local _path IFS=: for _path in $LP_DISABLED_VCS_PATH; do LP_DISABLED_VCS_PATHS+=("$_path") done fi # FIXME Delete this code in version 1.11 if [[ -n "${LP_COLORMAP_1-}" ]]; then echo "liquidprompt: LP_COLORMAP_x variables are deprecated. Update your theme to use LP_COLORMAP array." >&2 LP_COLORMAP=( "$LP_COLORMAP_0" "$LP_COLORMAP_1" "$LP_COLORMAP_2" "$LP_COLORMAP_3" "$LP_COLORMAP_4" "$LP_COLORMAP_5" "$LP_COLORMAP_6" "$LP_COLORMAP_7" "$LP_COLORMAP_8" "$LP_COLORMAP_9" ) unset LP_COLORMAP_0 LP_COLORMAP_1 LP_COLORMAP_2 LP_COLORMAP_3 LP_COLORMAP_4 \ LP_COLORMAP_5 LP_COLORMAP_6 LP_COLORMAP_7 LP_COLORMAP_8 LP_COLORMAP_9 fi if [[ -n ${LP_PATH_DEFAULT-} ]]; then echo "liquidprompt: LP_PATH_DEFAULT is deprecated. Update your config to set LP_PATH_METHOD." >&2 if (( ! LP_ENABLE_SHORTEN_PATH )); then # There is just no elegant way to handle this. Fallback to the old way with basic formatting support. _lp_path_format() { lp_path=$LP_PATH_DEFAULT lp_path_format="${LP_COLOR_PATH}${lp_path}${NO_COL}" } fi fi if [[ -n ${PROMPT_DIRTRIM-} ]] && (( ! LP_ENABLE_SHORTEN_PATH )); then echo "liquidprompt: PROMPT_DIRTRIM support is deprecated. Update your config to set LP_PATH_METHOD='truncate_chars_from_path_left' instead." >&2 # This does mostly the same thing, but with our formatting. LP_ENABLE_SHORTEN_PATH=1 LP_PATH_METHOD="truncate_chars_from_path_left" LP_PATH_KEEP=1 fi if [[ $LP_PATH_KEEP == "-1" ]]; then echo "liquidprompt: LP_PATH_KEEP set to '-1' is deprecated. Update your config to set LP_PATH_METHOD='truncate_to_last_dir' instead." >&2 LP_PATH_METHOD="truncate_to_last_dir" fi if [[ ${LP_ENABLE_FQDN-} == 1 ]]; then echo "liquidprompt: LP_ENABLE_FQDN is deprecated. Update your config to set LP_HOSTNAME_METHOD=full or LP_HOSTNAME_METHOD=fqdn instead." >&2 LP_HOSTNAME_METHOD="full" fi if [[ -n ${LP_PERCENTS_ALWAYS-} ]]; then echo "liquidprompt: LP_PERCENTS_ALWAYS is deprecated. Update your config to set LP_ALWAYS_DISPLAY_VALUES and LP_DISPLAY_VALUES_AS_PERCENTS instead." >&2 LP_ALWAYS_DISPLAY_VALUES=${LP_PERCENTS_ALWAYS} LP_DISPLAY_VALUES_AS_PERCENTS=${LP_PERCENTS_ALWAYS} fi } # Initialize features based on the user config. # shellcheck disable=SC2120 lp_activate() { if (( _LP_SHELL_bash )); then complete -F __lp_theme_bash_complete lp_theme else # zsh # For ZSH, autoload required functions autoload -Uz add-zsh-hook # Enable the autocomplete if the autocomplete system is initialized. __lp_is_function compdef && compdef __lp_theme_zsh_complete lp_theme fi # Disable hooks that we don't need if features will be disabled. __lp_disable_hooks # TermInfo feature detection _lp_af_colors=() _lp_ab_colors=() __lp_foreground_color() { return 2 ; } __lp_background_color() { return 2 ; } # TODO handle this case better. With no colors, no need for any escaping if ! command -v tput >/dev/null; then echo "liquidprompt: 'tput' not available; will not be able to format terminal" >&2 LP_ENABLE_COLOR=0 else _LP_TI_RESET="$( { tput sgr0 || tput me ; } 2>/dev/null )" _LP_TI_BOLD="$( { tput bold || tput md ; } 2>/dev/null )" _LP_TI_UNDERLINE="$( { tput smul || tput us ; } 2>/dev/null )" _LP_TI_COLORS="$( tput colors 2>/dev/null )" _LP_TI_COLORS=${_LP_TI_COLORS:-8} _LP_TI_BELL="$( { tput bel || tput bl ; } 2>/dev/null )" if tput setaf 0 >/dev/null 2>&1; then __lp_foreground_color() { af_color="${_lp_af_colors[$1+1]:=$(tput setaf "$1")}"; } elif tput AF 0 >/dev/null 2>&1; then # FreeBSD __lp_foreground_color() { af_color="${_lp_af_colors[$1+1]:=$(tput AF "$1")}"; } elif tput AF 0 0 0 >/dev/null 2>&1; then # OpenBSD __lp_foreground_color() { af_color="${_lp_af_colors[$1+1]:=$(tput AF "$1" 0 0)}"; } else echo "liquidprompt: terminal '${TERM-}' does not support foreground colors" >&2 fi if tput setab 0 >/dev/null 2>&1; then __lp_background_color() { ab_color="${_lp_ab_colors[$1+1]:=$(tput setab "$1")}"; } elif tput AB 0 >/dev/null 2>&1; then # FreeBSD __lp_background_color() { ab_color="${_lp_ab_colors[$1+1]:=$(tput AB "$1")}"; } elif tput AB 0 0 0 >/dev/null 2>&1; then # OpenBSD __lp_background_color() { ab_color="${_lp_ab_colors[$1+1]:=$(tput AB "$1" 0 0)}"; } else echo "liquidprompt: terminal '${TERM-}' does not support background colors" >&2 fi fi # If tput doesn't exist or lookup failed, still try to send bell _LP_TI_BELL=${_LP_TI_BELL:-$'\a'} __lp_source_config "$@" # Disable feature if the tool is not installed _lp_require_tool() { # zsh does not allow quoting here. # shellcheck disable=SC1105,SC2086 (( LP_ENABLE_$1 )) && { command -v "$2" >/dev/null || eval "LP_ENABLE_$1=0" ; } } _lp_require_tool TIME date _lp_require_tool GIT git _lp_require_tool SVN svn _lp_require_tool FOSSIL fossil _lp_require_tool HG "$LP_HG_COMMAND" _lp_require_tool BZR bzr _lp_require_tool CMAKE cmake _lp_require_tool DISK df _LP_ENABLED_VCSS=() (( LP_ENABLE_GIT )) && _LP_ENABLED_VCSS+=(git) (( LP_ENABLE_SVN )) && _LP_ENABLED_VCSS+=(svn) (( LP_ENABLE_HG )) && _LP_ENABLED_VCSS+=(hg) (( LP_ENABLE_BZR )) && _LP_ENABLED_VCSS+=(bzr) if [[ "$LP_OS" = Darwin ]]; then _lp_require_tool BATT pmset _lp_require_tool RAM vm_stat elif (( LP_ENABLE_BATT )); then __lp_battery_detect || LP_ENABLE_BATT=0 fi _lp_require_tool KUBECONTEXT kubectl _lp_require_tool TERRAFORM terraform unset -f _lp_require_tool _LP_ENABLE_PREEXEC=$(( LP_ENABLE_RUNTIME \ || LP_ENABLE_RUNTIME_BELL \ || LP_ENABLE_TITLE_COMMAND \ || LP_HIDE_EMPTY_ERROR \ )) # LP_ENABLE_RUBY_VENV depends either from rvm or rbenv. Thus we cannot # directly use _lp_require_tool for it. # Also, to avoid to check twice which is the current ruby virtual env # program in use, we set here an internal variable holding its name if we # detect one of them. if (( LP_ENABLE_RUBY_VENV )) ; then if command -v rvm-prompt >/dev/null ; then _LP_RUBY_VENV_PROGRAM=rvm elif command -v rbenv >/dev/null ; then _LP_RUBY_VENV_PROGRAM=rbenv else LP_ENABLE_RUBY_VENV=0 fi fi if (( LP_ENABLE_PERL_VENV )) ; then if command -v perlbrew >/dev/null ; then _LP_PERL_VENV_PROGRAM=perlbrew elif command -v plenv >/dev/null ; then _LP_PERL_VENV_PROGRAM=plenv else LP_ENABLE_PERL_VENV=0 fi fi if (( LP_ENABLE_DETACHED_SESSIONS )); then command -v screen >/dev/null ; _LP_ENABLE_SCREEN=$(( ! $? )) command -v tmux >/dev/null ; _LP_ENABLE_TMUX=$(( ! $? )) fi # Use standard path symbols inside Midnight Commander [[ -n "${MC_SID-}" ]] && LP_ENABLE_SHORTEN_PATH=0 # If we are running in a terminal multiplexer, special title escapes if _lp_multiplexer --internal; then (( LP_ENABLE_TITLE = LP_ENABLE_TITLE && LP_ENABLE_SCREEN_TITLE )) if (( LP_ENABLE_TMUX_TITLE_PANES )) && [[ $lp_multiplexer == tmux ]]; then LP_TITLE_OPEN=$'\E]2;' else LP_TITLE_OPEN=$'\Ek' fi LP_TITLE_CLOSE=$'\E\\' else LP_TITLE_OPEN=$'\E]0;' LP_TITLE_CLOSE=$'\a' fi [[ "_${TERM-}" == _linux* ]] && LP_ENABLE_TITLE=0 # Can not show title command if the title feature is disabled. (( LP_ENABLE_TITLE )) || LP_ENABLE_TITLE_COMMAND=0 # update_terminal_cwd is a shell function available on MacOS X Lion that # will update an icon of the directory displayed in the title of the terminal # window. # See http://hints.macworld.com/article.php?story=20110722211753852 if [[ "${TERM_PROGRAM-}" == Apple_Terminal ]] && command -v update_terminal_cwd >/dev/null; then _LP_TERM_UPDATE_DIR=update_terminal_cwd # Remove "update_terminal_cwd; " that has been add by Apple in /et/bashrc. # See issue #196 PROMPT_COMMAND="${PROMPT_COMMAND//update_terminal_cwd; /}" else _LP_TERM_UPDATE_DIR=: fi ############### # Who are we? # ############### _lp_user local -i user="$?" if (( user < 2 )); then # if user is not root # "sudo -n" is only supported from sudo 1.7.0 if (( LP_ENABLE_SUDO )); then if command -v sudo >/dev/null \ && LC_MESSAGES=C sudo -V \ | GREP_OPTIONS='' \grep -qE '^Sudo version (1(\.([789]\.|[1-9][0-9])|[0-9])|[2-9])'; then # If user can run any command without password input. # This command does not invalidate credentials. if \sudo -nvk 2>/dev/null; then _LP_SUDO_NOPASSWORD=1 else _LP_SUDO_NOPASSWORD=0 fi else LP_ENABLE_SUDO=0 fi fi if (( user == 1 )); then LP_COLOR_USER=$LP_COLOR_USER_ALT else LP_COLOR_USER=$LP_COLOR_USER_LOGGED fi else # root! LP_ENABLE_SUDO=0 if (( ! LP_ENABLE_VCS_ROOT )); then LP_DISABLED_VCS_PATHS=("/") fi LP_MARK_DEFAULT='#' LP_COLOR_MARK=$LP_COLOR_MARK_ROOT LP_COLOR_PATH=$LP_COLOR_PATH_ROOT LP_COLOR_USER=$LP_COLOR_USER_ROOT fi ################# # Where are we? # ################# if (( LP_ENABLE_TEMP )); then # Try each _lp_temp method # If no function worked, disable the feature __lp_temp_detect || LP_ENABLE_TEMP=0 fi if (( LP_ENABLE_LOAD )); then # Find and save the number of CPUs __lp_cpu_count # Convert load config values into usable integers. local ret # if load threshold does not have a period in it. if [[ -z ${LP_LOAD_THRESHOLD//[!\.]} ]]; then # This is an old value, no need to convert _LP_LOAD_THRESHOLD=$LP_LOAD_THRESHOLD else __lp_floating_scale "$LP_LOAD_THRESHOLD" 100 _LP_LOAD_THRESHOLD=$ret fi __lp_floating_scale "$LP_LOAD_CAP" 100 _LP_LOAD_CAP=$ret fi if [[ -n ${_LP_THEME_ACTIVATE_FUNCTION-} ]]; then # Reactivate current theme "$_LP_THEME_ACTIVATE_FUNCTION" prompt_on else # Set default theme if no theme set lp_theme default fi } ##################### # Utility Functions # ##################### # Remove all colors and escape characters of the given string and return a pure text # Deprecated since v2.1. _lp_as_text() { # Remove all terminal sequences that we wrapped with $_LP_OPEN_ESC and # $_LP_CLOSE_ESC. local ret __lp_strip_escapes "$1" printf '%s' "$ret" } # Store $2 (or $?) as a true/false value in variable named $1 # Deprecated since v2.0. _lp_bool() { local res="${2:-$?}" if (( res )); then eval "$1=false" else eval "$1=true" fi return "$res" } _lp_color_map() { # value [scale=100] # Default scale: 0..100 # Custom scale: 0..$2 local -i scale value scale=${2:-100} if (( $1 >= scale )); then (( value = scale - 1 )) elif (( $1 < 0 )); then value=0 else value=$1 fi # Transform the value to a 0..${#COLOR_MAP} scale ret="${LP_COLORMAP[_LP_FIRST_INDEX+value*${#LP_COLORMAP[*]}/scale]}" } # Generate a terminal hyperlink from a URL and text. _lp_create_link() { # url, text (( LP_ENABLE_HYPERLINKS )) || return 2 lp_link="$_LP_OPEN_ESC"$'\E]8;;'"${1}"$'\E'"${_LP_BACKSLASH}${_LP_CLOSE_ESC}${2}${_LP_OPEN_ESC}"$'\E]8;;\E'"${_LP_BACKSLASH}$_LP_CLOSE_ESC" } # Add a link to a path element, with protocol depending on the connection. _lp_create_link_path() { # path local _path="$1" if (( LP_ENABLE_HYPERLINKS )); then _lp_connection if [[ "$lp_connection" == "ssh" ]]; then # SSH connection needs the `sftp` protocol to reach the remote host. 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-}}} _lp_create_link "sftp://${username}@${server_ip}:${client_port}/${PWD}/" "$_path" lp_link_path="$lp_link" elif [[ "$lp_connection" == "su" || "$lp_connection" == "lcl" ]]; then # Reach local host with the `file` protocol. _lp_create_link "file://${PWD}/" "$_path" lp_link_path="$lp_link" else # no link for telnet. lp_link_path="$_path" fi else # No link. lp_link_path="$_path" fi } # Return true if the input is the name of a function. __lp_is_function() { if (( _LP_SHELL_bash )); then [[ $(LC_ALL=C \type -t "$1") == function ]] else [[ $(LC_ALL=C \type -w "$1") == *function ]] fi } # Count the number of lines in the input string. A faster substitute for 'wc -l'. __lp_line_count() { local var="${1//[!$'\n']}" count=${#var} } __lp_hostname_hash() { # cksum is separated with tab on SunOS, space on others # Newline is required to keep the same color as before. local cksum="$(printf '%s\n' "${HOSTNAME:-${HOST-}}" | cksum)" lp_hostname_hash=${cksum%%[$' \t']*} } __lp_floating_scale() { local integer decimal=0 scale=$(( ${#2} - 1 )) integer=${1%\.*} if [[ -n ${1//[!\.]} ]]; then decimal=${1#*\.} decimal=${decimal:0:$scale} while (( ${#decimal} < scale )); do decimal+='0' done while [[ ${decimal:0:1} == '0' ]]; do decimal=${decimal:1} done fi ret=$(( integer * $2 + decimal )) } # Return $PWD with $HOME at the start replaced by "~". __lp_pwd_tilde() { # [path] # Needs to be in a variable, as different versions of Bash treat '~' in a # substitution differently local _path="${1:-$PWD}" tilde="~" lp_pwd_tilde="${_path/#$HOME/$tilde}" } # insert a space on the right # Deprecated since v2.0. _lp_sr() { [[ -n "$1" ]] && echo -nE "$1 " } # insert a space on the left # Deprecated since v2.0. _lp_sl() { [[ -n "$1" ]] && echo -nE " $1" } # insert two spaces, before and after # Deprecated since v2.0. _lp_sb() { [[ -n "$1" ]] && echo -nE " $1 " } # Generates a terminal escape sequence to format the terminal. lp_terminal_format() { # fg, bg, bold, underline, fallback_fg, fallback_bg lp_terminal_format= (( LP_ENABLE_COLOR )) || return 2 local af_color ab_color fg bg previous_af_color fg=$1 bg=${2:-"-1"} previous_af_color=${_lp_last_af_color-} lp_terminal_format=${_LP_OPEN_ESC}${_LP_TI_RESET} if (( fg >= _LP_TI_COLORS )) && [[ -n ${5-} ]]; then _lp_last_af_color=$5 elif (( fg == -2 )); then : # do nothing, _lp_last_af_color already correct elif (( fg == -3 )); then _lp_last_af_color=$_lp_last_ab_color elif (( fg >= 0 )); then _lp_last_af_color=$fg else # -1 _lp_last_af_color=-1 fi if (( ${_lp_last_af_color:-"-1"} >= 0 )); then __lp_foreground_color "$_lp_last_af_color" && lp_terminal_format+=$af_color fi if (( bg >= _LP_TI_COLORS )) && [[ -n ${6-} ]]; then _lp_last_ab_color=$6 elif (( bg == -2 )); then : # do nothing, _lp_last_ab_color already correct elif (( bg == -3 )); then _lp_last_ab_color=$previous_af_color elif (( bg >= 0 )); then _lp_last_ab_color=$bg else # -1 _lp_last_ab_color=-1 fi if (( ${_lp_last_ab_color:-"-1"} >= 0 )); then __lp_background_color "$_lp_last_ab_color" && lp_terminal_format+=$ab_color fi # It turns out there are sequences to reset bold and underline to normal # (\E[22m and \E[24m in xterm), but they aren't universally supported. This # means we must reset to all defaults then enable if they are wanted. # Explicit is safer anyway. if (( ${3:-0} )); then lp_terminal_format+=$_LP_TI_BOLD fi if (( ${4:-0} )); then lp_terminal_format+=$_LP_TI_UNDERLINE fi lp_terminal_format+=$_LP_CLOSE_ESC } # Get a list of themes currently loaded. Looks for functions matching # _lp__theme_prompt(). __lp_theme_list() { lp_theme_list=() local -a _functions if (( _LP_SHELL_zsh )); then # shellcheck disable=SC2296 _functions=( "${(ko)functions[@]}" ) else local IFS=$'\n' # shellcheck disable=SC2207 _functions=( $(declare -F) ) fi local function for function in "${_functions[@]}"; do if [[ $function == *_lp_*_theme_prompt ]]; then function=${function#*_lp_} lp_theme_list+=("${function%_theme_prompt}") fi done } __lp_theme_bash_complete() { COMPREPLY=() local -a lp_theme_list local theme partial_theme partial_theme=${2-} __lp_theme_list for theme in "${lp_theme_list[@]}"; do [[ -n $partial_theme && $theme != "$partial_theme"* ]] && continue COMPREPLY+=("$theme") done } __lp_theme_zsh_complete() { local -a lp_theme_list __lp_theme_list _describe 'theme' lp_theme_list } _lp_hash_color() { (( LP_ENABLE_COLOR )) || return 2 # compute the hash of the argument and color it with the corresponding color in: # (green, yellow, blue, purple, cyan) # Red (would be index 1) is not used here, as it should be reserved for alerts. local str=${1-} local cksum="$(printf '%s' "$str" | cksum)" local hash="${cksum%%[$' \t']*}" __lp_foreground_color "$(( 2 + hash % 5 ))" local color="${_LP_OPEN_ESC}${af_color-}${_LP_CLOSE_ESC}" lp_hash_color="${color}${str}${NO_COL}" } _lp_join() { # Join the $2... array with the $1 string. local delimiter=${1-} local IFS="" if (( _LP_SHELL_zsh )); then shift 1 # shellcheck disable=SC2296 lp_join="${(pj/$delimiter/)*}" else local first=${2-} shift 2 lp_join="${first}${*/#/$delimiter}" fi } _lp_grep_fields() { # Open file $1 and parse it for key/value pairs having delimiter $2, for each key in $3... # Silently bypass inexisting fields. local file="$1" [[ -f "$file" ]] || return 1 local delimiter="$2" shift 2 local -a fields fields=("$@") lp_grep_fields=() # We test for $line in the loop is here to ensure that we read the last line, # even if the file does not ends with a \n. # This bypass a known behavior of the C standard, not fixed in POSIX. while IFS='' read -r line || [[ -n "$line" ]] ; do for (( i=_LP_FIRST_INDEX; i < ${#fields[@]} + _LP_FIRST_INDEX; i++ )); do key="${fields[i]}" if [[ "$line" == "${key}${delimiter}"* ]] ; then line="${line#*"${key}${delimiter}"}" # Remove first part until delimiter. lp_grep_fields[i]="${line}" fi done done <"$file" } # Adds as much $3 (fillchars) character(s) (e.g. spaces) between $1 (left) and $2 (right), # so as to make the resulting string the same width as the current terminal. # If $4 (splitends) is true, then will cut $3 (fillchars) so as to perfectly fill the available space. # # This function would have been slow if you put escaped characters in $3 (fillchars) # and the width of the gap to fill is large. Thus, any escaped character is # removed from $3 (fillchars) at the beginning. # # To color the filling sequence, you can add formating at the end of $1 (left) # and/or at the beginning of $2 (right). _lp_fill() { local left="$1" right="$2" fillchars="${3:-" "}" splitends="${4:-1}" # Remove any escaped character from fillchars, # to avoid any costly __lp_strip_escape call on a potentially long # sequence of characters. __lp_strip_escapes "$fillchars" fillchars="$ret" # Compute the gap between left and right. local ret __lp_strip_escapes "${left}" local left_as_text="$ret" __lp_strip_escapes "${right}" local right_as_text="$ret" # Width of the gap is width of the screen minus every printable character. local gap_width=$((${COLUMNS:-80}-${#left_as_text}-${#right_as_text})) if [[ $gap_width -lt 0 ]] ; then lp_fill="${left}${right}" return 1 fi # Assemble a candidate filling sequence of characters. local filled="" local fillchars_width=${#fillchars} local nb_fillchars=$((gap_width/fillchars_width)) local i for (( i=0; i < nb_fillchars; i++ )) ; do filled+="$fillchars" done local actual_width=${#filled} # If there is still a gap (i.e. we have an unaligned multi-character fillchars). if [[ ${actual_width} -lt ${gap_width} ]] ; then # User asked for splitends. if [[ $splitends -ne 0 ]] ; then for (( i=_LP_FIRST_INDEX; i < $((${#fillchars}+_LP_FIRST_INDEX)); i++ )) ; do # Get one single character. if (( _LP_SHELL_zsh )) ; then filled+="${fillchars[i,i]}" else filled+="${fillchars:i:1}" fi actual_width=${#filled} if [[ ${actual_width} -ge ${gap_width} ]] ; then # Stop at this char if we're full. break fi done else # User asked for no splitends. for (( i=actual_width; i < gap_width; i++ )) ; do # Fill with spaces. filled+=" " done fi fi # shellcheck disable=SC2034 lp_fill="${left}${filled}${right}" } _lp_version_string() { # [major, [minor, [patch, [string, [number]]]]] if [[ $# -eq 0 ]]; then local major="${_LP_VERSION[_LP_FIRST_INDEX+0]}" local minor="${_LP_VERSION[_LP_FIRST_INDEX+1]}" local patch="${_LP_VERSION[_LP_FIRST_INDEX+2]-}" local string="${_LP_VERSION[_LP_FIRST_INDEX+3]-}" local number="${_LP_VERSION[_LP_FIRST_INDEX+4]-}" else local major="${1}" local minor="${2}" local patch="${3-}" local string="${4-}" local number="${5-}" fi #shellcheck disable=SC2034 lp_version="${major}.${minor}" if [[ -n "$patch" ]]; then lp_version+=".${patch}" if [[ -n "$string" ]]; then lp_version+="-${string}" if [[ -n "$number" ]]; then lp_version+=".${number}" fi fi fi } _lp_substitute() { # string pairs_array # Replace string with the "right" part of the first pair in the given array, if the "left" part matches the string. # FIXME If we ever support Bash>4.3, this would be better implemented with associative arrays. lp_substitute="" local string="${1}" shift 1 local pairs pairs=("$@") [[ -n "${pairs[*]}" ]] || return 2 local i key for (( i=0; i < ${#pairs[@]}; i+=2 )); do key=${pairs[_LP_FIRST_INDEX+i]} if [[ "$key" == "$string" ]]; then lp_substitute=${pairs[_LP_FIRST_INDEX+i+1]-} return 0 # Found. fi done return 1 # Not found. } ########################## # Working Directory Path # ########################## __lp_get_unique_directory() { local directory="${1##*/}" root="${1%/*}" local -a matching local -i i for (( i=1; i < ${#directory}; i++ )); do lp_unique_directory=${directory:0:$i} matching=("${root}/${lp_unique_directory}"*/) if (( ${#matching[@]} == 1 )); then return 0 fi done return 1 } __lp_end_path_left_shortening() { if (( is_shortening )); then shortened_path_length+=${#separator} if (( shortened_path_length < unshortened_path_length )); then lp_path_format+="${shortened_directory_format}${LP_MARK_SHORTEN_PATH}" # This indescriminate adding of a separator can sometimes mean the path # is slightly longer than it should be, but it is more clear. lp_path_format+="${separator_format}${separator}" lp_path+="${LP_MARK_SHORTEN_PATH}/" else lp_path+=$unshortened_path_shorten_string lp_path_format+=$unshortened_path_format_shorten_string shortened_path_length=$unshortened_path_length fi is_shortening=0 fi } # methods: # truncate_chars_from_path_left # truncate_chars_from_dir_middle # truncate_chars_from_dir_right # truncate_chars_to_unique_dir # truncate_to_last_dir _lp_path_format() { ((LP_ENABLE_PATH)) || return 2 local path_format="${1-$LP_COLOR_PATH}" local last_directory_format="${2:-$path_format}" local vcs_root_format="${3:-$last_directory_format}" local shortened_directory_format="${4:-$path_format}" local separator="${5-"/"}" local separator_format="${6-}" lp_path= lp_path_format= local ret lp_link_path local lp_pwd_tilde __lp_pwd_tilde local display_path="$lp_pwd_tilde" local -i path_length="${#display_path}" local lp_vcs_root lp_vcs_dir lp_vcs_specific_dir lp_vcs_type lp_vcs_subtype local vcs_root_directory= if (( LP_PATH_VCS_ROOT )) && _lp_find_vcs; then __lp_pwd_tilde "$lp_vcs_root" vcs_root_directory=$lp_pwd_tilde fi if [[ $path_length -eq 1 || $LP_PATH_METHOD == "truncate_to_last_dir" ]]; then if [[ $path_length -gt 1 ]]; then lp_path=${display_path##*/} else # only root or home to show lp_path=$display_path fi __lp_escape "$lp_path" if [[ $display_path == "$vcs_root_directory" ]]; then _lp_create_link_path "${ret}" lp_path_format="${vcs_root_format}$lp_link_path" else _lp_create_link_path "${ret}" lp_path_format="${last_directory_format}$lp_link_path" fi return else if [[ $separator != "/" && ${display_path:0:1} == "/" ]]; then # The root directory ('/') becomes a directory name instead of a leading separator # Add one to account for the first / needing to be both replaced and shown path_length+=1 fi if [[ ${#separator} -gt 1 ]]; then # Add length to account for multichar separators local slash_count="${display_path//[!\/]}" path_length+=$(( ${#slash_count} * ( ${#separator} - 1 ) )) fi fi local path_to_proccess="${display_path}/" current_path="" current_directory="" lp_unique_directory local -i max_len=$(( ${COLUMNS:-80} * LP_PATH_LENGTH / 100 )) directory_count=0 needed_length local -i shortened_path_length="$path_length" is_shortening=0 unshortened_path_length local unshortened_path_shorten_string unshortened_path_format_shorten_string shortened_path while [[ -n $path_to_proccess ]]; do if [[ ${path_to_proccess:0:1} == "/" ]]; then # Start of root current_directory="/" else current_directory=${path_to_proccess%%/*} if [[ -n $current_path && $current_path != "/" ]]; then current_path+="/" fi fi directory_count+=1 current_path+=${current_directory} path_to_proccess=${path_to_proccess#*/} if [[ $current_path == "$vcs_root_directory" ]]; then __lp_end_path_left_shortening # No shortening lp_path+=$current_directory __lp_escape "$current_directory" lp_path_format+="${vcs_root_format}" elif [[ -z $path_to_proccess ]]; then __lp_end_path_left_shortening # Last directory lp_path+=$current_directory __lp_escape "$current_directory" lp_path_format+="${last_directory_format}" elif (( LP_ENABLE_SHORTEN_PATH && directory_count > LP_PATH_KEEP \ && ( shortened_path_length > max_len || ( shortened_path_length >= max_len && is_shortening ) ) )); then if [[ $LP_PATH_METHOD == "truncate_chars_to_unique_dir" ]] && \ __lp_get_unique_directory "$current_path"; then lp_path+=$lp_unique_directory __lp_escape "$lp_unique_directory" lp_path_format+="${shortened_directory_format}" shortened_path_length=$(( shortened_path_length - ${#current_directory} + ${#lp_unique_directory} )) elif [[ $LP_PATH_METHOD == "truncate_chars_from_path_left" ]]; then # The only way to know if this consecutive directory shortening # will actually shorten the path is to both do it and do not and # compare at the end. if (( ! is_shortening )); then unshortened_path_shorten_string= unshortened_path_format_shorten_string= unshortened_path_length=$shortened_path_length shortened_path_length+=${#LP_MARK_SHORTEN_PATH} fi needed_length=$(( shortened_path_length - max_len )) unshortened_path_shorten_string+="${current_directory}/" unshortened_path_format_shorten_string+="${path_format}${current_directory}${separator_format}${separator}" if (( needed_length >= ${#current_directory} )); then # One directory was not enough, need to shorten more. # Shorten by current directory length plus separator. shortened_path_length=$(( shortened_path_length - ${#current_directory} - ${#separator} )) is_shortening=1 else # Do not need to check if the shortened version is actually shorter. # If we got to here, it wasn't a forced ending, which means it is. shortened_path_length=$(( shortened_path_length - needed_length )) shortened_path="${LP_MARK_SHORTEN_PATH}${current_directory:$needed_length}" lp_path+=$shortened_path __lp_escape "$shortened_path" lp_path_format+="${shortened_directory_format}" is_shortening=0 fi elif [[ $LP_PATH_METHOD == "truncate_chars_from_dir_right" ]] && \ (( ${#LP_MARK_SHORTEN_PATH} + LP_PATH_CHARACTER_KEEP < ${#current_directory} )); then shortened_path="${current_directory:0:$LP_PATH_CHARACTER_KEEP}${LP_MARK_SHORTEN_PATH}" lp_path+=$shortened_path __lp_escape "$shortened_path" lp_path_format+="${shortened_directory_format}" shortened_path_length=$(( shortened_path_length - ${#current_directory} + ${#LP_MARK_SHORTEN_PATH} + LP_PATH_CHARACTER_KEEP )) elif [[ $LP_PATH_METHOD == "truncate_chars_from_dir_middle" ]] && \ (( ${#LP_MARK_SHORTEN_PATH} + LP_PATH_CHARACTER_KEEP * 2 < ${#current_directory} )); then shortened_path="${current_directory:0:$LP_PATH_CHARACTER_KEEP}${LP_MARK_SHORTEN_PATH}${current_directory: -$LP_PATH_CHARACTER_KEEP}" lp_path+=$shortened_path __lp_escape "$shortened_path" lp_path_format+="${shortened_directory_format}" shortened_path_length=$(( shortened_path_length - ${#current_directory} + ${#LP_MARK_SHORTEN_PATH} + LP_PATH_CHARACTER_KEEP * 2 )) else # Need to shorten, but no method matched, or the matched method # did not make the string any shorter. lp_path+=$current_directory __lp_escape "$current_directory" lp_path_format+="${path_format}" fi else __lp_end_path_left_shortening lp_path+=$current_directory __lp_escape "$current_directory" lp_path_format+="${path_format}" fi if (( ! is_shortening )); then _lp_create_link_path "$ret" lp_path_format+="$lp_link_path" if [[ -n $path_to_proccess && ( $current_path != "/" || $separator != "/" ) ]]; then if [[ $current_path != "/" ]]; then lp_path+="/" fi lp_path_format+="${separator_format}${separator}" fi fi done } ############### # Environment # ############### # If we are connected with a X11 support _lp_connected_display() { (( LP_ENABLE_DISPLAY )) || return 2 [[ -n "${DISPLAY-}" ]] } _lp_connection() { if [[ -n "${SSH_CLIENT-}${SSH2_CLIENT-}${SSH_TTY-}" ]]; then lp_connection=ssh return elif [[ -n ${REMOTEHOST-} ]]; then lp_connection=tel # Telnet return fi local sess_parent="$(ps -o comm= -p "$PPID" 2> /dev/null)" if [[ "$sess_parent" = "su" || "$sess_parent" = "sudo" ]]; then lp_connection=su # su/sudo else lp_connection=lcl # Local fi } _lp_chroot() { (( LP_ENABLE_CHROOT )) || return 2 if [[ -r /etc/debian_chroot ]]; then IFS= read -r lp_chroot [ ]" # Strings may be `%s`, which will be replaced by the variable's actual content. # is added after each variable. # If end_color is not passed, it will default to $NO_COL. (( LP_ENABLE_ENV_VARS )) || return 2 local color_set="${1-}" local color_unset="${2-}" local color_no="${3-$NO_COL}" if [[ -z "$color_set" && -z "$color_unset" ]]; then color_no="" fi local var_rep var evar fmt_if_set fmt_if_unset lp_env_vars=() # For all user-defined setup. for var_rep in ${LP_ENV_VARS[@]+"${LP_ENV_VARS[@]}"}; do IFS=' ' read -r var fmt_if_set fmt_if_unset <<<"$var_rep" # Variable name and set format has to be set, but unset format is optional. if [[ -n "${var}" && -n "${fmt_if_set}" ]]; then # Expands the underlying variable name. local var_is_set= if (( _LP_SHELL_zsh )); then # From https://www.shellcheck.net/wiki/SC2296 : # "Some Zsh specific parameter expansions like ${(q)value} trigger this warning, # but ShellCheck does not support Zsh." # shellcheck disable=SC2296 var_is_set="${(P)var+IS_SET}" else # NOTE: indirection expansion are deprecated starting at bash 4.3, should use nameref. var_is_set="${!var+IS_SET}" fi if [[ -n "$var_is_set" ]]; then if [[ "${fmt_if_set}" == *"%s"* ]]; then local evar= if (( _LP_SHELL_zsh )); then # shellcheck disable=SC2296 evar="${(P)var}" else evar="${!var}" fi # Print content. lp_env_vars+=( "${color_set}${fmt_if_set/\%s/${evar}}${color_no}" ) else # Print tag. lp_env_vars+=( "${color_set}${fmt_if_set}${color_no}" ) fi elif [[ -n "$fmt_if_unset" ]]; then # Print default. lp_env_vars+=( "${color_unset}${fmt_if_unset}${color_no}" ) fi fi done if [[ -z "${lp_env_vars-}" ]]; then return 1 fi } _lp_env_vars_color() { if _lp_env_vars "${LP_COLOR_ENV_VARS_SET}" "${LP_COLOR_ENV_VARS_UNSET}"; then _lp_join "${LP_MARK_ENV_VARS_SEP}" "${lp_env_vars[@]}" lp_env_vars_color="${LP_MARK_ENV_VARS_OPEN}${lp_join}${LP_MARK_ENV_VARS_CLOSE}" else return "$?" fi } _lp_python_env() { (( LP_ENABLE_VIRTUALENV )) || return 2 local ret # Truncate to the last '/' section, which is the directory name. if [[ -n "${VIRTUAL_ENV-}" ]]; then virtualenv_config="${VIRTUAL_ENV}/pyvenv.cfg" if [[ -r "$virtualenv_config" ]]; then local line while IFS='' read -r line ; do if [[ $line == "prompt"*"="* ]]; then line="${line#"prompt"*"="}" line="${line#[[:space:]]}" line="${line#[\'\"]}" line="${line%[\'\"]}" __lp_escape "$line" break fi done <"$virtualenv_config" fi if [[ -z "${ret-}" ]]; then __lp_escape "${VIRTUAL_ENV##*/}" fi lp_python_env=$ret elif [[ -n "${CONDA_DEFAULT_ENV-}" ]]; then __lp_escape "${CONDA_DEFAULT_ENV##*/}" lp_python_env=$ret else return 1 fi } _lp_python_env_color() { unset lp_python_env_color _lp_python_env || return "$?" lp_python_env_color="${LP_COLOR_VIRTUALENV}${lp_python_env}${NO_COL}" } _lp_node_env() { (( LP_ENABLE_NODE_VENV )) || return 2 local ret if [[ -n "${NODE_VIRTUAL_ENV-}" ]]; then # Truncate to the last '/' section, which is the directory name. __lp_escape "${NODE_VIRTUAL_ENV##*/}" lp_node_env=$ret elif [[ -n "${NVM_BIN-}" ]]; then # Get the version string from the path. ret="${NVM_BIN##*/node/}" __lp_escape "${ret%/bin}" lp_node_env=$ret else return 1 fi } _lp_node_env_color() { unset lp_node_env_color _lp_node_env || return "$?" lp_node_env_color="${LP_COLOR_NODE_VENV}${lp_node_env}${NO_COL}" } _lp_perl_env() { (( LP_ENABLE_PERL_VENV )) || return 2 local ret if [[ "$_LP_PERL_VENV_PROGRAM" = "perlbrew" ]] ; then local perlbrew_perl_ver="$(perlbrew use)" if [[ "$perlbrew_perl_ver" == "Currently using system perl" ]]; then return 1 fi # Example: Currently using perl-5.38.0 __lp_escape "${perlbrew_perl_ver##*perl-}" lp_perl_env=$ret elif [[ "$_LP_PERL_VENV_PROGRAM" = "plenv" ]] ; then local plenv_ver="$(plenv version-name)" if [[ "$plenv_ver" == "system" ]]; then return 1 fi __lp_escape "$plenv_ver" lp_perl_env=$ret else return 1 fi } _lp_perl_env_color() { unset lp_perl_env_color _lp_perl_env || return "$?" lp_perl_env_color="${LP_COLOR_PERL_VENV}${lp_perl_env}${NO_COL}" } _lp_ruby_env() { (( LP_ENABLE_RUBY_VENV )) || return 2 local ret if [[ "$_LP_RUBY_VENV_PROGRAM" = "rvm" ]] ; then local rvm_ver="$(rvm-prompt "${LP_RUBY_RVM_PROMPT_OPTIONS[@]}")" # Will return nothing if 's' is not in the options, and "system" if it is. if [[ -z "$rvm_ver" || "$rvm_ver" == "system" ]]; then return 1 fi __lp_escape "$rvm_ver" lp_ruby_env=$ret elif [[ "$_LP_RUBY_VENV_PROGRAM" = "rbenv" ]] ; then local rbenv_ver="$(rbenv version-name)" if [[ "$rbenv_ver" == "system" ]]; then return 1 fi __lp_escape "$rbenv_ver" lp_ruby_env=$ret else return 1 fi } _lp_ruby_env_color() { unset lp_ruby_env_color _lp_ruby_env || return "$?" lp_ruby_env_color="${LP_COLOR_RUBY_VENV}${lp_ruby_env}${NO_COL}" } _lp_terraform_env() { (( LP_ENABLE_TERRAFORM )) || return 2 local ret if [[ -d .terraform ]]; then local _tf_workspace _tf_workspace="$(\terraform workspace show 2>/dev/null)" if [[ -n "$_tf_workspace" ]]; then __lp_escape "${_tf_workspace}" lp_terraform_env=$ret else return 1 fi else return 1 fi } _lp_terraform_env_color() { unset lp_terraform_env_color _lp_terraform_env || return "$?" lp_terraform_env_color="${LP_COLOR_TERRAFORM}${lp_terraform_env}${NO_COL}" } _lp_software_collections() { (( LP_ENABLE_SCLS )) || return 2 if [[ -n "${X_SCLS-}" ]]; then local ret __lp_escape "${X_SCLS%"${X_SCLS##*[![:space:]]}"}" lp_software_collections=$ret else return 1 fi } _lp_software_collections_color() { unset lp_software_collections_color _lp_software_collections || return "$?" lp_software_collections_color="${LP_COLOR_VIRTUALENV}${lp_software_collections}${NO_COL}" } _lp_kubernetes_context() { (( LP_ENABLE_KUBECONTEXT )) || return 2 local kubernetes_context if (( LP_ENABLE_KUBE_NAMESPACE )); then local line kubernetes_namespace line=$(kubectl config view --minify --output \ 'jsonpath={.current-context}{"/"}{..namespace}' 2>/dev/null) || return 1 kubernetes_context=${line%/*} kubernetes_namespace=${line##*/} else kubernetes_context=$(kubectl config current-context 2>/dev/null) || return 1 fi if [[ -n "$LP_DELIMITER_KUBECONTEXT_PREFIX" ]]; then # shellcheck disable=SC2295 kubernetes_context="${kubernetes_context##*${LP_DELIMITER_KUBECONTEXT_PREFIX}}" fi if [[ -n "$LP_DELIMITER_KUBECONTEXT_SUFFIX" ]]; then # shellcheck disable=SC2295 kubernetes_context="${kubernetes_context%%${LP_DELIMITER_KUBECONTEXT_SUFFIX}*}" fi local ret __lp_escape "$kubernetes_context" lp_kubernetes_context=$ret if [[ -n ${kubernetes_namespace-} ]]; then __lp_escape "$kubernetes_namespace" lp_kubernetes_namespace=$ret else unset lp_kubernetes_namespace fi } _lp_kubernetes_context_color() { unset lp_kubernetes_context_color _lp_kubernetes_context || return "$?" lp_kubernetes_context_color="${LP_MARK_KUBECONTEXT}${LP_COLOR_KUBECONTEXT}${lp_kubernetes_context}${lp_kubernetes_namespace+:}${lp_kubernetes_namespace-}${NO_COL}" } _lp_aws_profile() { (( LP_ENABLE_AWS_PROFILE )) || return 2 local ret local aws_profile="${AWS_PROFILE-${AWS_DEFAULT_PROFILE-${AWS_VAULT-}}}" if [[ -n $aws_profile ]]; then __lp_escape "${aws_profile}" lp_aws_profile=$ret else return 1 fi } _lp_aws_profile_color() { unset lp_aws_profile_color _lp_aws_profile || return "$?" lp_aws_profile_color="${LP_COLOR_AWS_PROFILE}${lp_aws_profile}${NO_COL}" } _lp_cmake() { (( LP_ENABLE_CMAKE )) || return 2 [[ -f CMakeCache.txt ]] || return 1 _lp_grep_fields "CMakeCache.txt" "=" "CMAKE_C_COMPILER:FILEPATH" "CMAKE_CXX_COMPILER:FILEPATH" "CMAKE_GENERATOR:INTERNAL" "CMAKE_BUILD_TYPE:STRING" local cmake_c_compiler=${lp_grep_fields[_LP_FIRST_INDEX+0]-} lp_cmake_c_compiler="${cmake_c_compiler##*/}" # Only the part after the last slash. local cmake_cxx_compiler=${lp_grep_fields[_LP_FIRST_INDEX+1]-} lp_cmake_cxx_compiler="${cmake_cxx_compiler##*/}" # Only the part after the last slash. local cmake_generator=${lp_grep_fields[_LP_FIRST_INDEX+2]-} # Shorten: Makefiles -> Make, and Visual Studio -> VS. cmake_generator="${cmake_generator/%Makefiles/Make}" cmake_generator="${cmake_generator/#Visual Studio/VS}" # Remove all white spaces. lp_cmake_generator="${cmake_generator// /}" lp_cmake_buildtype=${lp_grep_fields[_LP_FIRST_INDEX+3]-} [[ -n "${lp_cmake_c_compiler}${lp_cmake_cxx_compiler}${lp_cmake_generator}${lp_cmake_buildtype}" ]] || return 1 } _lp_cmake_color() { unset lp_cmake_color _lp_cmake || return "$?" local lp_hash_color lp_cmake_color="" if [[ -n "$lp_cmake_c_compiler" ]] ; then _lp_hash_color "$lp_cmake_c_compiler" lp_cmake_color+="${lp_hash_color}${LP_MARK_CMAKE}" fi if [[ -n "$lp_cmake_cxx_compiler" ]] ; then _lp_hash_color "$lp_cmake_cxx_compiler" lp_cmake_color+="${lp_hash_color}${LP_MARK_CMAKE}" fi if [[ -n "$lp_cmake_generator" ]] ; then _lp_hash_color "$lp_cmake_generator" lp_cmake_color+="$lp_hash_color${LP_MARK_CMAKE}" fi if [[ -n "$lp_cmake_buildtype" ]] ; then if [[ "$lp_cmake_buildtype" == "Release" ]] ; then lp_cmake_color+="${LP_COLOR_CMAKE_RELEASE}${lp_cmake_buildtype}${NO_COL}" elif [[ "$lp_cmake_buildtype" == "RelWithDebInfo" ]] ; then lp_cmake_color+="${LP_COLOR_CMAKE_RWDI}${lp_cmake_buildtype}${NO_COL}" elif [[ "$lp_cmake_buildtype" == "Debug" ]] ; then lp_cmake_color+="${LP_COLOR_CMAKE_DEBUG}${lp_cmake_buildtype}${NO_COL}" else _lp_hash_color "$lp_cmake_buildtype" lp_cmake_color+="$lp_hash_color" fi fi } _lp_modules() { (( LP_ENABLE_MODULES )) || return 2 lp_modules=() # # Module sets the LOADEDMODULES environment variable. if [[ -n "${LOADEDMODULES-}" ]]; then # Outer test should be faster. if (( LP_ENABLE_MODULES_VERSIONS )); then local IFS=':' for mod in $LOADEDMODULES; do lp_modules+=("${mod}") done else local IFS=':' for mod in $LOADEDMODULES; do # Simply remove the part after the slash. # Should work on both Bash and Zsh. lp_modules+=("${mod%/*}") done fi if (( ${#lp_modules[@]} == 0 )); then return 1 fi else return 1 fi } _lp_modules_color() { lp_modules_color= if _lp_modules; then if (( LP_ENABLE_COLOR )); then local lp_join if (( LP_ENABLE_MODULES_HASHCOLOR )); then local modules=() for mod in "${lp_modules[@]}"; do _lp_hash_color "${mod}" modules+=("${lp_hash_color}") done # Do not color marks and separators. _lp_join "${NO_COL}${LP_MARK_MODULES_SEP}" "${modules[@]}" lp_modules_color="${LP_MARK_MODULES_OPEN}${lp_join}${NO_COL}${LP_MARK_MODULES_CLOSE}" else # No hashcolor. _lp_join "${NO_COL}${LP_MARK_MODULES_SEP}${LP_COLOR_MODULES}" "${lp_modules[@]}" lp_modules_color="${LP_MARK_MODULES_OPEN}${LP_COLOR_MODULES}${lp_join}${NO_COL}${LP_MARK_MODULES_CLOSE}" fi else # No color. _lp_join "${LP_MARK_MODULES_SEP}" "${lp_modules[@]}" lp_modules_color="${LP_MARK_MODULES_OPEN}${lp_join}${LP_MARK_MODULES_CLOSE}" fi else return "$?" fi } # Same as bash '\l', but can be inlined as a constant as the value will not # change during the shell's life. _lp_terminal_device() { lp_terminal_device="$(basename -- "$(tty)" 2>/dev/null)" } # Determine what type of user we are _lp_user() { if (( EUID == 0 )); then # user is root return 2 elif [[ "${USER-}" != "$(logname 2>/dev/null || printf '%s' "${LOGNAME-}")" ]]; then # user is not login user return 1 else return 0 fi } # Return the username (if we should display one). _lp_username() { if (( LP_USER_ALWAYS == -1 )); then # No username ever return 2 elif (( LP_USER_ALWAYS )) || ! _lp_user; then lp_username=${USER:-${USERNAME:-${LOGNAME-}}} if [[ -z $lp_username ]]; then lp_username=$(id -nu 2>/dev/null) fi local ret __lp_escape "$lp_username" lp_username=$ret return 0 else return 1 fi } _lp_username_color() { _lp_username || return "$?" lp_username_color="${LP_COLOR_USER}${lp_username}${NO_COL}" } # Test the code with the commands: # sudo id # sudo, enter your credentials # sudo -K # revoke your credentials # sudo -v # return non-zero when no credentials are cached # sudo -nvk # return true if user can run commands without password input _lp_sudo_active() { (( LP_ENABLE_SUDO )) || return 2 (( _LP_SUDO_NOPASSWORD )) && return 0 \sudo -nv 2>/dev/null || return 1 } _lp_sudo_active_color() { (( LP_ENABLE_SUDO )) || return 2 if _lp_sudo_active; then lp_sudo_active_color=$LP_COLOR_MARK_SUDO else lp_sudo_active_color=$LP_COLOR_MARK_NO_SUDO fi } _lp_hostname() { # Only process hostname elements if we haven't turned them off if (( LP_HOSTNAME_ALWAYS != -1 )); then _lp_connection if [[ $lp_connection == lcl ]] && ! (( LP_HOSTNAME_ALWAYS )); then # no hostname if local return 1 fi if [[ $LP_HOSTNAME_METHOD == fqdn ]]; then lp_hostname=$(hostname -f 2>/dev/null) elif [[ $LP_HOSTNAME_METHOD == pretty ]]; then if [[ $LP_OS == Darwin ]]; then lp_hostname=$(scutil --get ComputerName 2>/dev/null) else lp_hostname=$(hostnamectl --pretty 2>/dev/null) fi fi if [[ -z ${lp_hostname-} ]]; then lp_hostname=${HOSTNAME:-${HOST-}} fi # Truncate to the first subdomain if [[ $LP_HOSTNAME_METHOD == short ]]; then lp_hostname=${lp_hostname%%.*} fi local ret __lp_escape "$lp_hostname" lp_hostname=$ret else return 2 fi } # Put the hostname if not locally connected # color it in cyan within SSH, and a warning red if within telnet # else display the host without color _lp_hostname_color() { if _lp_connected_display; then lp_hostname_color="${LP_COLOR_X11_ON}" else lp_hostname_color="${LP_COLOR_X11_OFF}" fi if _lp_chroot; then lp_hostname_color+="(${lp_chroot})" fi if _lp_hostname; then case "$lp_connection" in lcl) lp_hostname_color+="@${LP_COLOR_HOST}${lp_hostname}${NO_COL}" ;; ssh) local client_ip client_port server_ip server_port hostname= # client_* are unused # shellcheck disable=SC2034 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 hostname="$lp_link" else hostname="$lp_hostname" fi # If we want a different color for each host (( LP_ENABLE_SSH_COLORS )) && LP_COLOR_SSH="$LP_COLOR_HOST_HASH" lp_hostname_color+="@${LP_COLOR_SSH}${hostname}${NO_COL}" ;; su) lp_hostname_color+="@${LP_COLOR_SU}${lp_hostname}${NO_COL}" ;; tel) lp_hostname_color+="@${LP_COLOR_TELNET}${lp_hostname}${NO_COL}" ;; *) lp_hostname_color+="@${NO_COL}${lp_hostname}" # defaults to no color ;; esac else if [[ -n ${lp_chroot-} ]]; then # End the color of the chroot lp_hostname_color+=${NO_COL} else # Nothing to display lp_hostname_color="" return 1 fi fi } _lp_dirstack() { (( LP_ENABLE_DIRSTACK )) || return 2 local count dir_stack dir_stack=$(dirs -p; printf x) __lp_line_count "${dir_stack%x}" lp_dirstack=$count (( lp_dirstack > 1 )) } _lp_dirstack_color() { _lp_dirstack || return "$?" lp_dirstack_color="${LP_COLOR_DIRSTACK}${LP_MARK_DIRSTACK}${lp_dirstack}${NO_COL}" } _lp_shell_level() { (( LP_ENABLE_SHLVL )) || return 2 lp_shell_level=${SHLVL:-1} (( lp_shell_level >= LP_SHLVL_THRESHOLD )) } _lp_shell_level_color() { _lp_shell_level || return "$?" lp_shell_level_color="${LP_COLOR_SHLVL}${LP_MARK_SHLVL}${lp_shell_level}${NO_COL}" } ################ # Related jobs # ################ # Return the count of detached screen and/or tmux sessions. _lp_detached_sessions() { (( LP_ENABLE_DETACHED_SESSIONS )) || return 2 local -i count=0 (( _LP_ENABLE_SCREEN )) && count=$(screen -ls 2> /dev/null | GREP_OPTIONS='' \grep -c '[Dd]etach[^)]*)$') (( _LP_ENABLE_TMUX )) && count+=$(tmux list-sessions 2> /dev/null | GREP_OPTIONS='' \grep -cv 'attached') lp_detached_sessions=$count (( lp_detached_sessions )) } # Return the count of attached running shell jobs (started with $ myjob &) and/or # stopped jobs (suspended with Ctrl-Z). _lp_jobcount() { (( LP_ENABLE_JOBS )) || return 2 local jobs local -i count # Count running jobs # The $(...) syntax strips trailing newlines, so add a character to the end # then remove it to prevent that. Otherwise 0 and 1 jobs look the same. jobs="$(jobs -r; printf x)" __lp_line_count "${jobs%x}" lp_running_jobs=$count # Count stopped jobs jobs="$(jobs -s; printf x)" __lp_line_count "${jobs%x}" lp_stopped_jobs=$count (( lp_running_jobs || lp_stopped_jobs )) } # Display the count of detached sessions and shell jobs if not zero. _lp_jobcount_color() { (( LP_ENABLE_JOBS || LP_ENABLE_DETACHED_SESSIONS )) || return 2 lp_jobcount_color= _lp_detached_sessions && lp_jobcount_color="${LP_COLOR_JOB_D}${lp_detached_sessions}d${NO_COL}" if _lp_jobcount; then if (( lp_running_jobs > 0 )); then [[ -n "$lp_jobcount_color" ]] && lp_jobcount_color+="$LP_MARK_JOBS_SEPARATOR" lp_jobcount_color+="${LP_COLOR_JOB_R}${lp_running_jobs}&${NO_COL}" fi if (( lp_stopped_jobs > 0 )); then [[ -n "$lp_jobcount_color" ]] && lp_jobcount_color+="$LP_MARK_JOBS_SEPARATOR" lp_jobcount_color+="${LP_COLOR_JOB_Z}${lp_stopped_jobs}z${NO_COL}" fi fi [[ -n "$lp_jobcount_color" ]] } ###################### # VCS branch display # ###################### _lp_are_vcs_enabled() { local _path for _path in ${LP_DISABLED_VCS_PATHS[@]+"${LP_DISABLED_VCS_PATHS[@]}"}; do if [[ -n "$_path" && "$PWD" == "$_path"* ]]; then return 1 fi done return 0 } # Search upwards through a directory structure looking for a sign of a VCS # repository. Used to avoid invoking VCS binaries to discover if in a repo. _lp_find_vcs() { if ! _lp_are_vcs_enabled; then lp_vcs_type="disabled" lp_vcs_root="" return 2 fi lp_vcs_type="" # Based on the Git behavior here: # https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables if [[ -d "${GIT_DIR-}" ]]; then lp_vcs_type="git" lp_vcs_dir="$GIT_DIR" lp_vcs_root="${GIT_WORK_TREE:-"$(\git rev-parse --show-toplevel 2>/dev/null)"}" fi if [[ -z $lp_vcs_type ]]; then local vcs lp_vcs_root="$PWD" while [[ -n "$lp_vcs_root" ]]; do for vcs in ${_LP_ENABLED_VCSS[@]+"${_LP_ENABLED_VCSS[@]}"}; do lp_vcs_dir="$lp_vcs_root/.$vcs" if [[ -d "$lp_vcs_dir" ]]; then lp_vcs_type="$vcs" break 2 fi done unset lp_vcs_dir if (( LP_ENABLE_GIT )) && [[ -f "$lp_vcs_root/.git" ]]; then lp_vcs_type="git" lp_vcs_dir="$(\git rev-parse --git-dir 2>/dev/null)" break fi if (( LP_ENABLE_FOSSIL )) && [[ -f "$lp_vcs_root/_FOSSIL_" || -f "$lp_vcs_root/.fslckout" ]]; then lp_vcs_type="fossil" return 0 fi lp_vcs_root="${lp_vcs_root%/*}" done fi if [[ $lp_vcs_type == git ]]; then lp_vcs_specific_dir="$lp_vcs_dir" if [[ -f "${lp_vcs_dir}/gitdir" ]]; then # Then this is a worktree, and the config exists two levels up. lp_vcs_dir="${lp_vcs_dir}/../.." fi if [[ -n "${VCSH_DIRECTORY-}" ]]; then lp_vcs_subtype="vcsh" elif [[ -d "${lp_vcs_dir}/svn" ]]; then lp_vcs_subtype="svn" else lp_vcs_subtype="" fi fi if [[ -z $lp_vcs_type ]]; then lp_vcs_root="" return 1 fi } # Set the prompt mark depending on the current VCS. # shellcheck disable=SC2120 _lp_smart_mark() { local subtype="${2:-"${lp_vcs_subtype-}"}" case "${1:-$lp_vcs_type}" in git) if [[ $subtype == vcsh ]]; then lp_smart_mark="$LP_MARK_VCSH${VCSH_DIRECTORY-}$LP_MARK_GIT$LP_MARK_VCSH" elif [[ $subtype == svn ]]; then lp_smart_mark="$LP_MARK_GIT$LP_MARK_SVN" else lp_smart_mark="$LP_MARK_GIT" fi ;; hg) lp_smart_mark="$LP_MARK_HG" ;; svn) lp_smart_mark="$LP_MARK_SVN" ;; fossil) lp_smart_mark="$LP_MARK_FOSSIL" ;; bzr) lp_smart_mark="$LP_MARK_BZR" ;; disabled) lp_smart_mark="$LP_MARK_DISABLED" ;; *) lp_smart_mark="$LP_MARK_DEFAULT" ;; esac } # GENERIC VCS # # Create a formatted string describing the status of the repo. _lp_vcs_details_color() { local branch if _lp_vcs_branch; then branch="$lp_vcs_branch" if _lp_vcs_bookmark; then branch+=": $lp_vcs_bookmark" fi elif _lp_vcs_bookmark; then branch="$lp_vcs_bookmark" elif _lp_vcs_tag; then branch="tag: $lp_vcs_tag" else _lp_vcs_commit_id branch="${lp_vcs_commit_id:0:7}" fi lp_vcs_details_color="$LP_COLOR_UP" local has_commit= if _lp_vcs_commits_off_remote; then lp_vcs_details_color="$LP_COLOR_COMMITS_BEHIND" if [[ "$lp_vcs_commit_ahead" -ne "0" && "$lp_vcs_commit_behind" -ne "0" ]]; then has_commit="${LP_COLOR_COMMITS}+$lp_vcs_commit_ahead${NO_COL}/${LP_COLOR_COMMITS_BEHIND}-$lp_vcs_commit_behind${NO_COL}" elif [[ "$lp_vcs_commit_ahead" -ne "0" ]]; then has_commit="${LP_COLOR_COMMITS}$lp_vcs_commit_ahead${NO_COL}" lp_vcs_details_color="$LP_COLOR_COMMITS" elif [[ "$lp_vcs_commit_behind" -ne "0" ]]; then has_commit="${LP_COLOR_COMMITS_BEHIND}-$lp_vcs_commit_behind${NO_COL}" fi fi local ret has_lines= if _lp_vcs_uncommitted_files; then _lp_vcs_unstaged_lines; ret=$? # Only show unstaged changes if the VCS supports staging, otherwise # show uncommitted changes if (( ret == 0 )); then has_lines="+$lp_vcs_unstaged_i_lines/-$lp_vcs_unstaged_d_lines" elif (( ret == 1 )); then has_lines="+0/-0" else _lp_vcs_uncommitted_lines has_lines="+$lp_vcs_uncommitted_i_lines/-$lp_vcs_uncommitted_d_lines" fi lp_vcs_details_color="$LP_COLOR_CHANGES" fi lp_vcs_details_color+="$branch" if [[ -n "$has_lines" || -n "$has_commit" ]]; then lp_vcs_details_color+="${NO_COL}(" if [[ -n "$has_lines" ]]; then lp_vcs_details_color+="${LP_COLOR_DIFF}${has_lines}${NO_COL}${has_commit:+,}" fi lp_vcs_details_color+="${has_commit})" fi if _lp_vcs_stash_count; then lp_vcs_details_color+="$LP_COLOR_COMMITS$LP_MARK_STASH" fi if _lp_vcs_untracked_files; then lp_vcs_details_color+="$LP_COLOR_CHANGES$LP_MARK_UNTRACKED" fi if _lp_vcs_head_status; then lp_vcs_details_color+=" $LP_COLOR_CHANGES$lp_vcs_head_status" if [[ -n "${lp_vcs_head_details-}" ]]; then lp_vcs_details_color+="(${lp_vcs_head_details})" fi fi if _lp_vcs_remote; then # Commits behind but not ahead. if [[ "$lp_vcs_commit_behind" -ne 0 && "$lp_vcs_commit_ahead" -eq 0 ]]; then lp_vcs_details_color+="${LP_COLOR_COMMITS_BEHIND}${LP_MARK_VCS_REMOTE}${lp_vcs_remote}${NO_COL}" # Commits ahead but not behind. elif [[ "$lp_vcs_commit_behind" -eq 0 && "$lp_vcs_commit_ahead" -ne 0 ]]; then lp_vcs_details_color+="${LP_COLOR_COMMITS}${LP_MARK_VCS_REMOTE}${lp_vcs_remote}${NO_COL}" # Commits both ahead and behind: the mark is colored differently. elif [[ "$lp_vcs_commit_behind" -ne 0 && "$lp_vcs_commit_ahead" -ne 0 ]]; then lp_vcs_details_color+="${LP_COLOR_COMMITS_BEHIND}${LP_MARK_VCS_REMOTE}${LP_COLOR_COMMITS}${lp_vcs_remote}${NO_COL}" # else: display nothing. fi fi lp_vcs_details_color+="$NO_COL" } # Check if the detected VCS is enabled in Liquid Prompt and the current # directory is a valid repository of that type. _lp_vcs_active() { "_lp_${lp_vcs_type}_active" } # Get the branch name of the repo in the current directory. _lp_vcs_branch() { "_lp_${lp_vcs_type}_branch" } # Get the bookmark name of the repo in the current directory. _lp_vcs_bookmark() { "_lp_${lp_vcs_type}_bookmark" } # Get a tag name of the repo in the current directory. _lp_vcs_tag() { "_lp_${lp_vcs_type}_tag" } # Get the current commit string for the repo in the current directory. _lp_vcs_commit_id() { "_lp_${lp_vcs_type}_commit_id" } # Get additional information if the repo is in a special or unusual state. _lp_vcs_head_status() { "_lp_${lp_vcs_type}_head_status" # TODO: set lp_vcs_head_details if not set? } # Get the number of stashes in the repo. _lp_vcs_stash_count() { "_lp_${lp_vcs_type}_stash_count" } # Get the number of commits ahead and behind the upstream branch. _lp_vcs_commits_off_remote() { "_lp_${lp_vcs_type}_commits_off_remote" } # Get the number of untracked aka extra files in the repo. _lp_vcs_untracked_files() { "_lp_${lp_vcs_type}_untracked_files" } # Get the number of changed files compared to the last or checked out commit. _lp_vcs_uncommitted_files() { "_lp_${lp_vcs_type}_uncommitted_files" } # Get the number of changed lines compared to the last or checked out commit. _lp_vcs_uncommitted_lines() { "_lp_${lp_vcs_type}_uncommitted_lines" } # Get the number of changed files compared to staging. _lp_vcs_unstaged_files() { "_lp_${lp_vcs_type}_unstaged_files" } # Get the number of changed lines compared to staging. _lp_vcs_unstaged_lines() { "_lp_${lp_vcs_type}_unstaged_lines" } # Get the number of changed files in staging compared to the last or checked out commit. _lp_vcs_staged_files() { "_lp_${lp_vcs_type}_staged_files" } # Get the number of changed lines in staging compared to the last or checked out commit. _lp_vcs_staged_lines() { "_lp_${lp_vcs_type}_staged_lines" } # Get the remote name for the current branch. _lp_vcs_remote() { (( LP_ENABLE_VCS_REMOTE )) || return 2 "_lp_${lp_vcs_type}_remote" } # GIT # # Check if Git is enabled in Liquid Prompt and the current directory is a valid # Git repository. _lp_git_active() { (( LP_ENABLE_GIT )) || return 2 \git rev-parse --is-inside-work-tree >/dev/null 2>&1 || return 1 } # Get the branch name of the Git repo in the current directory. _lp_git_branch() { lp_vcs_branch="" local branch ret # Recent versions of Git support the --short option for symbolic-ref, but # not 1.7.9 (Ubuntu 12.04) if branch="$(\git symbolic-ref -q HEAD 2>/dev/null)"; then __lp_escape "${branch#refs/heads/}" lp_vcs_branch="$ret" else return 1 fi } # Git does not support bookmarks. _lp_git_bookmark() { return 2 ; } # Get a tag name of the Git repo in the current directory. _lp_git_tag() { local tag ret if tag="$(\git describe --tags --exact-match 2>/dev/null)"; then __lp_escape "$tag" lp_vcs_tag="$ret" else return 1 fi } # Get the current full commit hash of the repo in the current directory. _lp_git_commit_id() { lp_vcs_commit_id="$(\git rev-parse -q HEAD 2>/dev/null)" } # Get additional information if HEAD is in merging, rebasing or cherry-picking state. _lp_git_head_status() { local IFS="" step total if [[ -f "${lp_vcs_specific_dir}/MERGE_HEAD" ]]; then lp_vcs_head_status="MERGING" elif [[ -d "${lp_vcs_specific_dir}/rebase-merge" ]]; then test -r "${lp_vcs_specific_dir}/rebase-merge/msgnum" && read -r step <"${lp_vcs_specific_dir}/rebase-merge/msgnum" test -r "${lp_vcs_specific_dir}/rebase-merge/end" && read -r total <"${lp_vcs_specific_dir}/rebase-merge/end" if [[ -f "${lp_vcs_specific_dir}/rebase-merge/interactive" ]]; then lp_vcs_head_status="REBASE-i" else lp_vcs_head_status="REBASE-m" fi elif [[ -d "${lp_vcs_specific_dir}/rebase-apply" ]]; then test -r "${lp_vcs_specific_dir}/rebase-apply/next" && read -r step <"${lp_vcs_specific_dir}/rebase-apply/next" test -r "${lp_vcs_specific_dir}/rebase-apply/last" && read -r total <"${lp_vcs_specific_dir}/rebase-apply/last" if [[ -f "${lp_vcs_specific_dir}/rebase-apply/rebasing" ]]; then lp_vcs_head_status="REBASE" elif [[ -f "${lp_vcs_specific_dir}/rebase-apply/applying" ]]; then lp_vcs_head_status="AM" else lp_vcs_head_status="AM/REBASE" fi elif [[ -f "${lp_vcs_specific_dir}/CHERRY_PICK_HEAD" ]]; then lp_vcs_head_status="CHERRY-PICKING" elif [[ -f "${lp_vcs_specific_dir}/REVERT_HEAD" ]]; then lp_vcs_head_status="REVERTING" elif [[ -f "${lp_vcs_specific_dir}/BISECT_START" ]]; then lp_vcs_head_status="BISECTING" else return 1 fi if [[ -n "$step" && -n "$total" ]]; then lp_vcs_head_details="${step}/${total}" else lp_vcs_head_details="" fi } # Get the number of Git stashes in the repo. _lp_git_stash_count() { lp_vcs_stash_count="$(\git rev-list --walk-reflogs --count refs/stash 2>/dev/null)" (( lp_vcs_stash_count )) } # Count commits behind and ahead on the remote tracking branch of the current # local branch. _lp_git_commits_off_remote() { local counts # The "@{upstream}" notation was added in Git 1.7.0, so this should work for everyone counts="$(\git rev-list --count --left-right '@{upstream}...HEAD' 2>/dev/null)" || return 2 IFS=$' \t' read -r lp_vcs_commit_behind lp_vcs_commit_ahead <<<"$counts" (( lp_vcs_commit_behind || lp_vcs_commit_ahead )) } # Get the number of untracked files in the repo. _lp_git_untracked_files() { lp_vcs_untracked_files="$(LC_ALL=C \git status --porcelain 2>/dev/null | GREP_OPTIONS='' \grep -c '^??')" (( lp_vcs_untracked_files )) } # Get the number of changed files. __lp_git_diff_shortstat_files() { # diff_shortstat local stat="$1" if [[ "$stat" = *changed* ]]; then stat="${stat/ file*}" lp_git_diff_shortstat_files=${stat//[$' \t']} else return 1 fi } # Get the number of changed lines. __lp_git_diff_shortstat_lines() { # diff_shortstat local stat="$1" stat=${stat/*changed, /} # removing "n file(s) changed" if [[ "$stat" = *insertion* ]]; then lp_git_diff_shortstat_i_lines=${stat/ inser*} else lp_git_diff_shortstat_i_lines=0 fi if [[ "$stat" = *deletion* ]]; then stat=${stat/*\(+\), } lp_git_diff_shortstat_d_lines=${stat/ del*/} else lp_git_diff_shortstat_d_lines=0 fi (( lp_git_diff_shortstat_i_lines || lp_git_diff_shortstat_d_lines )) } __lp_git_diff_shortstat_uncommitted() { if [[ -z ${_lp_git_diff_shortstat_uncommitted-} ]]; then _lp_git_diff_shortstat_uncommitted="$(LC_ALL=C \git diff --shortstat HEAD -- 2>/dev/null)" fi } # Get the number of changed files compared to HEAD. _lp_git_uncommitted_files() { __lp_git_diff_shortstat_uncommitted local lp_git_diff_shortstat_files __lp_git_diff_shortstat_files "$_lp_git_diff_shortstat_uncommitted" || return "$?" lp_vcs_uncommitted_files=$lp_git_diff_shortstat_files } # Get the number of changed lines compared to HEAD. _lp_git_uncommitted_lines() { __lp_git_diff_shortstat_uncommitted local lp_git_diff_shortstat_i_lines lp_git_diff_shortstat_d_lines __lp_git_diff_shortstat_lines "$_lp_git_diff_shortstat_uncommitted" || return "$?" lp_vcs_uncommitted_i_lines=$lp_git_diff_shortstat_i_lines lp_vcs_uncommitted_d_lines=$lp_git_diff_shortstat_d_lines } __lp_git_diff_shortstat_unstaged() { if [[ -z ${_lp_git_diff_shortstat_unstaged-} ]]; then _lp_git_diff_shortstat_unstaged="$(LC_ALL=C \git diff --shortstat 2>/dev/null)" fi } # Get the number of changed files compared to staging. _lp_git_unstaged_files() { __lp_git_diff_shortstat_unstaged local lp_git_diff_shortstat_files __lp_git_diff_shortstat_files "$_lp_git_diff_shortstat_unstaged" || return "$?" # shellcheck disable=SC2034 lp_vcs_unstaged_files=$lp_git_diff_shortstat_files } # Get the number of changed lines compared to staging. _lp_git_unstaged_lines() { __lp_git_diff_shortstat_unstaged local lp_git_diff_shortstat_i_lines lp_git_diff_shortstat_d_lines __lp_git_diff_shortstat_lines "$_lp_git_diff_shortstat_unstaged" || return "$?" lp_vcs_unstaged_i_lines=$lp_git_diff_shortstat_i_lines lp_vcs_unstaged_d_lines=$lp_git_diff_shortstat_d_lines } __lp_git_diff_shortstat_staged() { if [[ -z ${_lp_git_diff_shortstat_staged-} ]]; then _lp_git_diff_shortstat_staged="$(LC_ALL=C \git diff --shortstat --cached 2>/dev/null)" fi } # Get the number of changed files in staging compared to HEAD. _lp_git_staged_files() { __lp_git_diff_shortstat_staged local lp_git_diff_shortstat_files __lp_git_diff_shortstat_files "$_lp_git_diff_shortstat_staged" || return "$?" # shellcheck disable=SC2034 lp_vcs_staged_files=$lp_git_diff_shortstat_files } # Get the number of changed lines in staging compared to HEAD. # shellcheck disable=SC2034 _lp_git_staged_lines() { __lp_git_diff_shortstat_staged local lp_git_diff_shortstat_i_lines lp_git_diff_shortstat_d_lines __lp_git_diff_shortstat_lines "$_lp_git_diff_shortstat_staged" || return "$?" lp_vcs_staged_i_lines=$lp_git_diff_shortstat_i_lines lp_vcs_staged_d_lines=$lp_git_diff_shortstat_d_lines } # Get the remote name for the current branch. # NOTE: Assumes that `_lp_find_vcs` and `_lp_vcs_branch` (costly functions) have been called. _lp_git_remote() { lp_vcs_remote="" if [[ -z "$lp_vcs_branch" ]]; then # There is no remote. return 1 fi if [[ -z "$lp_vcs_dir" ]]; then # Cannot find the config file. return 1 fi local file="${lp_vcs_dir}/config" local delimiter=" = " # With spaces. local in_branch=0 # We test for $line in the loop is here to ensure that we read the last line, # even if the file does not ends with a \n. # This bypass a known behavior of the C standard, not fixed in POSIX. while IFS='' read -r line || [[ -n "$line" ]] ; do # If we are in the branch config section. if [[ "$line" == "[branch \"${lp_vcs_branch}\"]" ]]; then in_branch=1 elif [[ "$line" == *"remote${delimiter}"* ]] && (( in_branch )); then # Remove first part until delimiter. lp_vcs_remote="${line#*"remote${delimiter}"}" return 0 fi done <"$file" # Remote not found. return 1 } # MERCURIAL # # Check if Mercurial is enabled in Liquid Prompt and the current directory is a # valid Mercurial repository. _lp_hg_active() { (( LP_ENABLE_HG )) || return 2 "$LP_HG_COMMAND" root >/dev/null 2>&1 || return 1 } # Get the branch name of the Mercurial repo in the current directory. _lp_hg_branch() { local branch ret if branch="$("$LP_HG_COMMAND" branch 2>/dev/null)"; then __lp_escape "$branch" lp_vcs_branch="$ret" else # This should never happen. Should this function return a branch name # only if the head of the branch is checked out? But there can be # multiple heads of a branch... return 1 fi } # Get the bookmark name of the Mercurial repo in the current directory. _lp_hg_bookmark() { local bookmark ret if bookmark="$("$LP_HG_COMMAND" bookmark --list --quiet . 2>/dev/null)"; then __lp_escape "$bookmark" lp_vcs_bookmark="$ret" else return 1 fi } # Get the most recent tag that refers to the current revision. _lp_hg_tag() { local tags ret tags="$("$LP_HG_COMMAND" identify --template='{tags}' 2>/dev/null)" if [[ -n "$tags" ]]; then # Tags are separated by ':', get the first one __lp_escape "${tags%%:*}" lp_vcs_tag="$ret" else return 1 fi } # Get the current global revision id for the repo in the current directory. _lp_hg_commit_id() { lp_vcs_commit_id="$("$LP_HG_COMMAND" identify --id 2>/dev/null)" } # Get additional information if the repo is in any unfinished state. _lp_hg_head_status() { if [[ -d "${lp_vcs_dir}/merge" ]]; then lp_vcs_head_status="MERGING" elif [[ -f "${lp_vcs_dir}/rebasestate" ]]; then lp_vcs_head_status="REBASING" elif [[ -f "${lp_vcs_dir}/updatestate" ]]; then lp_vcs_head_status="UPDATING" elif [[ -f "${lp_vcs_dir}/bisect.state" ]]; then lp_vcs_head_status="BISECTING" elif [[ -f "${lp_vcs_dir}/shelvedstate" ]]; then lp_vcs_head_status="SHELVING" elif [[ -f "${lp_vcs_dir}/graftstate" ]]; then lp_vcs_head_status="GRAFTING" else return 1 fi } # Get the number of Mercurial shelves in the repo. _lp_hg_stash_count() { local shelves count shelves="$("$LP_HG_COMMAND" shelve --list 2>/dev/null; printf x)" __lp_line_count "${shelves%x}" lp_vcs_stash_count="$count" (( lp_vcs_stash_count )) } # https://github.com/liquidprompt/liquidprompt/issues/217 # return: always false (2: disabled). _lp_hg_commits_off_remote() { #commits=$("$LP_HG_COMMAND" outgoing --no-merges 2>/dev/null | GREP_OPTIONS='' \grep -c '\(^changeset\:\)') return 2 } # Get the number of untracked files in the Mercurial repo. _lp_hg_untracked_files() { local untracked untracked="$("$LP_HG_COMMAND" status --unknown --template '{status}' 2>/dev/null)" lp_vcs_untracked_files="${#untracked}" (( lp_vcs_untracked_files )) } # Get the number of changed files compared to the base revision. _lp_hg_uncommitted_files() { local files files="$("$LP_HG_COMMAND" status --modified --template '{status}' 2>/dev/null)" lp_vcs_uncommitted_files="${#files}" (( lp_vcs_uncommitted_files )) } # Get the number of changed lines compared to the base revision. _lp_hg_uncommitted_lines() { IFS=' ' read -r lp_vcs_uncommitted_i_lines lp_vcs_uncommitted_d_lines \ <<<"$("$LP_HG_COMMAND" diff --stat 2>/dev/null | sed -n '$ s/^.*, \([0-9]*\) .*, \([0-9]*\).*$/\1 \2/p')" (( lp_vcs_uncommitted_i_lines || lp_vcs_uncommitted_d_lines )) } # Mercurial does not support a staging area. _lp_hg_unstaged_files() { return 2 ; } _lp_hg_unstaged_lines() { return 2 ; } _lp_hg_staged_files() { return 2 ; } _lp_hg_staged_lines() { return 2 ; } _lp_hg_remote() { return 2 ; } # FIXME This should be implemented. # SUBVERSION # # Check if Subversion is enabled in Liquid Prompt and the current directory is a # valid Subversion repository. _lp_svn_active() { (( LP_ENABLE_SVN )) || return 2 \svn info >/dev/null 2>&1 || return 1 } # Get the branch name of the repo in the current directory. _lp_svn_branch() { local ret url # SVN info shows repository-relative URLs since v1.8 url="$(LC_ALL=C \svn info 2>/dev/null)" url="${url#*Relative URL: }" url="${url%%$'\n'*}" [[ -z "$url" ]] && return 1 if [[ "$url" == */trunk* ]]; then lp_vcs_branch=trunk elif [[ "$url" == */branches/?* ]]; then url="${url##*/branches/}" __lp_escape "${url%/*}" lp_vcs_branch="$ret" elif [[ "$url" == */tags/?* ]]; then url="${url##*/tags/}" __lp_escape "${url%/*}" lp_vcs_branch="tag/$ret" else return 1 fi } # Subversion does not support bookmarks. _lp_svn_bookmark() { return 2 ; } # Subversion does not support tags. What are generally agreed upon as # being tags are internally branches. These are returned by _lp_svn_branch(). _lp_svn_tag() { return 2 ; } # Get the current revision number for the repo in the current directory. _lp_svn_commit_id() { lp_vcs_commit_id="$(\svn info --show-item revision 2>/dev/null)" } # Subversion does not have extra head statuses. A Subversion merge is no different # than a manual file change, so the repository has no extra state to track. _lp_svn_head_status() { return 2 ; } # Subversion does not support stashes. _lp_svn_stash_count() { return 2 ; } # Subversion does not support remote tracking branches (as it is not a # distributed version control system). _lp_svn_commits_off_remote() { return 2 ; } # Get the number of untracked files in the Subversion repo. _lp_svn_untracked_files() { lp_vcs_untracked_files="$(LC_ALL=C \svn status 2>/dev/null | GREP_OPTIONS='' \grep -c '^?')" (( lp_vcs_untracked_files )) } # Get the number of changed files compared to the base revision. _lp_svn_uncommitted_files() { local files count # svn status is unsafe with newline chars in filenames, which will throw # off this count files="$(\svn status --quiet 2>/dev/null; printf x)" __lp_line_count "${files%x}" lp_vcs_uncommitted_files="$count" (( lp_vcs_uncommitted_files )) } # Get the number of changed lines compared to the base revision. _lp_svn_uncommitted_lines() { IFS=' ' read -r lp_vcs_uncommitted_i_lines lp_vcs_uncommitted_d_lines \ <<<"$(\svn diff --internal-diff 2>/dev/null | awk ' BEGIN { plus=0; minus=0 } /^(\+[^+])|(\+$)/ { plus+=1 } /^(-[^-])|(-$)/ { minus+=1 } END { print plus" "minus }')" (( lp_vcs_uncommitted_i_lines || lp_vcs_uncommitted_d_lines )) } # Subversion does not support a staging area. _lp_svn_unstaged_files() { return 2 ; } _lp_svn_unstaged_lines() { return 2 ; } _lp_svn_staged_files() { return 2 ; } _lp_svn_staged_lines() { return 2 ; } # Subversion does not have remotes. _lp_svn_remote() { return 2 ; } # FOSSIL # # Check if Fossil is enabled in Liquid Prompt and the current directory is a # valid Fossil repository. _lp_fossil_active() { (( LP_ENABLE_FOSSIL )) || return 2 \fossil status >/dev/null 2>&1 || return 1 } # Get the branch name of the repo in the current directory. _lp_fossil_branch() { local branch ret # branch current command added in fossil 2.7 if ! branch="$(\fossil branch current 2>/dev/null)"; then # Almost any character can be in a branch name, but we have no way of # knowing if a newline is part of the name or not. In fact, there is no # way to prevent a branch containing the string '\n* ' to not break # this. Just hope that no one crazy enough to do that to their branch # names is running Fossil <2.7 branch="$(\fossil branch list 2>/dev/null)" branch="${branch#*$'\n\* '}" # If the current branch is the first in the list, the above check would # not have removed anything branch="${branch#\* }" branch="${branch%%$'\n'*}" fi if [[ -n "$branch" ]]; then __lp_escape "$branch" lp_vcs_branch="$ret" else return 1 fi } # Fossil does not support bookmarks. _lp_fossil_bookmark() { return 2 ; } # Fossil does not support unique tags. Fossil tags can refer to multiple checkin IDs, # so a matching tag is not a useful unique ID. _lp_fossil_tag() { return 2 ; } # Get the current full commit hash of the Fossil repo in the current directory. _lp_fossil_commit_id() { lp_vcs_commit_id="$(LC_ALL=C \fossil status 2>/dev/null | sed -n 's/^checkout:[[:space:]]*\([^[:space:]]*\).*/\1/p')" } # Get additional information if the check-out is in merging before a commit. _lp_fossil_head_status() { local option option="$(LC_ALL=C \fossil undo --dry-run 2>/dev/null)" if [[ "$option" == *"fossil merge"* ]]; then lp_vcs_head_status="MERGING" else return 1 fi } # Get the number of Fossil stashes in the repo. _lp_fossil_stash_count() { local stashes count stashes="$(\fossil stash list 2>/dev/null; printf x)" __lp_line_count "${stashes%x}" # Each stash takes up two lines, and no stashes is one line lp_vcs_stash_count=$(( count / 2 )) (( lp_vcs_stash_count )) } # Fossil does not support remote tracking branches. Fossil by default keeps the local # repository in sync with the remote. Even if a user disables that, it is not possible # to have a local and remote branch named the same not in sync. _lp_fossil_commits_off_remote() { return 2 ; } # Get the number of extra files in the Fossil repo. _lp_fossil_untracked_files() { local extras count extras="$(\fossil extras 2>/dev/null; printf x)" __lp_line_count "${extras%x}" lp_vcs_untracked_files=$count (( lp_vcs_untracked_files )) } # Get the number of changed files compared to the checked-out version. _lp_fossil_uncommitted_files() { local files files="$(\fossil changes 2>/dev/null; printf x)" __lp_line_count "${files%x}" lp_vcs_uncommitted_files=$count (( lp_vcs_uncommitted_files )) } # Get the number of changed lines compared to the checked-out version. _lp_fossil_uncommitted_lines() { IFS=' ' read -r lp_vcs_uncommitted_i_lines lp_vcs_uncommitted_d_lines \ <<<"$(\fossil diff --internal --verbose 2>/dev/null | awk ' BEGIN { plus=0; minus=0 } /^(\+[^+])|(\+$)/ { plus+=1 } /^(-[^-])|(-$)/ { minus+=1 } END { print plus" "minus }')" (( lp_vcs_uncommitted_i_lines || lp_vcs_uncommitted_d_lines )) } # Fossil does not support a staging area. _lp_fossil_unstaged_files() { return 2 ; } _lp_fossil_unstaged_lines() { return 2 ; } _lp_fossil_staged_files() { return 2 ; } _lp_fossil_staged_lines() { return 2 ; } _lp_fossil_remote() { return 2 ; } # Bazaar # # Check if Bazaar is enabled in Liquid Prompt and the current directory is a # valid Bazaar repository. This check should be done before running any other # _lp_bzr_* data functions. _lp_bzr_active() { (( LP_ENABLE_BZR )) || return 2 \bzr status >/dev/null 2>&1 || return 1 } # Get the branch name of the current directory _lp_bzr_branch() { local branch ret if branch="$(\bzr nick 2> /dev/null)"; then __lp_escape "$branch" lp_vcs_branch="$ret" else return 1 fi } # Bazaar does not support bookmarks. A nick is somewhat like a bookmark, but there is # no command to view a naked branch name, so the nick command is used for branches. _lp_bzr_bookmark() { return 2 ; } # Get the most recent tag that refers to the current revision. _lp_bzr_tag() { local tag ret _ IFS=$' \t' read -r tag _ <<<"$(LC_ALL=C \bzr tags --revision=last:1 2>/dev/null)" if [[ -n "$tag" ]]; then __lp_escape "$tag" lp_vcs_tag="$ret" else return 1 fi } # Get the current full commit hash of the repo in the current directory. _lp_bzr_commit_id() { lp_vcs_commit_id="$(\bzr revno 2>/dev/null)" } # Bazaar does not have extra head statuses. A Bazaar merge can be partially complete, # but there is no command to test for it. _lp_bzr_head_status() { return 2 ; } # Get the number of Bazaar shelves in the repo. _lp_bzr_stash_count() { local shelves count shelves="$(\bzr shelve --list 2>/dev/null)" local -i ret="$?" if (( ret == 0 )); then # No error code means no shelves. lp_vcs_stash_count=0 elif (( ret == 1 )); then # Return of 1 means there are shelves. # The usual "printf x" trick can't be used, as it squashes the error code. __lp_line_count "$shelves" lp_vcs_stash_count=$(( count + 1 )) else return 1 fi (( lp_vcs_stash_count )) } # Bazaar does not support getting details of remote tracking branches. Bazaar does not # keep a local copy of the remote state, so checking this would be impossible anyway. _lp_bzr_commits_off_remote() { return 2 ; } # Get the number of unknown files in the repo. _lp_bzr_untracked_files() { lp_vcs_untracked_files="$(LC_ALL=C \bzr status --short 2>/dev/null | GREP_OPTIONS='' \grep -c '^?')" (( lp_vcs_untracked_files )) } # Get the number of changed files compared to the checked-out version. _lp_bzr_uncommitted_files() { lp_vcs_uncommitted_files="$(LC_ALL=C \bzr status --short 2>/dev/null | GREP_OPTIONS='' \grep -vc '^?')" (( lp_vcs_uncommitted_files )) } # Get the number of changed lines compared to the checked-out version. _lp_bzr_uncommitted_lines() { IFS=' ' read -r lp_vcs_uncommitted_i_lines lp_vcs_uncommitted_d_lines \ <<<"$(\bzr diff 2>/dev/null | awk ' BEGIN { plus=0; minus=0 } /^(\+[^+])|(\+$)/ { plus+=1 } /^(-[^-])|(-$)/ { minus+=1 } END { print plus" "minus }')" (( lp_vcs_uncommitted_i_lines || lp_vcs_uncommitted_d_lines )) } # Bazaar does not support a staging area. _lp_bzr_unstaged_files() { return 2 ; } _lp_bzr_unstaged_lines() { return 2 ; } _lp_bzr_staged_files() { return 2 ; } _lp_bzr_staged_lines() { return 2 ; } _lp_bzr_remote() { return 2 ; } #################### # Wifi link status # #################### _lp_wifi_signal_strength() { (( LP_ENABLE_WIFI_STRENGTH )) || return 2 local level __lp_wifi_signal_strength_raw || return "$?" if (( level > 110 && level < 256 )); then # assume old-style WEXT 8-bit unsigned signal level. (( level -= 256 )) # subtract 256 to convert to dBm. fi # normalize to 0. (( level > -40 )) && (( level = -40 )) (( level < -100 )) && (( level = -100 )) (( lp_wifi_signal_strength = 100 - (100 * ((level + 40) * -1 ) / 60 ) )) (( lp_wifi_signal_strength < LP_WIFI_STRENGTH_THRESHOLD )) } case "$LP_OS" in Linux) __lp_wifi_signal_strength_raw() { [[ -r "$_LP_LINUX_WIRELESS_FILE" ]] || return 2 unset lp_wifi_signal_strength local strength _ while IFS=$' \t' read -r _ _ _ strength _; do strength="${strength%%[![:digit:]-]*}" if [[ -n $strength ]] && ( [[ -z ${lp_wifi_signal_strength-} ]] \ || (( strength < level )) ); then level="$strength" fi done <"$_LP_LINUX_WIRELESS_FILE" [[ -n ${level-} ]] || return 2 } ;; Darwin) __lp_wifi_signal_strength_raw() { level="$("$_LP_AIRPORT_BIN" --getinfo 2>/dev/null)" || return 2 level="${level#*"agrCtlRSSI: "}" level="${level%%[![:digit:]-]*}" [[ -n $level ]] || return 2 } ;; *) _lp_wifi_signal_strength() { return 2 } ;; esac _lp_wifi_signal_strength_color() { _lp_wifi_signal_strength || return "$?" local ret _lp_color_map "$(( 100 - lp_wifi_signal_strength ))" lp_wifi_signal_strength_color="${ret}${LP_MARK_WIFI}" if (( LP_ALWAYS_DISPLAY_VALUES )); then lp_wifi_signal_strength_color+="${lp_wifi_signal_strength}" fi lp_wifi_signal_strength_color+="${NO_COL}" } ################## # Battery status # ################## # Get the battery status in percent. case "$LP_OS" in Linux) __lp_battery_sysfs() { if (( _LP_SHELL_zsh )); then setopt local_options nullglob fi local power_supply for power_supply in "${_LP_LINUX_POWERSUPPLY_PATH}/"*; do if ! [[ -r "${power_supply}/type" && -r "${power_supply}/present" && \ -r "${power_supply}/status" && -r "${power_supply}/capacity" ]]; then continue fi local power_supply_type power_supply_present power_supply_scope IFS= read -r power_supply_type <"${power_supply}/type" 2>/dev/null || continue [[ $power_supply_type == 'Battery' ]] || continue IFS= read -r power_supply_present <"${power_supply}/present" 2>/dev/null || continue [[ $power_supply_present == '1' ]] || continue # Scope is a property of a power supply # Scope = System or missing - power supply powers the system # Scope = Device - power supply powers a device if [[ -r "${power_supply}/scope" ]]; then IFS= read -r power_supply_scope <"${power_supply}/scope" 2>/dev/null || continue [[ $power_supply_scope == 'System' ]] || continue fi IFS= read -r lp_battery_status <"${power_supply}/status" 2>/dev/null || continue IFS= read -r lp_battery <"${power_supply}/capacity" 2>/dev/null || continue return 0 done return 1 } __lp_battery_acpi() { local acpi acpi="$(acpi --battery 2>/dev/null)" # Extract the battery load value in percent # First, remove the beginning of the line... lp_battery="${acpi#Battery *, }" lp_battery="${lp_battery%%%*}" # remove everything starting at '%' lp_battery_status="${acpi}" } __lp_battery_detect() { local lp_battery lp_battery_status unset _LP_BATTERY_FUNCTION # First check SYSFS way. _LP_BATTERY_FUNCTION=__lp_battery_sysfs "$_LP_BATTERY_FUNCTION" 2>/dev/null && \ [[ -n "${lp_battery-}" ]] && return 0 # Try with ACPI. if command -v apci >/dev/null; then _LP_BATTERY_FUNCTION=__lp_battery_acpi "$_LP_BATTERY_FUNCTION" 2>/dev/null && \ [[ -n "${lp_battery-}" ]] && return 0 fi unset _LP_BATTERY_FUNCTION return 1 } _lp_battery() { (( LP_ENABLE_BATT )) || return 5 unset lp_battery lp_battery_status "$_LP_BATTERY_FUNCTION" if [[ -z "${lp_battery-}" ]]; then # no battery level found return 4 fi # discharging if [[ "$lp_battery_status" == *"Discharging"* ]]; then # under => 0, above => 1 return "$(( lp_battery > LP_BATTERY_THRESHOLD ))" # not charging elif [[ "$lp_battery_status" == *"Not charging"* ]]; then return 4 # charging else # under => 2, above => 3 return "$(( 2 + ( lp_battery > LP_BATTERY_THRESHOLD ) ))" fi } ;; Darwin) _lp_battery() { (( LP_ENABLE_BATT )) || return 5 local batt_status IFS=';' read -r lp_battery batt_status <<<"$(pmset -g batt | sed -n 's/^ -InternalBattery.*[[:space:]]\([0-9]*[0-9]\)%; \([^;]*\).*$/\1;\2/p')" case "$batt_status" in charged | "") return 4 ;; discharging) # under => 0, above => 1 return "$(( lp_battery > LP_BATTERY_THRESHOLD ))" ;; *) # "charging", "AC attached" # under => 2, above => 3 return "$(( 2 + ( lp_battery > LP_BATTERY_THRESHOLD ) ))" ;; esac } ;; *) _lp_battery() { return 5 } ;; esac # Compute a gradient of background/foreground colors depending on the battery status. _lp_battery_color() { (( LP_ENABLE_BATT )) || return 2 _lp_battery local -i _status="$?" if (( _status >= 4 || lp_battery == 100 )); then # no battery support or battery full: nothing displayed return 1 elif (( _status == 3 && lp_battery != 100 )); then # charging and above threshold and not 100% # green ⏚ lp_battery_color="${LP_COLOR_CHARGING_ABOVE}${LP_MARK_ADAPTER}${NO_COL}" elif (( _status == 2 )); then # charging but under threshold # yellow ⏚ lp_battery_color="${LP_COLOR_CHARGING_UNDER}${LP_MARK_ADAPTER}${NO_COL}" elif (( _status == 1 )); then # discharging but above threshold # yellow ⌁ lp_battery_color="${LP_COLOR_DISCHARGING_ABOVE}${LP_MARK_BATTERY}${NO_COL}" # discharging and under threshold else lp_battery_color="${LP_COLOR_DISCHARGING_UNDER}${LP_MARK_BATTERY}${NO_COL}" if (( LP_ALWAYS_DISPLAY_VALUES )); then local -i idx if (( lp_battery <= 0 )); then idx=0 elif (( lp_battery <= 5 )); then # 5 idx=9 elif (( lp_battery <= 10 )); then # 5 idx=8 elif (( lp_battery <= 20 )); then # 10 idx=7 elif (( lp_battery <= 30 )); then # 10 idx=6 elif (( lp_battery <= 40 )); then # 10 idx=5 elif (( lp_battery <= 50 )); then # 10 idx=4 elif (( lp_battery <= 65 )); then # 15 idx=3 elif (( lp_battery <= 80 )); then # 15 idx=2 elif (( lp_battery < 100 )); then # 20 idx=1 else # >= 100 idx=0 fi local ret _lp_color_map "$idx" 10 lp_battery_color+="${ret}${lp_battery}${_LP_PERCENT}${NO_COL}" fi fi } ########################### # Runtime of last command # ########################### _lp_runtime_format() { (( LP_ENABLE_RUNTIME )) || return 2 lp_runtime_format= if (( _LP_RUNTIME_SECONDS >= LP_RUNTIME_THRESHOLD )); then # display runtime seconds as days, hours, minutes, and seconds (( _LP_RUNTIME_SECONDS >= 86400 )) && lp_runtime_format=$((_LP_RUNTIME_SECONDS / 86400))d (( _LP_RUNTIME_SECONDS >= 3600 )) && lp_runtime_format+=$((_LP_RUNTIME_SECONDS % 86400 / 3600))h (( _LP_RUNTIME_SECONDS >= 60 )) && lp_runtime_format+=$((_LP_RUNTIME_SECONDS % 3600 / 60))m lp_runtime_format+=$((_LP_RUNTIME_SECONDS % 60))s else return 1 fi } __lp_runtime_before() { _LP_RUNTIME_LAST_SECONDS=$SECONDS _LP_RUNTIME_SECONDS=-1 } # Compute number of seconds since the command was started __lp_runtime_after() { if [[ -n "${_LP_RUNTIME_LAST_SECONDS-}" ]]; then (( _LP_RUNTIME_SECONDS=SECONDS-_LP_RUNTIME_LAST_SECONDS )) unset _LP_RUNTIME_LAST_SECONDS else _LP_RUNTIME_SECONDS=0 fi } _lp_runtime_color() { _lp_runtime_format || return "$?" lp_runtime_color="${LP_COLOR_RUNTIME}${lp_runtime_format}${NO_COL}" } ############### # System load # ############### # Get CPU count and current load case "$LP_OS" in Linux) __lp_cpu_count() { _lp_CPUNUM=$( nproc 2>/dev/null || GREP_OPTIONS='' \grep -c '^[Pp]rocessor' /proc/cpuinfo ) } if [[ -r '/proc/loadavg' ]]; then _lp_cpu_load () { local _ IFS=$' \t' read -r lp_cpu_load _ < /proc/loadavg } elif command -v uptime >/dev/null; then _lp_cpu_load () { lp_cpu_load="$( LP_ALL=C uptime | sed 's/.*load average: \([0-9.]*\).*/\1/' )" } else LP_ENABLE_LOAD=0 fi ;; FreeBSD|Darwin|OpenBSD) __lp_cpu_count() { _lp_CPUNUM=$( sysctl -n hw.ncpu ) } _lp_cpu_load () { local _ IFS=$' \t' # If you have problems with syntax coloring due to the following # line, do this: ln -s liquidprompt liquidprompt.bash # and edit liquidprompt.bash read -r _ lp_cpu_load _ <<<"$( LC_ALL=C sysctl -n vm.loadavg )" } ;; SunOS) __lp_cpu_count() { _lp_CPUNUM=$( kstat -m cpu_info | GREP_OPTIONS='' \grep -c "module: cpu_info" ) } _lp_cpu_load () { lp_cpu_load="$( LC_ALL=C uptime | sed 's/.*load average: *\([0-9.]*\).*/\1/' )" } esac _lp_load() { (( LP_ENABLE_LOAD )) || return 2 local lp_cpu_load ret # Get value (OS-specific) into lp_cpu_load _lp_cpu_load __lp_escape "${lp_cpu_load:-0}" lp_load=$ret __lp_floating_scale "${lp_cpu_load:-0}" 100 lp_load_adjusted=$(( ret / _lp_CPUNUM )) (( lp_load_adjusted >= _LP_LOAD_THRESHOLD )) } # Compute a gradient of background/forground colors depending on the load. _lp_load_color() { _lp_load || return "$?" local ret _lp_color_map "$lp_load_adjusted" "$_LP_LOAD_CAP" lp_load_color="${ret}${LP_MARK_LOAD}" if (( LP_ALWAYS_DISPLAY_VALUES )); then lp_load_color+="${lp_load}" fi lp_load_color+="$NO_COL" } ################# # Available RAM # ################# # Get RAM percentage. case "$LP_OS" in Linux) # Parse /proc/meminfo __lp_ram_bytes() { lp_ram_avail_bytes= lp_ram_total_bytes= local id value free _ while IFS=$' \t' read -r id value _ ; do if [[ $id == 'MemTotal:' ]]; then lp_ram_total_bytes=$value elif [[ $id == 'MemAvailable:' ]]; then lp_ram_avail_bytes=$value # Note: this is the best conservative estimate from the kernel # of the memory than may be available for a process. # See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773 elif [[ $id == 'MemFree:' ]]; then free=$value fi if [[ -n "$lp_ram_total_bytes" && -n "$lp_ram_avail_bytes" ]]; then break fi # Assumes file exists. done < "$_LP_LINUX_RAM_FILE" if [[ -z $lp_ram_avail_bytes && -n ${free-} ]]; then # Very old kernels and Cygwin lack MemAvailable, so fallback to MemFree. lp_ram_avail_bytes=$free fi # Values in file are in KiB. lp_ram_total_bytes=$(( lp_ram_total_bytes * 1024 )) lp_ram_avail_bytes=$(( lp_ram_avail_bytes * 1024 )) # Used memory may be used in a theme. # shellcheck disable=SC2034 lp_ram_used_bytes=$((lp_ram_total_bytes-lp_ram_avail_bytes)) } ;; FreeBSD|OpenBSD) # Parse dmesg.boot __lp_ram_bytes() { lp_ram_avail_bytes= lp_ram_total_bytes= local first second _ value while IFS=' ' read -r first second _ value _ _ ; do if [[ $second == 'memory' ]]; then if [[ $first == 'usable' || $first == 'real' ]]; then lp_ram_total_bytes=$value elif [[ $first == 'avail' ]]; then lp_ram_avail_bytes=$value fi fi if [[ -n "$lp_ram_total_bytes" && -n "$lp_ram_avail_bytes" ]]; then break fi done < "$_LP_BSD_RAM_FILE" # shellcheck disable=SC2034 lp_ram_used_bytes=$((lp_ram_total_bytes-lp_ram_avail_bytes)) } ;; Darwin) # Parse vm_stat __lp_ram_bytes() { lp_ram_avail_bytes=0 lp_ram_total_bytes=0 # Call vm_stat. local stat="$(vm_stat 2>/dev/null)" # Read first line. local page_size _ second third fourth fifth IFS=' ' read -r _ _ _ _ _ _ _ page_size _ <<< "$stat" # Read all other lines. while IFS=' ' read -r _ second third fourth fifth ; do case "$second" in free:|inactive:) # Remove the last "." character. lp_ram_avail_bytes=$((lp_ram_avail_bytes + ${third:0:${#third}-1})) ;; active:|speculative:|throttled:) lp_ram_total_bytes=$((lp_ram_total_bytes + ${third:0:${#third}-1})) ;; wired) lp_ram_total_bytes=$((lp_ram_total_bytes + ${fourth:0:${#fourth}-1})) ;; occupied) lp_ram_total_bytes=$((lp_ram_total_bytes + ${fifth:0:${#fifth}-1})) ;; esac done <<< "$stat" lp_ram_avail_bytes=$((lp_ram_avail_bytes * page_size)) lp_ram_total_bytes=$((lp_ram_avail_bytes + lp_ram_total_bytes * page_size)) # shellcheck disable=SC2034 lp_ram_used_bytes=$((lp_ram_total_bytes-lp_ram_avail_bytes)) } ;; *) # Not implemented. __lp_ram_bytes() { return 5 # Same code as in _lp_battery. } ;; esac _lp_ram() { (( LP_ENABLE_RAM )) || return 2 # Call the OS-specific function measuring RAM. __lp_ram_bytes || return "$?" # Now we have: lp_ram_avail_bytes, lp_ram_total_bytes, lp_ram_used_bytes. lp_ram_human= lp_ram_perc= lp_ram=$(( lp_ram_avail_bytes / 1024 )) # in KiB lp_ram_perc=$(( 100 * lp_ram_avail_bytes / lp_ram_total_bytes )) if (( lp_ram <= LP_RAM_THRESHOLD || lp_ram_perc <= LP_RAM_THRESHOLD_PERC )); then local lp_bytes lp_bytes_units __lp_bytes_to_human "${lp_ram_avail_bytes}" "$LP_RAM_PRECISION" lp_ram_human="${lp_bytes}" lp_ram_human_units="${lp_bytes_units}" return 0 else return 1 fi } _lp_ram_color() { if _lp_ram; then if (( LP_ALWAYS_DISPLAY_VALUES )); then if (( LP_DISPLAY_VALUES_AS_PERCENTS )); then lp_ram_color="${LP_COLOR_RAM}${LP_MARK_RAM}${lp_ram_perc}${NO_COL}${LP_COLOR_RAM_UNITS}${_LP_PERCENT}${NO_COL}" else # Metric SI norms ask for a space, but we prefer to stay compact. # Coloring value differently from unit helps readability. # The mark should be different enough to not be a problem. lp_ram_color="${LP_COLOR_RAM}${LP_MARK_RAM}${lp_ram_human}${NO_COL}${LP_COLOR_RAM_UNITS}${lp_ram_human_units}${NO_COL}" fi else lp_ram_color="${LP_COLOR_RAM}${LP_MARK_RAM}${NO_COL}" fi else return $? fi } ###################### # System temperature # ###################### # Backends for TEMP. Each backend must return the result in $lp_temperature. # Return the hottest system temperature we get. __lp_temp_sysfs() { local -i temperature for temp_file in ${_LP_LINUX_TEMPERATURE_FILES[@]+"${_LP_LINUX_TEMPERATURE_FILES[@]}"}; do for ignore_file in ${LP_TEMP_SYSFS_IGNORE_FILES[@]+"${LP_TEMP_SYSFS_IGNORE_FILES[@]}"}; do # We want to glob match here. # shellcheck disable=SC2053 [[ "$temp_file" == $ignore_file ]] && continue 2 done if [[ ! -r $temp_file ]]; then continue fi IFS='' read -r temperature <"$temp_file" 2>/dev/null || continue # Input is in millidegrees Celsius. (( temperature = temperature / 1000 )) if [[ -z ${lp_temperature-} ]] || (( temperature > ${lp_temperature:-0} )); then lp_temperature=$temperature fi done } # Implementation using lm-sensors __lp_temp_sensors() { # Return the hottest system temperature we get through the sensors command # Only the integer part is retained local -i i local IFS=$' \t\n' for i in $(LC_ALL=C \sensors -u 2>/dev/null | sed -n 's/^ temp[0-9][0-9]*_input: \([0-9]*\)\..*$/\1/p'); do if [[ -z ${lp_temperature-} ]] || (( i > ${lp_temperature:-0} )); then lp_temperature=$i fi done } # Implementation using 'acpi -t' __lp_temp_acpi() { local -i i local IFS=$' \t\n' # Only the integer part is retained for i in $(LC_ALL=C \acpi -t | sed -n 's/.* \(-\{0,1\}[0-9]*\)\.[0-9]* degrees C$/\1/p'); do if [[ -z ${lp_temperature-} ]] || (( i > ${lp_temperature:-0} )); then lp_temperature=$i fi done } # Dynamic selection of backend __lp_temp_detect() { local lp_temperature cmd if [[ $LP_OS == 'Linux' ]]; then _LP_TEMP_FUNCTION="__lp_temp_sysfs" # Check that we can retrieve temperature at least once "$_LP_TEMP_FUNCTION" 2>/dev/null # If $lp_temperature is set, success! [[ -n "${lp_temperature-}" ]] && return 0 fi for cmd in acpi sensors ; do command -v "$cmd" >/dev/null || continue _LP_TEMP_FUNCTION="__lp_temp_$cmd" "$_LP_TEMP_FUNCTION" 2>/dev/null [[ -n "${lp_temperature-}" ]] && return 0 done unset _LP_TEMP_FUNCTION return 1 } # Returns current highest system temperature. _lp_temperature() { (( LP_ENABLE_TEMP )) || return 2 unset lp_temperature "$_LP_TEMP_FUNCTION" [[ -z ${lp_temperature-} ]] && return 1 (( lp_temperature >= LP_TEMP_THRESHOLD )) } # Display the numeric value as we get from _lp_temperature and colorize it through _lp_color_map. _lp_temperature_color() { _lp_temperature || return "$?" local ret _lp_color_map "$lp_temperature" 120 lp_temperature_color="${LP_MARK_TEMP}${ret}${lp_temperature}°${NO_COL}" } ###################### # Current Disk Usage # ###################### # Convert bytes in human-readable, binary-prefixed notation (using powers of 2). # Precision can be 0, 1 or 2 digits. If not given, precision is two digits. __lp_bytes_to_human() { # bytes, [precision] -> lp_bytes, lp_bytes_units local i="$1" prec="${2:-2}" size remainder="" # This has to be split on multiple lines for Zsh 5.0 (see wiki). local -a units # Not much point in going past PiB, as Bash and Zsh start failing int math. units=("B" "KiB" "MiB" "GiB" "TiB" "PiB" "EiB" "YiB" "ZiB") for ((size=0; i > 1024 && size < ${#units[@]}-1; size++)); do remainder=$((i % 1024 * 100 / 1024)) i=$((i / 1024)) done if [[ -n $remainder ]]; then if ((remainder < 10)); then remainder="0$remainder" fi else # Bytes case. remainder="00" fi # Precision formating. remainder="${remainder:0:$prec}" if [[ -n $remainder ]]; then remainder=".$remainder" fi lp_bytes="$i$remainder" lp_bytes_units="${units[$size+$_LP_FIRST_INDEX]}" } _lp_disk() { ((LP_ENABLE_DISK)) || return 2 lp_disk= lp_disk_human= lp_disk_perc= # df -P . prints only the current FS, in a portable format. # -k to get values in kB (supposedly more portable). # LANG is set to avoid locale mangling with the words number. # Backslash avoids any alias of df. local df="$(LANG=C \df -k -P . 2>/dev/null)" # Example output: # Filesystem 1024-blocks Used Available Capacity Mounted on # /dev/nvme0n1p2 479608528 425188220 30011332 94% / # For pseudo filesystems (like procfs or sysfs) output can be: # Filesystem 1024-blocks Used Available Capacity Mounted on # sysfs 0 0 0 - /sys # Placeholder, total and capacity. local _ total capa # Compute location of the targeted column on the safe line. local short="${df#*1024-blocks}" # Second line. local second="${df#*$'\n'}" # Consider only targeted columns. # This may be extended to get other information if needed: # +- used +- mount point (may have spaces) # | | # v v read -r total _ lp_disk capa _ <<<"${second:${#df}-${#short}-11}" # Skip small (under 1MiB) filesystems (probably pseudofs or something weird) (( ${total:-0} < 1024 )) && return 1 # Without percent character. lp_disk_perc=$(( 100 - ${capa:0:${#capa}-1} )) [[ -z ${lp_disk} || -z ${lp_disk_perc} ]] && return 1 # Comparison in KiB. # Ignore absolute threshold if whole FS is smaller than it; otherwise we would always show disk mark if (( ( total >= LP_DISK_THRESHOLD && lp_disk <= LP_DISK_THRESHOLD ) || lp_disk_perc <= LP_DISK_THRESHOLD_PERC )); then # df outputs in KiB, but it's more robust to implement lp_human in bytes, # so we need to convert b in KiB here. local lp_bytes lp_bytes_units __lp_bytes_to_human $((lp_disk*1024)) "$LP_DISK_PRECISION" lp_disk_human="${lp_bytes}" lp_disk_human_units="${lp_bytes_units}" return 0 else return 1 fi } _lp_disk_color() { if _lp_disk; then if (( LP_ALWAYS_DISPLAY_VALUES )); then if (( LP_DISPLAY_VALUES_AS_PERCENTS )); then lp_disk_color="${LP_COLOR_DISK}${LP_MARK_DISK}${lp_disk_perc}${NO_COL}${LP_COLOR_DISK_UNITS}${_LP_PERCENT}${NO_COL}" else # Metric SI norms ask for a space, but we prefer to stay compact. # Coloring value differently from unit helps readability. # The mark should be different enough to not be a problem. lp_disk_color="${LP_COLOR_DISK}${LP_MARK_DISK}${lp_disk_human}${NO_COL}${LP_COLOR_DISK_UNITS}${lp_disk_human_units}${NO_COL}" fi else lp_disk_color="${LP_COLOR_DISK}${LP_MARK_DISK}${NO_COL}" fi else return $? fi } ########## # Title # ########## # Deprecated since 2.0 _lp_title() { (( LP_ENABLE_TITLE )) || return # Get the input as pure text local ret __lp_strip_escapes "${1-}" printf '%s' "${_LP_OPEN_ESC}${LP_TITLE_OPEN}${ret}${LP_TITLE_CLOSE}${_LP_CLOSE_ESC}" } _lp_formatted_title() { (( LP_ENABLE_TITLE )) || return 2 # Get the input as pure text local ret __lp_strip_escapes "${1-}" _lp_generated_title="$ret" } _lp_raw_title() { (( LP_ENABLE_TITLE )) || return 2 _lp_generated_title=${1-} } lp_title() { (( LP_ENABLE_TITLE )) || return 2 if [[ -n ${1+x} ]]; then _lp_manual_title=$1 else unset _lp_manual_title fi } if (( _LP_SHELL_zsh )); then __lp_get_last_command_line() { # shellcheck disable=SC2154 command=${history[$HISTCMD]} } else __lp_get_last_command_line() { command=$(HISTTIMEFORMAT='' builtin history 1 2>/dev/null) command=${command#*[[:digit:]][* ] } # Fallback measure if something goes wrong. if [[ -z $command ]]; then command=$BASH_COMMAND fi } fi __lp_print_title_command() { local command __lp_get_last_command_line printf '%s' "${LP_TITLE_OPEN}${_lp_manual_title:-${_lp_generated_title-${SHELL+"$SHELL \$ "}}}${command}${LP_TITLE_CLOSE}" } ################### # CURRENT TIME # ################### # The targeted unicode characters are the "CLOCK FACE" ones # They are located in the codepages between: # U+1F550 (ONE OCLOCK) and U+1F55B (TWELVE OCLOCK), for the plain hours # U+1F55C (ONE-THIRTY) and U+1F567 (TWELVE-THIRTY), for the thirties # Generated with: # perl -C -E 'say join("", map {chr(0x1F550+$_)." ".chr(0x1F55C+$_)." "} 0..11)' _LP_CLOCK=(🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠 🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦 🕛 🕧 ) _lp_analog_time() { (( LP_ENABLE_TIME && LP_TIME_ANALOG )) || return 2 # %I: "00".."12" %M: "00".."59" # hh: 1..12 mm: 0..59 local hh mm IFS=' ' read -r hh mm <<<"$(date '+%I %M')" # Bash interprets a '0' prefix as octal # so we have to clean that hh="${hh#0}" mm="${mm#0}" # clock: 0 .. 25 # 1:00..1:14 -> 0 # 1:15..1:44 -> 1 # 1:45..2:15 -> 2 # ... # 12:15..12:44 -> 23 # 12:45..12:59 -> 0 # There is a space just after the clock char because the glyph # width is twice usual glyphs lp_analog_time="${_LP_CLOCK[((hh*60+mm-45)/30)%24+_LP_FIRST_INDEX]} " } _lp_analog_time_color() { _lp_analog_time || return "$?" lp_analog_time_color="${LP_COLOR_TIME}${lp_analog_time}${NO_COL}" } _lp_time() { (( LP_ENABLE_TIME && ! LP_TIME_ANALOG )) || return 2 local ret __lp_escape "$(date "+${LP_TIME_FORMAT}")" lp_time=$ret } _lp_time_color() { _lp_time || return "$?" lp_time_color="${LP_COLOR_TIME}${lp_time}${NO_COL}" } ####################### # Container detection # ####################### _lp_container() { (( LP_ENABLE_CONTAINER )) || return 2 lp_container="" if [[ -n "${SINGULARITY_CONTAINER-}" || -n "${SINGULARITY_NAME-}" ]]; then lp_container="Singlrty" elif [[ -e /run/.containerenv ]]; then if [[ -f /run/.toolboxenv ]]; then lp_container="Toolbox" else lp_container="Podman" fi elif [[ -e /proc/self/cgroup ]]; then local cgroup="$(< /proc/self/cgroup)" if [[ "$cgroup" == *"docker"* ]]; then lp_container="Docker" elif [[ "$cgroup" == *"lxc"* ]]; then lp_container="LXC" else return 1 fi elif [[ -r /run/host/container-manager ]]; then local ret IFS='' read -r ret < /run/host/container-manager __lp_escape "${ret#systemd-}" lp_container="$ret" else return 1 fi } _lp_container_color() { unset lp_container_color _lp_container || return "$?" lp_container_color="«${LP_COLOR_CONTAINER}${lp_container}${NO_COL}»" } _lp_dev_env_color() { # add development environments local -a dev_all dev_all=( "${lp_modules_color-}" "${lp_software_collections_color-}" "${lp_aws_profile_color-}" "${lp_container_color-}" "${lp_python_env_color-}" "${lp_node_env_color-}" "${lp_ruby_env_color-}" "${lp_perl_env_color-}" "${lp_terraform_env_color-}" "${lp_kubernetes_context_color-}" "${lp_cmake_color-}" "${lp_os_color-}" ) local -a dev_active dev_active=() for i in "${dev_all[@]}"; do if [[ "$i" ]]; then dev_active+=("$i") fi done if [[ ${#dev_active[@]} -gt 0 ]] ; then local lp_join _lp_join "${LP_MARK_DEV_MID}" "${dev_active[@]}" lp_dev_env_color="${LP_MARK_DEV_OPEN}${lp_join}${LP_MARK_DEV_CLOSE}" return 0 else unset lp_dev_env_color return 1 fi } ################# # Default theme # ################# _lp_default_theme_activate() { if ((LP_ENABLE_PATH)); then # Default value for LP_PERM when LP_ENABLE_PERM is 0 LP_PERM=${LP_MARK_PERM} # without color else LP_PERM= fi _lp_user local -i user_type="$?" if (( user_type < 2 )); then # if user is not root if (( LP_ENABLE_SUDO )); then LP_COLOR_MARK_NO_SUDO="$LP_COLOR_MARK" fi else # root! if (( ! LP_ENABLE_VCS_ROOT )); then LP_MARK_DISABLED="$LP_MARK_DEFAULT" fi fi # The user or connection type is not expected to change from inside the # shell, so we build this just once. if _lp_username_color; then LP_USER="$lp_username_color" else LP_USER= fi _lp_hostname_color LP_HOST="$lp_hostname_color" # If we are running in a terminal multiplexer, brackets are colored if _lp_multiplexer; then LP_BRACKET_OPEN="${LP_COLOR_IN_MULTIPLEXER}${LP_MARK_MULTIPLEXER_OPEN}${NO_COL}" LP_BRACKET_CLOSE="${LP_COLOR_IN_MULTIPLEXER}${LP_MARK_MULTIPLEXER_CLOSE}${NO_COL}" else LP_BRACKET_OPEN="${LP_MARK_BRACKET_OPEN}" LP_BRACKET_CLOSE="${LP_MARK_BRACKET_CLOSE}" fi _lp_terminal_device # shellcheck disable=SC2034 LP_TTYN=$lp_terminal_device } _lp_default_theme_directory() { if ((LP_ENABLE_PATH)); then # LP_PERM: shows a ":" # - colored in green if user has write permission on the current dir # - colored in red if not # - can set another symbol with LP_MARK_PERM if (( LP_ENABLE_PERM )); then if [[ -w "${PWD}" ]]; then LP_PERM="${LP_COLOR_WRITE}${LP_MARK_PERM}${NO_COL}" else LP_PERM="${LP_COLOR_NOWRITE}${LP_MARK_PERM}${NO_COL}" fi fi local lp_path_format _lp_path_format "$LP_COLOR_PATH" "$LP_COLOR_PATH_LAST_DIR" "$LP_COLOR_PATH_VCS_ROOT" "$LP_COLOR_PATH_SHORTENED" "/" "$LP_COLOR_PATH_SEPARATOR" LP_PWD="${lp_path_format}${NO_COL}" else LP_PWD= return 2 fi } # Do not complain about unused variables. # shellcheck disable=SC2034 _lp_default_theme_prompt_data() { # left of main prompt: space at right if _lp_jobcount_color; then LP_JOBS="$lp_jobcount_color " else LP_JOBS= fi if _lp_temperature_color; then LP_TEMP="$lp_temperature_color " else LP_TEMP= fi if _lp_load_color; then LP_LOAD="$lp_load_color " else LP_LOAD= fi if _lp_battery_color; then LP_BATT="$lp_battery_color " else LP_BATT= fi if _lp_wifi_signal_strength_color; then LP_WIFI="$lp_wifi_signal_strength_color " else LP_WIFI= fi if _lp_ram_color; then LP_RAM="$lp_ram_color " else LP_RAM= fi if _lp_disk_color; then LP_DISK="$lp_disk_color " else LP_DISK= fi if _lp_time_color; then LP_TIME="$lp_time_color " elif _lp_analog_time_color; then LP_TIME="$lp_analog_time_color " else LP_TIME= fi if _lp_sudo_active_color; then LP_COLOR_MARK="$lp_sudo_active_color" fi if _lp_dirstack_color; then LP_DIRSTACK=" $lp_dirstack_color" else LP_DIRSTACK= fi # in main prompt: no space if _lp_http_proxy_color; then LP_PROXY="$lp_http_proxy_color" else LP_PROXY= fi if _lp_env_vars_color; then LP_ENVVARS="$lp_env_vars_color" else LP_ENVVARS= fi if _lp_shell_level_color; then LP_SHLVL="$lp_shell_level_color" else LP_SHLVL= fi # All the following "dev-related" variables may be used alone by theme designers. # If you need the whole section, you can also use LP_DEV_ENV defined below. if _lp_python_env_color; then LP_VENV=" $lp_python_env_color" else LP_VENV= fi if _lp_node_env_color; then LP_NODE_VENV=" $lp_node_env_color" else LP_NODE_VENV= fi if _lp_ruby_env_color; then LP_RUBY_VENV=" $lp_ruby_env_color" else LP_RUBY_VENV= fi if _lp_perl_env_color; then LP_PERL_VENV=" $lp_perl_env_color" else LP_PERL_VENV= fi if _lp_kubernetes_context_color; then LP_KUBECONTEXT=" $lp_kubernetes_context_color" else LP_KUBECONTEXT= fi if _lp_terraform_env_color; then LP_TFSPACE=" $lp_terraform_env_color" else LP_TFSPACE= fi if _lp_container_color; then LP_CONTAINER=" $lp_container_color" else LP_CONTAINER= fi if _lp_software_collections_color; then LP_SCLS=" $lp_software_collections_color" else LP_SCLS= fi if _lp_aws_profile_color; then LP_AWS_PROFILE=" $lp_aws_profile_color" else LP_AWS_PROFILE= fi if _lp_cmake_color; then LP_CMAKE=" $lp_cmake_color" else LP_CMAKE= fi if _lp_os_color; then LP_OPSYS=" $lp_os_color" else LP_OPSYS= fi if _lp_modules_color; then LP_MODULES=" $lp_modules_color" else LP_MODULES= fi # End of the section for dev-related variables. # Alternative to atomic variables above: # a correctly separated string list with everything. if _lp_dev_env_color ; then LP_DEV_ENV=" $lp_dev_env_color" else LP_DEV_ENV= fi if _lp_runtime_color; then LP_RUNTIME=" $lp_runtime_color" else LP_RUNTIME= fi if _lp_error_color; then LP_ERR=" $lp_error_color" else LP_ERR= fi if _lp_error_meaning_color; then LP_ERR_MEANING="$lp_error_meaning_color" else LP_ERR_MEANING= fi if _lp_find_vcs && _lp_vcs_details_color; then LP_VCS=" $lp_vcs_details_color" else LP_VCS= fi _lp_smart_mark LP_MARK="${lp_smart_mark}${NO_COL} " } _lp_default_theme_prompt_template() { if [[ -f "${LP_PS1_FILE-}" ]]; then # shellcheck source=templates/minimal/minimal.ps1 source "$LP_PS1_FILE" fi if [[ -z "${LP_PS1-}" ]]; then # Add title escape time, battery, load, temperature, RAM, disk, wifi, jobs. PS1="${LP_PS1_PREFIX}${LP_TIME}${LP_BATT}${LP_LOAD}${LP_TEMP}${LP_RAM}${LP_DISK}${LP_WIFI}${LP_JOBS}" # Add multiplexer brackets, user, host, permissions colon, working directory, dirstack, proxy, watched environment variables and nested shell level. PS1+="${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_PERM}${LP_PWD}${LP_DIRSTACK}${LP_BRACKET_CLOSE}${LP_PROXY}${LP_ENVVARS}${LP_SHLVL}" # Add the list of development environments/config/etc. PS1+="${LP_DEV_ENV}" # Add VCS infos # If root, the info has not been collected unless LP_ENABLE_VCS_ROOT # is set. PS1+="${LP_VCS}" # Add last runtime, return code & meaning, prompt mark and user-defined postfix. PS1+="${LP_RUNTIME}${LP_ERR}${LP_ERR_MEANING}${LP_MARK_PREFIX}${LP_COLOR_MARK}${LP_MARK}${LP_PS1_POSTFIX}" # Get the core sections without prompt escapes and make them into a title. _lp_formatted_title "${LP_PS1_PREFIX}${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_MARK_PERM}${lp_path-}${LP_BRACKET_CLOSE}${LP_MARK_PREFIX}${LP_MARK}${LP_PS1_POSTFIX}" else PS1=$LP_PS1 fi } _lp_default_theme_prompt() { _lp_default_theme_prompt_data _lp_default_theme_prompt_template } ######################## # Construct the prompt # ######################## __lp_set_prompt() { # Display the return value of the last command, if different from zero # As this get the last returned code, it should be called first local -i lp_error="$?" if (( LP_HIDE_EMPTY_ERROR )); then (( ! ${_LP_REAL_COMMAND:-1} )) && lp_error=0 _LP_REAL_COMMAND=0 fi if (( LP_ENABLE_RUNTIME || LP_ENABLE_RUNTIME_BELL )); then __lp_runtime_after fi # bash: execute the old prompt hook if [[ -n ${LP_OLD_PROMPT_COMMAND-} ]]; then eval "$LP_OLD_PROMPT_COMMAND" fi if (( LP_ENABLE_RUNTIME_BELL && ${_LP_RUNTIME_SECONDS-0} >= LP_RUNTIME_BELL_THRESHOLD )); then printf '%s' "$_LP_TI_BELL" fi if [[ "$_LP_OLD_THEME" != "$LP_THEME" ]]; then lp_theme "$LP_THEME" >/dev/null 2>&1 fi # Localize cache data variables local _lp_git_diff_shortstat_uncommitted _lp_git_diff_shortstat_unstaged _lp_git_diff_shortstat_staged # if change of working directory if [[ "${LP_OLD_PWD-}" != "LP:$PWD" ]]; then # Update directory icon for MacOS X "$_LP_TERM_UPDATE_DIR" "$_LP_THEME_DIRECTORY_FUNCTION" # Prefix with 'LP:' to prevent Zsh with AUTO_NAME_DIRS enabled using # this var as a name for the working directory, that will be used by # the '%' and related prompt sequences. # See https://github.com/liquidprompt/liquidprompt/issues/124 for details. LP_OLD_PWD="LP:$PWD" fi "$_LP_THEME_PROMPT_FUNCTION" if (( LP_ENABLE_TITLE )); then printf '%s' "${LP_TITLE_OPEN}${_lp_manual_title:-${_lp_generated_title-${SHELL-}}}${LP_TITLE_CLOSE}" fi } __lp_preexec() { if (( LP_ENABLE_RUNTIME || LP_ENABLE_RUNTIME_BELL )); then __lp_runtime_before fi if (( LP_ENABLE_TITLE_COMMAND )); then __lp_print_title_command fi if (( LP_HIDE_EMPTY_ERROR )); then _LP_REAL_COMMAND=1 fi } __lp_before_command() { # For debugging #printf 'XXX %s\n' "$BASH_COMMAND" # If this is the last thing before prompt is being drawn, the command is done, # so mark the next trap. Note these two events could be at the same # time, so no elif is used. local first_command last_command first_command=$PROMPT_COMMAND if (( ${BASH_VERSINFO[0]:-0} > 5 || ( ${BASH_VERSINFO[0]:-0} == 5 && ${BASH_VERSINFO[1]:-0} >= 1 ) )); then last_command=${PROMPT_COMMAND[-1]} else last_command=$PROMPT_COMMAND fi if [[ "$last_command" == *"$BASH_COMMAND" ]]; then _LP_AT_PROMPT=1 # Return early, because the PROMPT_COMMAND should never trigger preexec hooks. return fi # If this is the first time after the user submitted the command, # execute the hooks, unless the user submitted an empty command. if (( _LP_AT_PROMPT )); then _LP_AT_PROMPT=0 if [[ "$first_command" != "$BASH_COMMAND"* ]]; then __lp_preexec fi fi } prompt_tag() { if [[ -n "${1-}" ]]; then export LP_PS1_PREFIX="$1 " else export LP_PS1_PREFIX= fi } # Activate Liquid Prompt prompt_on() { # Reset so all PWD dependent variables are computed after loading LP_OLD_PWD="" # if Liquid Prompt has not been already set if [[ -z "${LP_OLD_PS1-}" ]]; then LP_OLD_PS1="$PS1" fi if (( _LP_SHELL_bash )); then # Prevent some cases where the user shoots in his own foot. # PROMPT_COMMAND is not exported by default, but some users # incorrectly export it from their profile/bashrc (GitHub #450), # so we preventively UNexport it. # TODO: warn the user if it was exported if (( ${BASH_VERSINFO[0]:-0} > 4 || ( ${BASH_VERSINFO[0]:-0} == 4 && ${BASH_VERSINFO[1]:-0} >= 2 ) )); then # -g is only available since bash 4.2 declare -g +x PROMPT_COMMAND fi if ! __lp_use_bash_preexec; then local set_prompt_command if (( LP_DEBUG_TIME )); then set_prompt_command="time __lp_set_prompt" else set_prompt_command=__lp_set_prompt fi if (( ${BASH_VERSINFO[0]:-0} > 5 || ( ${BASH_VERSINFO[0]:-0} == 5 && ${BASH_VERSINFO[1]:-0} >= 1 ) )); then # PROMPT_COMMAND is an array since bash 5.1 if ! ( __lp_array_contains __lp_set_prompt ${PROMPT_COMMAND[@]+"${PROMPT_COMMAND[@]}"} \ || __lp_array_contains "time __lp_set_prompt" ${PROMPT_COMMAND[@]+"${PROMPT_COMMAND[@]}"} ); then PROMPT_COMMAND+=( "$set_prompt_command" ) fi else if [[ -z ${LP_OLD_PROMPT_COMMAND+x} ]]; then LP_OLD_PROMPT_COMMAND="${PROMPT_COMMAND-}" fi # shellcheck disable=SC2178 PROMPT_COMMAND="$set_prompt_command" fi if (( ${_LP_ENABLE_PREEXEC-0} )); then _LP_AT_PROMPT=0 _LP_RUNTIME_LAST_SECONDS=$SECONDS # __lp_before_command gets called just before bash executes a command, # including $PROMPT_COMMAND # Pass $_ to this call, because it sets $_ to what it already was trap '__lp_before_command "$_"' DEBUG fi else # We do not want __lp_set_prompt to show up twice in precmd_functions; if it does, then LP_ENABLE_ERROR # breaks because even if the first call of __lp_set_prompt has $? != 0, the second one will have $? == 0. # (Same for __lp_debug_timed_lp_set_prompt.) # This conditional is intended to check $precmd_functions for the presence of '__lp_set_prompt' or # '__lp_debug_timed_lp_set_prompt' so they get added at most once if ! ( __lp_array_contains __lp_set_prompt ${precmd_functions[@]+"${precmd_functions[@]}"} \ || __lp_array_contains __lp_debug_timed_set_prompt ${precmd_functions[@]+"${precmd_functions[@]}"} ); then if (( LP_DEBUG_TIME )); then __lp_debug_timed_lp_set_prompt() { time __lp_set_prompt } precmd_functions+=(__lp_debug_timed_lp_set_prompt) else precmd_functions+=(__lp_set_prompt) fi fi if (( ${_LP_ENABLE_PREEXEC-0} )); then _LP_RUNTIME_LAST_SECONDS=$SECONDS # It's less bad to have this be duped than __lp_set_prompt, but let's be sure if ! ( __lp_array_contains __lp_preexec ${preexec_functions[@]+"${preexec_functions[@]}"} ); then preexec_functions+=(__lp_preexec) fi fi fi else # zsh if [[ -n "${prompt_theme-}" && "$prompt_theme" != off ]]; then _LP_ZSH_PROMPT_THEME="$prompt_theme" # Disable the prompt to disable its precmd hook prompt off fi if [[ -z ${_LP_OLD_SETOPT-} ]]; then # Dump option names: echo ${(ko)options} # shellcheck disable=SC2154 if [[ "${options[promptpercent]}" == on ]]; then _LP_OLD_SETOPT="promptpercent" else _LP_OLD_SETOPT="nopromptpercent" fi fi # Set options that affect PS1 evaluation; enable percent expansion setopt promptpercent add-zsh-hook precmd __lp_set_prompt if (( ${_LP_ENABLE_PREEXEC-0} )); then _LP_RUNTIME_LAST_SECONDS=$SECONDS declare -gi _LP_RUNTIME_SECONDS add-zsh-hook preexec __lp_preexec fi fi } __lp_disable_hooks() { if (( _LP_SHELL_bash )); then if __lp_use_bash_preexec; then # Disable previous hooks as options that set them may have changed. for i in ${precmd_functions[@]+"${!precmd_functions[@]}"}; do local value="${precmd_functions[i]}" if [[ $value == "__lp_set_prompt" || $value == "__lp_debug_timed_lp_set_prompt" ]]; then unset 'precmd_functions[i]' fi done for i in ${preexec_functions[@]+"${!preexec_functions[@]}"}; do local value="${preexec_functions[i]}" if [[ $value == "__lp_preexec" ]]; then unset 'preexec_functions[i]' fi done else if (( ${BASH_VERSINFO[0]:-0} > 5 || ( ${BASH_VERSINFO[0]:-0} == 5 && ${BASH_VERSINFO[1]:-0} >= 1 ) )); then # PROMPT_COMMAND is an array since bash 5.1 for i in ${PROMPT_COMMAND[@]+"${!PROMPT_COMMAND[@]}"}; do local value="${PROMPT_COMMAND[i]}" if [[ $value == "__lp_set_prompt" || $value == "time __lp_set_prompt" ]]; then unset 'PROMPT_COMMAND[i]' fi done else if [[ -n ${LP_OLD_PROMPT_COMMAND+x} ]]; then # shellcheck disable=SC2178 PROMPT_COMMAND="${LP_OLD_PROMPT_COMMAND-}" unset LP_OLD_PROMPT_COMMAND else unset PROMPT_COMMAND fi fi # Disable the DEBUG trap used by the RUNTIME or TITLE_COMMAND features # TODO: Fix this: Bash will unset the function's DEBUG trap, not the global one. if (( ${_LP_ENABLE_PREEXEC-0} )); then trap - DEBUG fi fi else # zsh { add-zsh-hook -d precmd __lp_set_prompt add-zsh-hook -d preexec __lp_preexec } >/dev/null fi } # Come back to the old prompt prompt_off() { __lp_disable_hooks PS1=$LP_OLD_PS1 if (( _LP_SHELL_zsh )); then setopt "${_LP_OLD_SETOPT}" if [[ -n ${_LP_ZSH_PROMPT_THEME-} ]]; then prompt "$_LP_ZSH_PROMPT_THEME" unset _LP_ZSH_PROMPT_THEME fi fi } # Use an empty prompt: just the \$ mark prompt_OFF() { __lp_disable_hooks PS1="$_LP_MARK_SYMBOL " } lp_theme() { local theme="${1-}" LP_THEME="${_LP_OLD_THEME-}" if [[ $theme == '--list' ]]; then local -a lp_theme_list __lp_theme_list printf '%s\n' "${lp_theme_list[@]}" return fi local f_prompt="_lp_${theme}_theme_prompt" local f_dir="_lp_${theme}_theme_directory" local f_activate="_lp_${theme}_theme_activate" local f_version="_lp_${theme}_theme_version_check" if [[ -z $theme ]]; then printf '%s\n%s\n' \ 'Must pass in the name of a theme. If you meant the default Liquid Prompt theme, try "default".' \ 'Run "lp_theme --list" to see all loaded and available themes.' >&2 return 1 fi if __lp_is_function "$f_version"; then local -a lp_version_check "$f_version" if ! _lp_version_greatereq ${lp_version_check[@]+"${lp_version_check[@]}"}; then local lp_version _lp_version_string ${lp_version_check[@]+"${lp_version_check[@]}"} printf 'ERROR: Loading theme "%s" failed: theme requires version %s or greater of Liquid Prompt.\n' \ "$theme" "$lp_version" >&2 return 2 fi fi if ! __lp_is_function "$f_prompt"; then printf 'ERROR: Loading theme "%s" failed: cannot find function "%s". Please source the theme file first.\n' \ "$theme" "$f_prompt" >&2 return 2 fi if ! __lp_is_function "$f_dir"; then f_dir=":" fi if ! __lp_is_function "$f_activate"; then f_activate=":" fi _LP_THEME_ACTIVATE_FUNCTION=$f_activate _LP_THEME_DIRECTORY_FUNCTION=$f_dir _LP_THEME_PROMPT_FUNCTION=$f_prompt LP_THEME="$theme" _LP_OLD_THEME="$theme" "$f_activate" prompt_on } # By default, sourcing 'liquidprompt' will activate Liquid Prompt if [ "${1-}" != "--no-activate" ]; then lp_activate fi # vim: ft=sh et sts=4 sw=4 tw=120 liquidprompt-2.2.1/liquidprompt.plugin.zsh000066400000000000000000000000341464055045500210260ustar00rootroot00000000000000source ${0%/*}/liquidprompt liquidprompt-2.2.1/pull_request_template.md000066400000000000000000000030031464055045500212120ustar00rootroot00000000000000 # Technical checklist: - code follows our [shell standards](https://github.com/liquidprompt/liquidprompt/wiki/Shell-standards): - [ ] correct use of `IFS` - [ ] careful quoting - [ ] cautious array access - [ ] portable array indexing with `_LP_FIRST_INDEX` - [ ] printing a "%" character is done with `_LP_PERCENT` - [ ] functions/variable naming conventions - [ ] functions have local variables - [ ] data functions have optimization guards (early exits) - [ ] subshells are avoided as much as possible - [ ] string substitutions may be done differently in Bash and Zsh (use `_LP_SHELL_*`) - tests and checks have been added, ran, and their warnings fixed: - [ ] unit tests have been updated (see `tests/test_*.sh` files) - [ ] ran `tests.sh` - [ ] ran `shellcheck.sh` (requires [shellcheck](https://github.com/koalaman/shellcheck#user-content-installing)). - documentation have been updated accordingly: - [ ] functions and attributes are documented in alphabetical order - [ ] new sections are documented in the default theme - [ ] tag `.. versionadded:: X.Y` or `.. versionchanged:: Y.Z` - [ ] functions signatures have arguments, returned code, and set value(s) - [ ] attributes have types and defaults - [ ] ran `docs/docs-lint.sh` (requires Python 3 and `requirements.txt` installed (`cd docs/; python3 -m venv venv; . venv/bin/activate; pip install -r requirements.txt`)) liquidprompt-2.2.1/shellcheck.sh000077500000000000000000000006321464055045500167220ustar00rootroot00000000000000#!/bin/sh # shellcheck shell=bash # shellcheck disable=SC2093 exec shellcheck \ --shell=bash \ --exclude=SC2155 \ --external-sources --check-sourced \ liquidprompt \ tools/* \ "$0" # Include this script to get the below imports . ./liquidprompt . ./themes/alternate_vcs/alternate_vcs.theme . ./themes/powerline/powerline.theme . ./themes/unfold/unfold.theme # vim: ft=sh et sts=2 sw=2 tw=120 liquidprompt-2.2.1/templates/000077500000000000000000000000001464055045500162535ustar00rootroot00000000000000liquidprompt-2.2.1/templates/minimal/000077500000000000000000000000001464055045500177015ustar00rootroot00000000000000liquidprompt-2.2.1/templates/minimal/minimal.ps1000066400000000000000000000014041464055045500217530ustar00rootroot00000000000000# Add user-defined prefix. LP_PS1="${LP_PS1_PREFIX}" # Add multiplexer brackets, user, host, permissions colon, working directory. LP_PS1+="${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_PERM}${LP_PWD}${LP_BRACKET_CLOSE}" # Add VCS infos. # If root, the info has not been collected unless LP_ENABLE_VCS_ROOT # is set. LP_PS1+="${LP_VCS}" # Add runtime, return code, prompt mark and user-defined postfix. LP_PS1+="${LP_RUNTIME}${LP_ERR}${LP_MARK_PREFIX}${LP_COLOR_MARK}${LP_MARK}${LP_PS1_POSTFIX}" # Get the core sections without prompt escapes and make them into a title. _lp_formatted_title "${LP_PS1_PREFIX}${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_MARK_PERM}${lp_path-}${LP_BRACKET_CLOSE}${LP_MARK_PREFIX}${LP_MARK}${LP_PS1_POSTFIX}" # vim: ft=sh et sts=4 sw=4 tw=120 liquidprompt-2.2.1/tests.sh000077500000000000000000000016021464055045500157550ustar00rootroot00000000000000#!/bin/bash if [[ -n ${1+x} ]]; then shells=("$@") else shells=(bash zsh) fi cd "${0%/*}/tests" if [ ! -r shunit2 ]; then curl https://raw.githubusercontent.com/kward/shunit2/v2.1.8/shunit2 -O fi typeset -a testing_shells for shell in "${shells[@]}"; do if command -v "$shell" >/dev/null; then testing_shells+=("$shell") printf 'shell "%s": version "%s"\n' "$shell" "$("$shell" --version)" else printf "Cannot find shell '%s', skipping tests\n" "$shell" >&2 fi done typeset -i fail=0 typeset -a errors for test_file in ./test_*.sh; do for shell in "${testing_shells[@]}"; do printf "\nRunning shell '%s' with test '%s'\n" "$shell" "$test_file" "$shell" "$test_file" || { fail+=1 errors+=("Failed running test '${test_file}' with shell '${shell}'") } done done printf '%s\n' "${errors[@]}" exit "$fail" # vim: ft=sh et sts=2 sw=2 tw=120 liquidprompt-2.2.1/tests/000077500000000000000000000000001464055045500154175ustar00rootroot00000000000000liquidprompt-2.2.1/tests/.gitignore000066400000000000000000000000301464055045500174000ustar00rootroot00000000000000shunit2 bash-preexec.sh liquidprompt-2.2.1/tests/test_acpi.sh000077500000000000000000000062331464055045500177350ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi # Load Linux version of _lp_battery() uname() { printf 'Linux'; } . ../liquidprompt --no-activate unset -f uname LP_ENABLE_BATT=1 _LP_BATTERY_FUNCTION=__lp_battery_acpi typeset -a battery_outputs battery_statuses battery_values temp_outputs temp_values # Add test cases to these arrays like below # Linux 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64 GNU/Linux Debian 10 (buster) battery_outputs+=( "" ) battery_statuses+=(4) battery_values+=("") temp_outputs+=( "Thermal 0: ok, 23.0 degrees C" ) temp_values+=(23) # Unknown battery_outputs+=( "Battery 0: Discharging, 55%, 01:39:34 remaining" ) battery_statuses+=(0) battery_values+=(55) temp_outputs+=( "Thermal 0: ok, -267.8 degrees C" ) temp_values+=(-267) # Multiple batteries battery_outputs+=( "Battery 0: Discharging, 5%, rate information unavailable Battery 1: Discharging, 0%, rate information unavailable Battery 2: Discharging, 53%, 02:35:00 remaining" ) battery_statuses+=(0) battery_values+=(5) temp_outputs+=( "Thermal 0: ok, 39.0 degrees C" ) temp_values+=(39) # VPS at OVH temp_outputs+=( "" ) temp_values+=("") function test_acpi_battery { acpi() { printf '%s\n' "$__battery_output" } for (( index=0; index < ${#battery_values[@]}; index++ )); do __battery_output=${battery_outputs[$index]} LP_BATTERY_THRESHOLD=100 _lp_battery assertEquals "ACPI battery below returns at index ${index}" "${battery_statuses[$index]}" "$?" assertEquals "ACPI battery value at index ${index}" "${battery_values[$index]}" "$lp_battery" _status=${battery_statuses[$index]} (( _status < 4 )) && _status=$(( _status + 1 )) LP_BATTERY_THRESHOLD=0 _lp_battery assertEquals "ACPI battery above returns at index ${index}" "$_status" "$?" assertEquals "ACPI battery value at index ${index}" "${battery_values[$index]}" "$lp_battery" done } function test_acpi_temperature { LP_ENABLE_TEMP=1 _LP_LINUX_TEMPERATURE_FILES=("") LP_TEMP_THRESHOLD=-1000000 acpi() { printf '%s\n' "$__temp_output" } # Stub needed to test acpi with no output. sensors() { :; } typeset valid for (( index=0; index < ${#temp_values[@]}; index++ )); do __temp_output=${temp_outputs[$index]} unset lp_temperature __lp_temp_acpi assertEquals "ACPI temperature output at index ${index}" "${temp_values[$index]}" "${lp_temperature-}" if [[ -n ${temp_values[$index]} ]]; then valid=0 else valid=1 fi __lp_temp_detect assertEquals "ACPI temperature detect at index ${index}" "$valid" "$?" # Set the temp function in case the above detect said it was invalid. # While we should never be in this situation, might as well make sure # it doesn't crash. _LP_TEMP_FUNCTION=__lp_temp_acpi # This is to test that _lp_temperature() ignores previous high values lp_temperature=10000 _lp_temperature assertEquals "ACPI temperature return at index ${index}" "$valid" "$?" assertEquals "ACPI temperature return output at index ${index}" "${temp_values[$index]}" "${lp_temperature-}" done } . ./shunit2 liquidprompt-2.2.1/tests/test_activate.sh000066400000000000000000000004731464055045500206160ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ../liquidprompt --no-activate # Liquidprompt depends on PS1 being set to detect if it has installed itself. PS1="$ " function test_activate { lp_activate --no-config } . ./shunit2 liquidprompt-2.2.1/tests/test_airport.sh000066400000000000000000000040061464055045500204720ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi # Load MacOS version uname() { printf 'Darwin'; } . ../liquidprompt --no-activate unset -f uname LP_ENABLE_WIFI_STRENGTH=1 typeset -a outputs values # Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64 outputs+=( " agrCtlRSSI: -55 agrExtRSSI: 0 agrCtlNoise: -92 agrExtNoise: 0 state: running op mode: station lastTxRate: 400 maxRate: 400 lastAssocStatus: 0 802.11 auth: open link auth: wpa2-psk BSSID: SSID: redacted MCS: 9 guardInterval: 400 NSS: 2 channel: 36,1" ) values+=("75") # https://support.moonpoint.com/os/os-x/wireless/wifi-signal-strength outputs+=( " agrCtlRSSI: -67 agrExtRSSI: 0 agrCtlNoise: -86 agrExtNoise: 0 state: running op mode: station lastTxRate: 7 maxRate: 144 lastAssocStatus: 0 802.11 auth: open link auth: none BSSID: ec:44:76:81:e4:40 SSID: VA Internet MCS: 0 channel: 11" ) values+=("55") function test_airport { airport() { printf '%s\n' "$__output" } _LP_AIRPORT_BIN=airport for (( index=0; index < ${#values[@]}; index++ )); do __output=${outputs[$index]} LP_WIFI_STRENGTH_THRESHOLD="0" _lp_wifi_signal_strength assertEquals "airport wireless above returns at index ${index}" "1" "$?" assertEquals "airport wireless value at index ${index}" "${values[$index]}" "$lp_wifi_signal_strength" # This is to test that _lp_wifi_signal_strength() ignores previous low values. lp_wifi_signal_strength=-10000 LP_WIFI_STRENGTH_THRESHOLD="100" _lp_wifi_signal_strength assertEquals "airport wireless below returns at index ${index}" "0" "$?" assertEquals "airport wireless value at index ${index}" "${values[$index]}" "$lp_wifi_signal_strength" done } . ./shunit2 liquidprompt-2.2.1/tests/test_bash_preexec.sh000066400000000000000000000104611464055045500214440ustar00rootroot00000000000000#!/bin/bash # shellcheck disable=SC1090,SC1091,SC2031,SC2030 set -u # Note: we do not call __lp_set_prompt directly in this file, as we do # elsewhere; the idea is to check that it is properly integrated with # bash-preexec.sh. if [[ -z ${BASH_VERSION-} ]]; then echo "$0 is irrelevant for non-bash shells." exit 0 fi # Install bash-preexec.sh if [[ ! -f bash-preexec.sh ]]; then echo "Installing bash-preexec.sh in $(pwd)..." bash_preexec_version=0.4.1 curl -O https://raw.githubusercontent.com/rcaloras/bash-preexec/$bash_preexec_version/bash-preexec.sh echo "Installed bash-preexec.sh in $(pwd)..." fi function setup_bash_preexec() { set +u source ./bash-preexec.sh # bash-preexec doesn't install itself when sourced, it puts its install # command into PROMPT_COMMAND. Call it here to finish setup. __bp_install set -u } function setup_liquidprompt() { HOME=/home/user PWD=$HOME PS1="$ " . ../liquidprompt --no-activate # lp_theme activates liquid prompt a second time, which serves to double-check # that we only add __lp_set_prompt to bash-preexec's precmd_functions _once_ LP_RUNTIME_ENABLED=1 LP_RUNTIME_THRESHOLD=1 LP_ENABLE_ERROR=1 LP_ENABLE_TITLE=1 LP_ENABLE_SCREEN_TITLE=1 lp_activate --no-config lp_theme default } function setup() { setup_bash_preexec setup_liquidprompt } ### Begin actual test functions. (Above this line are setup helpers.) function test_bash_preexec_with_LP_RUNTIME { ( setup sleep 1 $PROMPT_COMMAND assertTrue '[[ -n ${_LP_RUNTIME_SECONDS-} ]] && (( _LP_RUNTIME_SECONDS > 0 ))' ) } # Check it works with bash_preexec off function test_no_bash_preexec_with_LP_RUNTIME { ( setup_liquidprompt sleep 1 $PROMPT_COMMAND assertTrue '[[ -n ${_LP_RUNTIME_SECONDS-} ]] && (( _LP_RUNTIME_SECONDS > 0 ))' ) } function test_bash_preexec_with_LP_ERR { ( setup LP_ENABLE_ERROR_MEANING=1 false # should get "1" in prompt $PROMPT_COMMAND assertContains $lp_error_color 1 assertContains $lp_error_meaning_color "(error)" ) } # Check it works with bash_preexec off function test_no_bash_preexec_with_LP_ERR { ( setup_liquidprompt LP_ENABLE_ERROR_MEANING=1 false # should get "1" in prompt $PROMPT_COMMAND assertContains $lp_error_color 1 assertContains $lp_error_meaning_color "(error)" ) } function test_bash_preexec_with_LP_ENABLE_TITLE { ( setup $PROMPT_COMMAND assertNotNull "${_lp_generated_title-}" ) } # Check it works with bash_preexec off function test_no_bash_preexec_with_LP_ENABLE_TITLE { ( setup_liquidprompt $PROMPT_COMMAND assertNotNull "${_lp_generated_title-}" ) } function test_bash_preexec_with_prompt_off { ( setup_bash_preexec precmd_functions_size_before_liquidprompt="${#precmd_functions[@]}" preexec_functions_size_before_liquidprompt="${#preexec_functions[@]}" setup_liquidprompt # We expect liquidprompt to add new entries to precmd_functions and # preexec_functions, so the arrays should no longer be equal. assertNotEquals "${#precmd_functions[@]}" "$precmd_functions_size_before_liquidprompt" assertNotEquals "${#preexec_functions[@]}" "$preexec_functions_size_before_liquidprompt" # This just checks that we did in fact get liquidprompt turned on. false # should get "1" in prompt $PROMPT_COMMAND assertNotEquals "$PS1" "$ " # Check that calling prompt_on twice doesn't insert duplicate copies of the # hooks precmd_functions_size_after_liquidprompt=${#precmd_functions[@]} preexec_functions_size_after_liquidprompt=${#preexec_functions[@]} prompt_on assertEquals "${#precmd_functions[@]}" "$precmd_functions_size_after_liquidprompt" assertEquals "${#preexec_functions[@]}" "$preexec_functions_size_after_liquidprompt" # Here's the function we're actually here to test. prompt_off # With prompt off, it should just be back to plain old "$ " false $PROMPT_COMMAND assertEquals "$PS1" "$ " # And, having run prompt_off, precmd_functions and preexec_functions should # be back to their original values. assertEquals \ "$precmd_functions_size_before_liquidprompt" \ "${#precmd_functions[@]}" assertEquals \ "$precmd_functions_size_before_liquidprompt" \ "${#preexec_functions[@]}" ) } . ./shunit2 liquidprompt-2.2.1/tests/test_connection.sh000066400000000000000000000026131464055045500211530ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ../liquidprompt --no-activate typeset -a ssh_values remotehost_values ps_outputs values # Add test cases to these arrays like below ssh_values+=( "" ) remotehost_values+=( "localhost" ) ps_outputs+=( "login" ) values+=(tel) ssh_values+=( "localhost 65116 22" ) remotehost_values+=( "" ) ps_outputs+=( "sshd" ) values+=(ssh) ssh_values+=( "localhost 65116 22" ) remotehost_values+=( "localhost" ) ps_outputs+=( "sshd" ) values+=(ssh) ssh_values+=( "" ) remotehost_values+=( "" ) ps_outputs+=( "su" ) values+=(su) ssh_values+=( "" ) remotehost_values+=( "" ) ps_outputs+=( "sudo" ) values+=(su) ssh_values+=( "" ) remotehost_values+=( "" ) ps_outputs+=( "bash" ) values+=(lcl) ssh_values+=( "" ) remotehost_values+=( "" ) ps_outputs+=( "-bash" ) values+=(lcl) ssh_values+=( "" ) remotehost_values+=( "" ) ps_outputs+=( "" ) values+=(lcl) function test_connection { typeset SSH_CLIENT REMOTEHOST SSH2_CLIENT="" SSH_TTY="" ps() { printf '%s\n' "$__ps_output" } for (( index=0; index < ${#values[@]}; index++ )); do SSH_CLIENT=${ssh_values[$index]} REMOTEHOST=${remotehost_values[$index]} __ps_output=${ps_outputs[$index]} _lp_connection assertEquals "Connection output at index ${index}" "${values[$index]}" "$lp_connection" done } . ./shunit2 liquidprompt-2.2.1/tests/test_cpu_sysctl.sh000066400000000000000000000023051464055045500212020ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi # Load MacOS version of CPU functions uname() { printf 'Darwin'; } . ../liquidprompt --no-activate typeset -a ncpu_outputs ncpu_values loadavg_outputs loadavg_values # Add test cases to these arrays like below # Darwin Kernel Version 18.7.0: Tue Nov 10 00:07:31 PST 2020; root:xnu-4903.278.51~1/RELEASE_X86_64 x86_64 i386 MacBookPro15,1 Darwin ncpu_outputs+=( "12" ) ncpu_values+=(12) loadavg_outputs+=( "{ 2.38 2.82 4.17 }" ) loadavg_values+=("2.38") function test_sysctl_hw_ncpu { sysctl() { printf '%s\n' "$__ncpu_output" } for (( index=0; index < ${#ncpu_values[@]}; index++ )); do __ncpu_output=${ncpu_outputs[$index]} __lp_cpu_count assertEquals "CPU count at index ${index}" "${ncpu_values[$index]}" "$_lp_CPUNUM" done } function test_sysctl_vm_loadavg { sysctl() { printf '%s\n' "$__loadavg_output" } for (( index=0; index < ${#loadavg_values[@]}; index++ )); do __loadavg_output=${loadavg_outputs[$index]} _lp_cpu_load assertEquals "CPU load at index ${index}" "${loadavg_values[$index]}" "$lp_cpu_load" done } . ./shunit2 liquidprompt-2.2.1/tests/test_detached_sessions.sh000066400000000000000000000051051464055045500225020ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ../liquidprompt --no-activate LP_ENABLE_DETACHED_SESSIONS=1 _LP_ENABLE_SCREEN=1 _LP_ENABLE_TMUX=1 typeset -a screen_outputs screen_values tmux_outputs tmux_values # Add test cases to these arrays like below # Linux 4.18.0-193.19.1.el8_2.x86_64 #1 SMP Mon Sep 14 14:37:00 UTC 2020 x86_64 GNU/Linux CentOS Linux release 8.2.2004 (Core) # Trailing "" are needed to prevent Git from converting \r\n into \n screen_outputs+=( "No Sockets found in /run/screen/S-user. "" " ) screen_values+=(0) screen_outputs+=( "There is a screen on: "" 2261393.pts-1.server (Detached) 1 Socket in /run/screen/S-user. "" " ) screen_values+=(1) tmux_outputs+=( "" ) tmux_values+=(0) tmux_outputs+=( "0: 1 windows (created Thu Dec 17 15:19:13 2020) [179x96] " ) tmux_values+=(1) # Darwin Kernel Version 18.7.0: Tue Nov 10 00:07:31 PST 2020; root:xnu-4903.278.51~1/RELEASE_X86_64 x86_64 i386 MacBookPro15,1 Darwin screen_outputs+=( "This room is empty (/var/folders/x3/gk96bn856xv__mnm_h8xnjqw0000gn/T/.screen). "" " ) screen_values+=(0) # Darwin Kernel Version 19.6.0: Tue Nov 10 00:10:30 PST 2020; root:xnu-6153.141.10~1/RELEASE_X86_64 x86_64 i386 Macmini7,1 Darwin screen_outputs+=( "No Sockets found in /var/folders/s1/y_2wmcg90gl9x54bq2p4t9980000gn/T/.screen. "" " ) screen_values+=(0) # Linux 5.4.0-58-generic #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020 x86_64 GNU/Linux Ubuntu 20.04.1 LTS screen_outputs+=( "There is a screen on: "" 840.irssi (12/12/20 09:49:29) (Detached) 1 Socket in /run/screen/S-usernam. "" " ) screen_values+=(1) # Linux 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64 GNU/Linux Debian 9.13 (stretch) screen_outputs+=( "There is a screen on: "" 30133.pts-6.hostnam (08/03/20 09:10:09) (Attached) 1 Socket in /run/screen/S-user. "" " ) screen_values+=(0) function test_screen_sessions { screen() { printf '%s' "$__screen_output" } tmux() { : ; } for (( index=0; index < ${#screen_values[@]}; index++ )); do __screen_output=${screen_outputs[$index]} _lp_detached_sessions assertEquals "Screen sessions output at index ${index}" "${screen_values[$index]}" "$lp_detached_sessions" done } function test_tmux_sessions { tmux() { printf '%s' "$__tmux_output" } screen() { : ; } for (( index=0; index < ${#tmux_values[@]}; index++ )); do __tmux_output=${tmux_outputs[$index]} _lp_detached_sessions assertEquals "Tmux sessions output at index ${index}" "${tmux_values[$index]}" "$lp_detached_sessions" done } . ./shunit2 liquidprompt-2.2.1/tests/test_disk.sh000066400000000000000000000075731464055045500177600ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ../liquidprompt --no-activate LP_ENABLE_DISK=1 LP_DISK_PRECISION=2 typeset -a names outputs values values_human names+=("Simple Linux") outputs+=( 'Filesystem 1024-blocks Used Available Capacity Mounted on /dev/nvme0n1p2 479608528 425188220 30011332 94% /' ) values+=(30011332) values_human+=("28.62 GiB") names+=("Cygwin with space on FS") outputs+=( 'Filesystem 1024-blocks Used Available Capacity Mounted on C:/Program Files/cygwin64 1999659004 450860152 1548798852 23% /' ) values+=(1548798852) values_human+=("1.44 TiB") names+=("Cygwin with space on mount point") outputs+=( 'Filesystem 1024-blocks Used Available Capacity Mounted on C:/Program Files/cygwin64 1999659004 450860152 1548798852 23% C:/Program Files/cygwin64/drive_d' ) values+=(1548798852) values_human+=("1.44 TiB") names+=("FreeBSD small FS, but over 1MB") outputs+=( 'Filesystem 1024-blocks Used Avail Capacity Mounted on /dev/gpt/efiesp 32764 646 32117 2% /boot/efi' ) values+=(32117) values_human+=("31.36 MiB") names+=("FreeBSD special FS") outputs+=( 'Filesystem 1024-blocks Used Avail Capacity Mounted on devfs 1 0 1 0% /dev' ) values+=("") values_human+=("") names+=("Linux special FS") outputs+=( 'Filesystem 1024-blocks Used Available Capacity Mounted on sysfs 0 0 0 - /sys' ) values+=("") values_human+=("") function test_disk { for (( i=0; i < ${#outputs[@]}; i++ )); do df() { printf '%s\n' "${outputs[i]}" } LP_DISK_THRESHOLD_PERC=99 LP_DISK_THRESHOLD=10000000000 if [ -n "${values[i]}" ]; then _lp_disk assertEquals "Parsing of \"${names[i]}\" without error" "0" "$?" assertEquals "Correct parsing of \"${names[i]}\" in KiB" "${values[i]}" "$lp_disk" assertEquals "Correct parsing of \"${names[i]}\" for human" "${values_human[i]}" "$lp_disk_human $lp_disk_human_units" else _lp_disk assertFalse "Parsing of \"${names[i]}\" skipped" "$?" fi # Note: percent threshold should be below available space in the least # available space case ("Simple Linux"), but absolute threshold # should be slightly larger than "FreeBSD small FS" test case, # so we can fully test the "total >= LP_DISK_THRESHOLD" condition. LP_DISK_THRESHOLD_PERC=5 LP_DISK_THRESHOLD=100000 _lp_disk assertFalse "Above threshold for \"${names[i]}\"" "$?" done } function test_bytes_to_human { LP_DISK_PRECISION=0 local -a units units=("B" "KiB" "MiB" "GiB" "TiB" "PiB" "EiB" "YiB" "ZiB") for (( i=1; i < 7; i++ )); do __lp_bytes_to_human $((1024**i)) "$LP_DISK_PRECISION" assertEquals "Human readable 1024**$i" "1024 ${units[i-1]}" "$lp_bytes $lp_bytes_units" done for (( i=1; i < 7; i++ )); do __lp_bytes_to_human $((1025**i)) "$LP_DISK_PRECISION" assertEquals "Human readable 1025**$i" "1 ${units[i]}" "$lp_bytes $lp_bytes_units" done for (( i=1; i < 7; i++ )); do __lp_bytes_to_human $((2*1024**i)) "$LP_DISK_PRECISION" assertEquals "Human readable 2*1024**$i" "2 ${units[i]}" "$lp_bytes $lp_bytes_units" done LP_DISK_PRECISION=1 for (( i=1; i < 7; i++ )); do __lp_bytes_to_human $((1024**i)) "$LP_DISK_PRECISION" assertEquals "Human readable 1024**$i" "1024.0 ${units[i-1]}" "$lp_bytes $lp_bytes_units" done LP_DISK_PRECISION=2 for (( i=1; i < 7; i++ )); do __lp_bytes_to_human $((1024**i)) "$LP_DISK_PRECISION" assertEquals "Human readable 1024**$i" "1024.00 ${units[i-1]}" "$lp_bytes $lp_bytes_units" done } . ./shunit2 liquidprompt-2.2.1/tests/test_env.sh000066400000000000000000000037301464055045500176050ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit fi . ../liquidprompt --no-activate function test_proxy { LP_ENABLE_PROXY=1 http_proxy="" _lp_http_proxy assertEquals "$?" "1" https_proxy="I see" _lp_http_proxy assertContains "$lp_http_proxy" "I see" https_proxy="" all_proxy="dead pixels" _lp_http_proxy assertContains "$lp_http_proxy" "dead pixels" } function test_env_vars { # For having NO_COL in _lp_env_vars PS1= lp_activate LP_ENABLE_ENV_VARS=1 LP_ENV_VARS=( "EDITOR e:%s" "VERBOSE V" "DESKTOP_SESSION %s nodesk" "USERDEFINED D U" "UNSET 0" "UNSET2 0 2" ) EDITOR="kak" VERBOSE=0 DESKTOP_SESSION="notion" USERDEFINED="" unset UNSET unset UNSET2 LP_MARK_ENV_VARS_SEP="," _lp_env_vars _lp_join "${LP_MARK_ENV_VARS_SEP}" "${lp_env_vars[@]}" assertEquals "e:kak,V,notion,D,2" "$lp_join" LP_ENV_VARS=() _lp_env_vars assertEquals "$?" "1" LP_ENV_VARS=("NOPE") _lp_env_vars assertEquals "$?" "1" } function test_modules { LP_ENABLE_MODULES=1 LP_ENABLE_MODULES_VERSIONS=1 LP_MARK_MODULES_OPEN="<" LP_MARK_MODULES_CLOSE=">" LP_MARK_MODULES_SEP="|" LP_ENABLE_COLOR=0 LOADEDMODULES="trololo/1.2.3:tralala/0:trylyly/4.5.6.7-pre-alpha-turbo" _lp_modules_color assertEquals "" "$lp_modules_color" LP_ENABLE_MODULES_VERSIONS=0 _lp_modules_color assertEquals "" "$lp_modules_color" LOADEDMODULES="trilili/1.2.3.4" _lp_modules_color assertEquals "" "$lp_modules_color" LP_ENABLE_MODULES_VERSIONS=1 LOADEDMODULES="trululu/1" _lp_modules_color assertEquals "" "$lp_modules_color" LOADEDMODULES="" _lp_modules_color assertEquals "" "$lp_modules_color" } . ./shunit2 liquidprompt-2.2.1/tests/test_git.sh000066400000000000000000000032151464055045500175760ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit fi . ../liquidprompt --no-activate function test_git { LP_ENABLE_GIT=1 LP_ENABLE_FOSSIL=0 LP_ENABLE_SVN=0 LP_ENABLE_BZR=0 LP_ENABLE_VCS_ROOT=0 LP_ENABLE_VCS_REMOTE=1 PS1="" lp_activate wd="${SHUNIT_TMPDIR}/test_remote/" mkdir -p "$wd" cd "$wd" _lp_are_vcs_enabled assertTrue "VCS are enabled here." "$?" git init git config --local user.email "author@example.com" git config --local user.name "A U Thor" # We need a commit to have a branch that can have a remote. touch test git add test git commit -m "test" --no-verify --no-gpg-sign # Ensure we use "main" and not "master". git branch -m main _lp_find_vcs assertTrue "We detect a VCS updir." "$?" assertEquals "We found a Git repo." "git" "$lp_vcs_type" assertEquals "We see the repo." "$wd" "$lp_vcs_root/" _lp_vcs_active assertTrue "Git detects the repository." "$?" git checkout -b notsomain _lp_vcs_branch assertEquals "Branch change is detected." "notsomain" "$lp_vcs_branch" # Use a local remote or else one could have problems. git branch -u main _lp_git_remote assertEquals "Remote is found." "." "$lp_vcs_remote" mkdir remote/ cp -r .git remote/ git remote add foo ./remote/ git fetch foo git checkout -b other _lp_vcs_branch assertEquals "Branch change is detected." "other" "$lp_vcs_branch" git branch -u foo/main _lp_git_remote assertEquals "Remote foo is found." "foo" "$lp_vcs_remote" } . ./shunit2 liquidprompt-2.2.1/tests/test_hostname_hash.sh000066400000000000000000000017161464055045500216400ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ../liquidprompt --no-activate typeset -a host_cksum_outputs values # Add test cases to these arrays like below # Linux 4.18.0-193.19.1.el8_2.x86_64 #1 SMP Mon Sep 14 14:37:00 UTC 2020 x86_64 GNU/Linux CentOS Linux release 8.2.2004 (Core) host_cksum_outputs+=( "4172267268 7" ) values+=("4172267268") # Darwin Kernel Version 18.7.0: Tue Nov 10 00:07:31 PST 2020; root:xnu-4903.278.51~1/RELEASE_X86_64 x86_64 i386 MacBookPro15,1 Darwin host_cksum_outputs+=( "3020151712 13" ) values+=("3020151712") function test_hostname_hash { cksum() { printf '%s\n' "$__host_cksum_output" } for (( index=0; index < ${#values[@]}; index++ )); do __host_cksum_output=${host_cksum_outputs[$index]} __lp_hostname_hash assertEquals "Hostname cksum hash at index ${index}" "${values[$index]}" "$lp_hostname_hash" done } . ./shunit2 liquidprompt-2.2.1/tests/test_lp_theme.sh000066400000000000000000000014441464055045500206120ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit fi . ../liquidprompt --no-activate function setUp { unset LP_THEME _LP_OLD_THEME _LP_THEME_ACTIVATE_FUNCTION PS1='$ ' lp_activate } function _lp_test_theme_prompt { : ; } function test_lp_theme_function { assertEquals "$LP_THEME" "default" lp_theme test assertEquals "$LP_THEME" "test" lp_theme invalid_theme assertEquals "$LP_THEME" "test" } function test_lp_theme_var { assertEquals "$LP_THEME" "default" LP_THEME=test __lp_set_prompt assertEquals "$LP_THEME" "test" LP_THEME=invalid_theme __lp_set_prompt assertEquals "$LP_THEME" "test" } function test_lp_theme_unset { lp_theme invalid_theme assertEquals "$LP_THEME" "default" } . ./shunit2 liquidprompt-2.2.1/tests/test_net_wifi.sh000066400000000000000000000034601464055045500206210ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi # Load Linux version uname() { printf 'Linux'; } . ../liquidprompt --no-activate unset -f uname LP_ENABLE_WIFI_STRENGTH=1 typeset -a outputs values # Linux 5.4.0-58-generic #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020 x86_64 GNU/Linux outputs+=( "Inter-| sta-| Quality | Discarded packets | Missed | WE face | tus | link level noise | nwid crypt frag retry misc | beacon | 22 wlo1: 0000 69. -41. -256 0 0 0 0 33 0" ) values+=("99") # Fake two interfaces outputs+=( "Inter-| sta-| Quality | Discarded packets | Missed | WE face | tus | link level noise | nwid crypt frag retry misc | beacon | 22 wlo1: 0000 69. -41. -256 0 0 0 0 33 0 wlo2: 0000 61. -58. -256 0 0 0 0 37 0" ) values+=("70") function test_net_wifi { _LP_LINUX_WIRELESS_FILE="${SHUNIT_TMPDIR}/wireless" for (( index=0; index < ${#values[@]}; index++ )); do printf '%s\n' "${outputs[$index]}" >"$_LP_LINUX_WIRELESS_FILE" LP_WIFI_STRENGTH_THRESHOLD="0" _lp_wifi_signal_strength assertEquals "Linux wireless above returns at index ${index}" "1" "$?" assertEquals "Linux wireless value at index ${index}" "${values[$index]}" "$lp_wifi_signal_strength" # This is to test that _lp_wifi_signal_strength() ignores previous low values. lp_wifi_signal_strength=-10000 LP_WIFI_STRENGTH_THRESHOLD="100" _lp_wifi_signal_strength assertEquals "Linux wireless below returns at index ${index}" "0" "$?" assertEquals "Linux wireless value at index ${index}" "${values[$index]}" "$lp_wifi_signal_strength" done } . ./shunit2 liquidprompt-2.2.1/tests/test_os.sh000066400000000000000000000111721464055045500174350ustar00rootroot00000000000000# Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit fi . ../liquidprompt --no-activate function test_os { LP_ENABLE_COLOR=0 # Cannot test hash colors. LP_ENABLE_OS=1 LP_ENABLE_OS_ARCH=1 LP_ENABLE_OS_FAMILY=1 LP_ENABLE_OS_KERNEL=1 LP_ENABLE_OS_DISTRIB=1 LP_ENABLE_OS_VERSION=1 uname() { printf 'OpenBSD i386'; } _lp_os assertEquals "BSD" "$lp_os_family" assertEquals "OpenBSD" "$lp_os_kernel" assertEquals "i386" "$lp_os_arch" assertNull "$lp_os_distrib" assertNull "$lp_os_version" unset -f uname uname() { printf 'MSYS ARM'; } _lp_os assertEquals "Windows" "$lp_os_family" assertEquals "MSYS" "$lp_os_kernel" assertEquals "ARM" "$lp_os_arch" assertNull "$lp_os_distrib" assertNull "$lp_os_version" unset -f uname uname() { printf 'Linux x86_64'; } _lp_grep_fields() { lp_grep_fields=("ubuntu" "focal"); } _lp_os assertEquals "GNU" "$lp_os_family" assertEquals "Linux" "$lp_os_kernel" assertEquals "x86_64" "$lp_os_arch" assertEquals "ubuntu" "$lp_os_distrib" assertEquals "focal" "$lp_os_version" unset -f uname unset -f _lp_grep_fields uname() { printf 'OSCO 486'; } _lp_grep_fields() { lp_grep_fields=("urs"); } _lp_os assertNull "$lp_os_family" assertNull "$lp_os_kernel" assertEquals "486" "$lp_os_arch" assertNull "$lp_os_distrib" assertNull "$lp_os_version" unset -f uname unset -f _lp_grep_fields uname() { printf 'Linux x86_64'; } _lp_grep_fields() { lp_grep_fields=("ubuntu" "focal"); } LP_MARK_OS=("FreeBSD" "NOPE" "x86" "NOPE" "GNU" "G" "Linux" "L" "x86_64" "6" "ubuntu" "U" "focal" "F") LP_MARK_OS_SEP="+" LP_ENABLE_OS_ARCH=1 LP_ENABLE_OS_FAMILY=1 LP_ENABLE_OS_KERNEL=1 LP_ENABLE_OS_DISTRIB=1 LP_ENABLE_OS_VERSION=1 _lp_os_color assertEquals "6+G+L+U+F" "$lp_os_color" unset -f uname uname() { printf 'Linux'; } LP_MARK_OS_SEP="" LP_ENABLE_OS_ARCH=0 LP_ENABLE_OS_FAMILY=1 LP_ENABLE_OS_KERNEL=1 LP_ENABLE_OS_DISTRIB=1 LP_ENABLE_OS_VERSION=1 _lp_os_color assertEquals "GLUF" "$lp_os_color" unset -f uname unset -f _lp_grep_fields # ARCH LP_ENABLE_OS_ARCH=1 LP_ENABLE_OS_FAMILY=0 LP_ENABLE_OS_KERNEL=0 LP_ENABLE_OS_DISTRIB=0 LP_ENABLE_OS_VERSION=0 uname() { printf 'Linux ARM'; } _lp_os assertEquals "ARM" "$lp_os_arch" assertNull "arch, not family" "$lp_os_family" assertNull "arch, not kernel" "$lp_os_kernel" assertNull "arch, not distrib" "$lp_os_distrib" assertNull "arch, not version" "$lp_os_version" unset -f uname # FAMILY LP_ENABLE_OS_ARCH=0 LP_ENABLE_OS_FAMILY=1 LP_ENABLE_OS_KERNEL=0 LP_ENABLE_OS_DISTRIB=0 LP_ENABLE_OS_VERSION=0 uname() { printf 'Linux'; } _lp_os assertNull "family, not arch" "$lp_os_arch" assertEquals "GNU" "$lp_os_family" assertNull "family, not kernel" "$lp_os_kernel" assertNull "family, not distrib" "$lp_os_distrib" assertNull "family, not version" "$lp_os_version" unset -f uname # KERNEL LP_ENABLE_OS_ARCH=0 LP_ENABLE_OS_FAMILY=0 LP_ENABLE_OS_KERNEL=1 LP_ENABLE_OS_DISTRIB=0 LP_ENABLE_OS_VERSION=0 uname() { printf 'Linux'; } _lp_os assertNull "kernel, not arch" "$lp_os_arch" assertNull "kernel, not family" "$lp_os_family" assertEquals "Linux" "$lp_os_kernel" assertNull "kernel, not distrib" "$lp_os_distrib" assertNull "kernel, not version" "$lp_os_version" unset -f uname # DISTRIB LP_ENABLE_OS_ARCH=0 LP_ENABLE_OS_FAMILY=0 LP_ENABLE_OS_KERNEL=0 LP_ENABLE_OS_DISTRIB=1 LP_ENABLE_OS_VERSION=0 uname() { printf 'Linux'; } _lp_grep_fields() { lp_grep_fields=("ubuntu"); } _lp_os assertNull "distrib, not arch" "$lp_os_arch" assertNull "distrib, not family" "$lp_os_family" assertNull "distrib, not kernel" "$lp_os_kernel" assertEquals "ubuntu" "$lp_os_distrib" assertNull "distrib, not version" "$lp_os_version" unset -f uname unset -f _lp_grep_fields # VERSION LP_ENABLE_OS_ARCH=0 LP_ENABLE_OS_FAMILY=0 LP_ENABLE_OS_KERNEL=0 LP_ENABLE_OS_DISTRIB=0 LP_ENABLE_OS_VERSION=1 uname() { printf 'Linux'; } _lp_grep_fields() { lp_grep_fields=("focal"); } _lp_os assertNull "version, not arch" "$lp_os_arch" assertNull "version, not family" "$lp_os_family" assertNull "version, not kernel" "$lp_os_kernel" assertNull "version, not distrib" "$lp_os_distrib" assertEquals "focal" "$lp_os_version" unset -f uname unset -f _lp_grep_fields } . ./shunit2 liquidprompt-2.2.1/tests/test_perl.sh000066400000000000000000000035121464055045500177550ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ../liquidprompt --no-activate # Liquid Prompt depends on PS1 being set to detect if it has installed itself. PS1="$ " LP_ENABLE_PERL_VENV=1 typeset -a perlbrew_outputs perlbrew_return_strings # Add test cases to these arrays like below # Example from perlbrew execution perlbrew_outputs+=( "Currently using perl-5.38.0" ) perlbrew_return_strings+=( "5.38.0" ) # Example from plenv execution plenv_outputs+=( "5.10.1" ) plenv_return_strings+=( "5.10.1" ) function test_perlbrew { perlbrew() { printf '%s\n' "$__perlbrew_output" } _LP_PERL_VENV_PROGRAM=perlbrew for (( index=0; index < ${#perlbrew_outputs[@]}; index++ )); do __perlbrew_output=${perlbrew_outputs[$index]} _lp_perl_env assertEquals "perlbrew returns at index ${index}" "${perlbrew_return_strings[$index]}" "$lp_perl_env" done } function test_perlbrew_default { perlbrew() { printf 'Currently using system perl\n' } _LP_PERL_VENV_PROGRAM=perlbrew unset lp_perl_env _lp_perl_env [[ "$?" == 1 ]] || fail "perlbrew system returned not 1" assertNull "perlbrew system returned string" "${lp_perl_env+x}" } function test_plenv { plenv() { printf '%s\n' "$__plenv_output" } _LP_PERL_VENV_PROGRAM=plenv for (( index=0; index < ${#plenv_outputs[@]}; index++ )); do __plenv_output=${plenv_outputs[$index]} _lp_perl_env assertEquals "plenv returns at index ${index}" "${plenv_return_strings[$index]}" "$lp_perl_env" done } function test_plenv_default { plenv() { printf 'system\n' } _LP_PERL_VENV_PROGRAM=plenv unset lp_perl_env _lp_perl_env [[ "$?" == 1 ]] || fail "plenv system returned not 1" assertNull "plenv system returned string" "${lp_perl_env+x}" } . ./shunit2 liquidprompt-2.2.1/tests/test_pmset.sh000066400000000000000000000054431464055045500201500ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi # Load MacOS version of _lp_battery() uname() { printf 'Darwin'; } . ../liquidprompt --no-activate unset -f uname LP_ENABLE_BATT=1 typeset -a outputs statuses values # Simulated, originally from ./pmset-simulator # https://github.com/liquidprompt/liquidprompt/issues/315 outputs+=( "Now drawing from 'AC Power'" ) statuses+=(4) values+=('') # https://github.com/liquidprompt/liquidprompt/issues/326#issuecomment-66120495 outputs+=( "Now drawing from 'AC Power' -InternalBattery-0 37%; AC attached; not charging" ) statuses+=(2) values+=(37) # https://github.com/liquidprompt/liquidprompt/issues/326 outputs+=( "Now drawing from 'AC Power' -InternalBattery-0 8%; charging; 2:46 remaining" ) statuses+=(2) values+=(8) # https://github.com/liquidprompt/liquidprompt/issues/326 outputs+=( "Now drawing from 'Battery Power' -InternalBattery-0 9%; discharging; (no estimate)" ) statuses+=(0) values+=(9) # https://github.com/liquidprompt/liquidprompt/issues/326 outputs+=( "Now drawing from 'Battery Power' -InternalBattery-0 7%; discharging; 0:13 remaining Battery Warning: Early" ) statuses+=(0) values+=(7) # Darwin Kernel Version 20.2.0: Wed Dec 2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64 outputs+=( "Now drawing from 'AC Power' -InternalBattery-0 (id=5701731) 100%; charged; 0:00 remaining present: true" ) statuses+=(4) values+=(100) outputs+=( "Now drawing from 'Battery Power' -InternalBattery-0 (id=5701731) 100%; discharging; 2:49 remaining present: true" ) statuses+=(0) values+=(100) # Darwin Kernel Version 18.7.0: Tue Nov 10 00:07:31 PST 2020; root:xnu-4903.278.51~1/RELEASE_X86_64 x86_64 i386 MacBookPro15,1 Darwin outputs+=( "Now drawing from 'AC Power' -InternalBattery-0 (id=4325475) 100%; charged; 0:00 remaining present: true" ) statuses+=(4) values+=(100) # Darwin Kernel Version 19.6.0: Tue Nov 10 00:10:30 PST 2020; root:xnu-6153.141.10~1/RELEASE_X86_64 x86_64 i386 Macmini7,1 Darwin outputs+=( "Now drawing from 'AC Power'" ) statuses+=(4) values+=('') function test_pmset { pmset() { printf '%s\n' "$__output" } for (( index=0; index < ${#values[@]}; index++ )); do __output=${outputs[$index]} LP_BATTERY_THRESHOLD=100 _lp_battery assertEquals "pmset battery below returns at index ${index}" "${statuses[$index]}" "$?" assertEquals "pmset battery value at index ${index}" "${values[$index]}" "$lp_battery" _status=${statuses[$index]} (( _status < 4 )) && _status=$(( _status + 1 )) LP_BATTERY_THRESHOLD=0 _lp_battery assertEquals "pmset battery above returns at index ${index}" "$_status" "$?" assertEquals "pmset battery value at index ${index}" "${values[$index]}" "$lp_battery" done } . ./shunit2 liquidprompt-2.2.1/tests/test_python_venv.sh000077500000000000000000000024251464055045500213770ustar00rootroot00000000000000# Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ../liquidprompt --no-activate LP_ENABLE_VIRTUALENV=1 test_python_venv() { VIRTUAL_ENV="$SHUNIT_TMPDIR/venv" mkdir "$VIRTUAL_ENV" _lp_python_env assertEquals "Python venv directory base name" venv "$lp_python_env" echo "prompt = virtualenv" > "$VIRTUAL_ENV/pyvenv.cfg" _lp_python_env assertEquals "Python venv config file basic" virtualenv "$lp_python_env" echo "prompt = 'my venv'" > "$VIRTUAL_ENV/pyvenv.cfg" _lp_python_env assertEquals "Python venv config file single quotes" "my venv" "$lp_python_env" echo 'prompt = "second venv"' > "$VIRTUAL_ENV/pyvenv.cfg" _lp_python_env assertEquals "Python venv config file double quotes" "second venv" "$lp_python_env" echo "prompt=virtualenv" > "$VIRTUAL_ENV/pyvenv.cfg" _lp_python_env assertEquals "Python venv config file basic" virtualenv "$lp_python_env" echo "prompt='my venv'" > "$VIRTUAL_ENV/pyvenv.cfg" _lp_python_env assertEquals "Python venv config file single quotes" "my venv" "$lp_python_env" echo 'prompt="second venv"' > "$VIRTUAL_ENV/pyvenv.cfg" _lp_python_env assertEquals "Python venv config file double quotes" "second venv" "$lp_python_env" } . ./shunit2 liquidprompt-2.2.1/tests/test_ram.sh000066400000000000000000000237401464055045500175770ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi LP_ENABLE_RAM=1 typeset -a os outputs values_avail values_total values_remaining values_human # Fake trivial Linux. # Should be the first one, for test_ram_threshold below. os+=('Linux') outputs+=('MemTotal: 2048 kB MemAvailable: 1024 kB') values_avail+=('1048576') values_total+=('2097152') values_remaining+=('1024') values_human+=('1024KiB') # Another trivial, testing human display of MiB. os+=('Linux') outputs+=('MemTotal: 2097152 kB MemAvailable: 1048576 kB') # 1024 * 1024 values_avail+=('1073741824') values_total+=('2147483648') values_remaining+=('1048576') values_human+=('1024MiB') # Another trivial, testing human display of GiB. os+=('Linux') outputs+=('MemTotal: 2147483648 kB MemAvailable: 1073741824 kB') # 1024 * 1024 * 1024 values_avail+=('1099511627776') values_total+=('2199023255552') values_remaining+=('1073741824') values_human+=('1024GiB') # Linux 5.4.0-139-generic #156-Ubuntu SMP Fri Jan 20 17:27:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux os+=('Linux') outputs+=('MemTotal: 8033668 kB MemFree: 2722348 kB MemAvailable: 6899116 kB Buffers: 1360936 kB Cached: 2226412 kB SwapCached: 0 kB Active: 2558628 kB Inactive: 1491516 kB Active(anon): 455688 kB Inactive(anon): 46872 kB Active(file): 2102940 kB Inactive(file): 1444644 kB Unevictable: 4504 kB Mlocked: 32 kB SwapTotal: 2097148 kB SwapFree: 2097148 kB Dirty: 336 kB Writeback: 0 kB AnonPages: 467004 kB Mapped: 451292 kB Shmem: 53164 kB KReclaimable: 939992 kB Slab: 1126700 kB SReclaimable: 939992 kB SUnreclaim: 186708 kB KernelStack: 5796 kB PageTables: 8952 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 6113980 kB Committed_AS: 2605400 kB VmallocTotal: 34359738367 kB VmallocUsed: 71264 kB VmallocChunk: 0 kB Percpu: 4464 kB HardwareCorrupted: 0 kB AnonHugePages: 0 kB ShmemHugePages: 0 kB ShmemPmdMapped: 0 kB FileHugePages: 0 kB FilePmdMapped: 0 kB CmaTotal: 0 kB CmaFree: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB Hugetlb: 0 kB DirectMap4k: 564428 kB DirectMap2M: 7710720 kB DirectMap1G: 1048576 kB ' ) values_avail+=('7064694784') values_total+=('8226476032') values_remaining+=('6899116') values_human+=('6GiB') # (Free?)BSD, unknown version os+=('FreeBSD') outputs+=('usable memory = 34346901504 (32755 MB) avail memory = 33139134464 (31603 MB)') values_avail+=('33139134464') values_total+=('34346901504') values_remaining+=('32362436') values_human+=('30GiB') # FreeBSD 13.2-RELEASE-p1 GENERIC amd64 os+=('FreeBSD') outputs+=('Hypervisor: Origin = "KVMKVMKVM" real memory = 8589934592 (8192 MB) avail memory = 8270389248 (7887 MB) Event timer "LAPIC" quality 600 ACPI APIC Table: ') values_avail+=('8270389248') values_total+=('8589934592') values_remaining+=('8076552') values_human+=('7GiB') # Darwin 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64 x86_64 os+=('Darwin') outputs+=('Mach Virtual Memory Statistics: (page size of 4096 bytes) Pages free: 77936. Pages active: 1729321. Pages inactive: 1684334. Pages speculative: 45972. Pages throttled: 0. Pages wired down: 620324. Pages purgeable: 18622. "Translation faults": 134215056. Pages copy-on-write: 2741383. Pages zero filled: 97842470. Pages reactivated: 658037. Pages purged: 470473. File-backed pages: 786795. Anonymous pages: 2672832. Pages stored in compressor: 105679. Pages occupied by compressor: 35785. Decompressions: 256471. Compressions: 447621. Pageins: 4513634. Pageouts: 11829. Swapins: 6144. Swapouts: 6656. ') # (free + inactive) * page_size # (77936+ 1684334 ) * 4096 values_avail+=('7218257920') # (free + active + inactive + speculative + throttled + wired down + occupied by compressor) * page_size # (77936+ 1729321+ 1684334 + 45972 + 0 + 620324 + 35785 ) * 4096 values_total+=('17177280512') values_remaining+=('7049080') values_human+=('6GiB') # Darwin 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:05 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6000 arm64 os+=('Darwin') outputs+=('Mach Virtual Memory Statistics: (page size of 16384 bytes) Pages free: 1415073. Pages active: 1261473. Pages inactive: 940337. Pages speculative: 324830. Pages throttled: 0. Pages wired down: 197899. Pages purgeable: 96625. "Translation faults": 513307041. Pages copy-on-write: 29469303. Pages zero filled: 207776720. Pages reactivated: 864998. Pages purged: 1374714. File-backed pages: 1140390. Anonymous pages: 1386250. Pages stored in compressor: 0. Pages occupied by compressor: 0. Decompressions: 0. Compressions: 0. Pageins: 2250761. Pageouts: 0. Swapins: 0. Swapouts: 0. ') values_avail+=('38591037440') values_total+=('67823403008') values_remaining+=('37686560') values_human+=('35GiB') function test_ram() { _LP_LINUX_RAM_FILE="${SHUNIT_TMPDIR}/lpraminfo" _LP_BSD_RAM_FILE="${SHUNIT_TMPDIR}/lpraminfo" LP_RAM_THRESHOLD_PERC=100 # Available mem% will always lesser or equal than 100. LP_RAM_THRESHOLD=$(( (1<<63)-1 )) # MAXINT in 64 bits. LP_RAM_PRECISION=0 typeset lp_ram_avail_bytes lp_ram_total_bytes lp_ram_used_bytes # Set to null because we don't use the `if _lp_ram` guard construction. typeset lp_ram_used_perc= lp_ram_perc= # Iterate over tests. for (( i=0; i < ${#values_avail[@]}; i++ )); do # Load correct version for OS. uname() { printf "${os[$i]}"; } . ../liquidprompt --no-activate unset -f uname # Linux and BSD. printf '%s\n' "${outputs[$i]}" > "${SHUNIT_TMPDIR}/lpraminfo" # Darwin. vm_stat() { printf '%s\n' "${outputs[$i]}" } __lp_ram_bytes assertEquals " #$i ${LP_OS} available memory." "${values_avail[$i]}" "${lp_ram_avail_bytes}" assertEquals " #$i ${LP_OS} total memory." "${values_total[$i]}" "${lp_ram_total_bytes}" assertEquals " #$i ${LP_OS} used memory." "$((lp_ram_total_bytes-lp_ram_avail_bytes))" "${lp_ram_used_bytes}" _lp_ram assertEquals " #$i ${LP_OS} untouched available memory." "${values_avail[$i]}" "${lp_ram_avail_bytes}" assertEquals " #$i ${LP_OS} untouched total memory." "${values_total[$i]}" "${lp_ram_total_bytes}" assertEquals " #$i ${LP_OS} untouched used memory." "$((lp_ram_total_bytes-lp_ram_avail_bytes))" "${lp_ram_used_bytes}" assertEquals " #$i ${LP_OS} available percentage." "$((lp_ram_avail_bytes*100/lp_ram_total_bytes))" "${lp_ram_perc}" assertEquals " #$i ${LP_OS} remaining." "${values_remaining[$i]}" "${lp_ram}" assertEquals " #$i ${LP_OS} human." "${values_human[$i]}" "${lp_ram_human}${lp_ram_human_units}" done unset -f vm_stat } function test_ram_threshold() { _LP_LINUX_RAM_FILE="${SHUNIT_TMPDIR}/lpraminfo" LP_MARK_RAM="M" LP_RAM_PRECISION=0 typeset lp_ram_perc= # 0 = no error, 1 = error. local OK=0 NO=1 local MAXINT=$(( (1<<63)-1 )) # MAXINT in 64 bits. # Load Linux version. uname() { printf 'Linux'; } . ../liquidprompt --no-activate unset -f uname LP_RAM_THRESHOLD=0 # Fake trivial meminfo = 1024/2048 kB. printf '%s\n' "${outputs[0]}" > "$_LP_LINUX_RAM_FILE" LP_RAM_THRESHOLD_PERC=100 _lp_ram assertEquals "Tests expect fake trivial meminfo" "50" "$lp_ram_perc" LP_RAM_THRESHOLD_PERC=0 _lp_ram assertEquals "No display at $lp_ram_perc <= $LP_RAM_THRESHOLD_PERC" "$NO" "$?" LP_RAM_THRESHOLD_PERC=100 _lp_ram assertEquals "Display at $lp_ram_perc <= $LP_RAM_THRESHOLD_PERC" "$OK" "$?" LP_RAM_THRESHOLD_PERC=50 _lp_ram assertEquals "Display at $lp_ram_perc <= $LP_RAM_THRESHOLD_PERC" "$OK" "$?" LP_RAM_THRESHOLD_PERC=51 _lp_ram assertEquals "Display at $lp_ram_perc <= $LP_RAM_THRESHOLD_PERC" "$OK" "$?" LP_RAM_THRESHOLD_PERC=49 _lp_ram assertEquals "No display at $lp_ram_perc <= $LP_RAM_THRESHOLD_PERC" "$NO" "$?" # At least one or both thresholds. LP_RAM_THRESHOLD_PERC=100 LP_RAM_THRESHOLD=0 _lp_ram assertEquals "Display at $lp_ram_perc <= $LP_RAM_THRESHOLD_PERC" "$OK" "$?" LP_RAM_THRESHOLD_PERC=0 LP_RAM_THRESHOLD=$MAXINT _lp_ram assertEquals "Display at $lp_ram_perc <= $LP_RAM_THRESHOLD_PERC" "$OK" "$?" LP_RAM_THRESHOLD_PERC=100 LP_RAM_THRESHOLD=$MAXINT _lp_ram assertEquals "Display at $lp_ram_perc <= $LP_RAM_THRESHOLD_PERC" "$OK" "$?" LP_RAM_THRESHOLD_PERC=0 LP_RAM_THRESHOLD=0 _lp_ram assertEquals "No display at $lp_ram_perc <= $LP_RAM_THRESHOLD_PERC" "$NO" "$?" } . ./shunit2 liquidprompt-2.2.1/tests/test_ruby.sh000066400000000000000000000036421464055045500200000ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ../liquidprompt --no-activate # Liquid Prompt depends on PS1 being set to detect if it has installed itself. PS1="$ " LP_ENABLE_RUBY_VENV=1 LP_RUBY_RVM_PROMPT_OPTIONS=("i" "v" "g" "s") typeset -a rbenv_outputs rbenv_return_strings rvm_outputs rvm_return_strings # Add test cases to these arrays like below # Example from rbenv documentation rbenv_outputs+=( "1.9.3-p327" ) rbenv_return_strings+=( "1.9.3-p327" ) # Example from rvm documentation rvm_outputs+=( "ruby-3.2.2" ) rvm_return_strings+=( "ruby-3.2.2" ) function test_rbenv { rbenv() { printf '%s\n' "$__rbenv_output" } _LP_RUBY_VENV_PROGRAM=rbenv for (( index=0; index < ${#rbenv_outputs[@]}; index++ )); do __rbenv_output=${rbenv_outputs[$index]} _lp_ruby_env assertEquals "rbenv returns at index ${index}" "${rbenv_return_strings[$index]}" "$lp_ruby_env" done } function test_rbenv_default { rbenv() { printf 'system\n' } _LP_RUBY_VENV_PROGRAM=rbenv unset lp_ruby_env _lp_ruby_env assertTrue "rbenv system returned not 1" '[[ "$?" == 1 ]]' assertNull "rbenv system returned string" "${lp_ruby_env+x}" } function test_rvm { rvm-prompt() { printf '%s\n' "$__rvm_output" } _LP_RUBY_VENV_PROGRAM=rvm for (( index=0; index < ${#rvm_outputs[@]}; index++ )); do __rvm_output=${rvm_outputs[$index]} _lp_ruby_env assertEquals "rvm-prompt returns at index ${index}" "${rvm_return_strings[$index]}" "$lp_ruby_env" done } function test_rmv_default { rvm-prompt() { printf '%s\n' "$__rvm_output" } _LP_RUBY_VENV_PROGRAM=rvm for __rvm_output in "system" ""; do echo "$__rvm_output" unset lp_ruby_env _lp_ruby_env [[ "$?" == 1 ]] || fail "rbenv system returned not 1" assertNull "rbenv system returned string" "${lp_ruby_env+x}" done } . ./shunit2 liquidprompt-2.2.1/tests/test_sensors.sh000066400000000000000000000127071464055045500205150ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ../liquidprompt --no-activate typeset -a outputs values # Add test cases to these arrays like below # No output outputs+=("") values+=("") # Linux 4.18.0-193.19.1.el8_2.x86_64 #1 SMP Mon Sep 14 14:37:00 UTC 2020 x86_64 GNU/Linux CentOS Linux release 8.2.2004 (Core) outputs+=( "k10temp-pci-00c3 Adapter: PCI adapter CPU: temp1_input: 15.000 temp1_max: 70.000 temp1_crit: 75.000 temp1_crit_hyst: 74.000 acpitz-virtual-0 Adapter: Virtual device temp1: temp1_input: 25.000 temp1_crit: 80.000 radeon-pci-0008 Adapter: PCI adapter temp1: temp1_input: 12.000 temp1_crit: 120.000 temp1_crit_hyst: 90.000" ) values+=(25) # Linux 5.4.0-58-generic #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020 x86_64 GNU/Linux Ubuntu 20.04.1 LTS outputs+=( "ath10k_hwmon-pci-0200 Adapter: PCI adapter temp1: temp1_input: 47.000 coretemp-isa-0000 Adapter: ISA adapter Package id 0: temp1_input: 68.000 temp1_max: 100.000 temp1_crit: 100.000 temp1_crit_alarm: 0.000 Core 0: temp2_input: 68.000 temp2_max: 100.000 temp2_crit: 100.000 temp2_crit_alarm: 0.000 Core 1: temp3_input: 67.000 temp3_max: 100.000 temp3_crit: 100.000 temp3_crit_alarm: 0.000 Core 2: temp4_input: 66.000 temp4_max: 100.000 temp4_crit: 100.000 temp4_crit_alarm: 0.000 Core 3: temp5_input: 65.000 temp5_max: 100.000 temp5_crit: 100.000 temp5_crit_alarm: 0.000 BAT0-acpi-0 Adapter: ACPI interface in0: in0_input: 12.642 curr1: curr1_input: 0.001 dell_smm-virtual-0 Adapter: Virtual device fan1: fan1_input: 4921.000 fan2: fan2_input: 4921.000 pch_skylake-virtual-0 Adapter: Virtual device temp1: temp1_input: 55.500 acpitz-acpi-0 Adapter: ACPI interface temp1: temp1_input: 25.000 temp1_crit: 107.000 " ) values+=(68) # Linux 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64 GNU/Linux Debian 9.13 (stretch) outputs+=( "coretemp-isa-0000 Adapter: ISA adapter Physical id 0: temp1_input: 51.000 temp1_max: 74.000 temp1_crit: 94.000 temp1_crit_alarm: 0.000 Core 0: temp2_input: 46.000 temp2_max: 74.000 temp2_crit: 94.000 temp2_crit_alarm: 0.000 Core 1: temp3_input: 52.000 temp3_max: 74.000 temp3_crit: 94.000 temp3_crit_alarm: 0.000 Core 2: temp4_input: 48.000 temp4_max: 74.000 temp4_crit: 94.000 temp4_crit_alarm: 0.000 Core 3: temp5_input: 43.000 temp5_max: 74.000 temp5_crit: 94.000 temp5_crit_alarm: 0.000 " ) values+=(52) # Linux 4.9.78-xxxx-std-ipv6-64 #2 SMP Wed Jan 24 10:27:15 CET 2018 x86_64 GNU/Linux Debian 10 (buster) outputs+=( "coretemp-isa-0000 Adapter: ISA adapter Core 0: temp2_input: 48.000 temp2_crit: 100.000 temp2_crit_alarm: 0.000 Core 1: temp3_input: 47.000 temp3_crit: 100.000 temp3_crit_alarm: 0.000 w83627dhg-isa-0290 Adapter: ISA adapter Vcore: in0_input: 1.032 in0_min: 0.000 in0_max: 1.744 in0_alarm: 0.000 in1: in1_input: 1.008 in1_min: 2.024 in1_max: 1.056 in1_alarm: 1.000 AVCC: in2_input: 3.376 in2_min: 2.976 in2_max: 3.632 in2_alarm: 0.000 +3.3V: in3_input: 3.376 in3_min: 2.976 in3_max: 3.632 in3_alarm: 0.000 in4: in4_input: 1.016 in4_min: 1.240 in4_max: 0.232 in4_alarm: 1.000 in5: in5_input: 1.512 in5_min: 1.760 in5_max: 0.576 in5_alarm: 1.000 in6: in6_input: 1.080 in6_min: 0.664 in6_max: 0.048 in6_alarm: 1.000 3VSB: in7_input: 3.392 in7_min: 2.976 in7_max: 3.632 in7_alarm: 0.000 Vbat: in8_input: 3.264 in8_min: 2.704 in8_max: 3.632 in8_alarm: 0.000 fan1: fan1_input: 0.000 fan1_min: 10546.000 fan1_alarm: 1.000 fan1_div: 128.000 fan2: fan2_input: 0.000 fan2_min: 10546.000 fan2_alarm: 1.000 fan2_div: 128.000 fan3: fan3_input: 0.000 fan3_min: 10546.000 fan3_alarm: 1.000 fan3_div: 128.000 fan4: fan4_input: 0.000 fan4_min: 10546.000 fan4_alarm: 1.000 fan4_div: 128.000 fan5: fan5_input: 0.000 fan5_min: 10546.000 fan5_alarm: 1.000 fan5_div: 128.000 temp1: temp1_input: 44.000 temp1_max: 3.000 temp1_max_hyst: 64.000 temp1_alarm: 0.000 temp1_type: 1.000 temp1_offset: 0.000 temp3: temp3_input: 44.500 temp3_max: 80.000 temp3_max_hyst: 75.000 temp3_alarm: 0.000 temp3_type: 1.000 temp3_offset: 0.000 cpu0_vid: cpu0_vid: 0.000 intrusion0: intrusion0_alarm: 1.000 " ) values+=(48) function test_sensors { LP_ENABLE_TEMP=1 _LP_LINUX_TEMPERATURE_FILES=("") LP_TEMP_THRESHOLD=-1000000 sensors() { printf '%s\n' "$__output" } # Stub needed to test sensors with no output. acpi() { :; } for (( index=0; index < ${#values[@]}; index++ )); do __output=${outputs[$index]} unset lp_temperature __lp_temp_sensors assertEquals "Sensors temperature output at index ${index}" "${values[$index]}" "${lp_temperature-}" if [[ -n ${values[$index]} ]]; then valid=0 else valid=1 fi __lp_temp_detect assertEquals "Sensors temperature detect at index ${index}" "$valid" "$?" # Set the temp function in case the above detect said it was invalid. # While we should never be in this situation, might as well make sure # it doesn't crash. _LP_TEMP_FUNCTION=__lp_temp_sensors # This is to test that _lp_temperature() ignores previous high values lp_temperature=10000 _lp_temperature assertEquals "Sensors temperature return at index ${index}" "$valid" "$?" assertEquals "Sensors temperature return output at index ${index}" "${values[$index]}" "${lp_temperature-}" done } . ./shunit2 liquidprompt-2.2.1/tests/test_shell.sh000066400000000000000000000413311464055045500201230ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit fi function test_test { assertTrue "[[ form of test" '[[ 1 -eq 1 ]]' assertTrue "[[ -n" '[[ -n foo ]]' assertTrue "[[ -n quoted" '[[ -n "foo" ]]' assertFalse "[[ -n empty quoted" '[[ -n "" ]]' assertFalse "[[ -z" '[[ -z foo ]]' assertFalse "[[ -z quoted" '[[ -z "foo" ]]' assertTrue "[[ -z empty quoted" '[[ -z "" ]]' assertTrue "[[ nonempty" '[[ foo ]]' assertTrue "[[ nonempty 1" '[[ 1 ]]' assertTrue "[[ nonempty 0" '[[ 0 ]]' assertFalse "[[ empty quoted" '[[ "" ]]' } function test_redirection { assertTrue "Redirection stdout" 'echo foo >/dev/null' assertEquals "Redirection stdout" "" "$(echo foo >/dev/null)" assertTrue "Redirection stderr" 'echo foo 2>/dev/null' assertEquals "Redirection stdout" "foo" "$(echo foo 2>/dev/null)" assertTrue "Redirection stdout and stderr" 'echo foo >/dev/null 2>&1' assertEquals "Redirection stdout and stderr" "" "$(echo foo >/dev/null 2>&1)" } function test_block { assertTrue "Basic block return code" '{ : ; }' assertFalse "Basic block return code" '{ false; }' assertTrue "Basic block redirection" '{ echo foo; } >/dev/null' assertEquals "Basic block redirection" "" "$({ echo foo; } >/dev/null)" } function test_case { case abcd in ab*) assertTrue ${SHUNIT_TRUE} ;; *) fail "Case failed glob match" ;; esac case abcd in abcd|efgh) assertTrue ${SHUNIT_TRUE} ;; *) fail "Case failed or (|) match" ;; esac case abcd in efgh) : ;; *) : # Missing ;; on the last statement esac assertTrue "Missing ';;' on case statement not ignored" $? case abcd in efgh) : ;; esac assertTrue "Missing default on case statement not ignored" $? } function test_unset { assertTrue "var should start unset" '[[ -z ${var+x} ]]' var="" assertFalse "var should now be set" '[[ -z ${var+x} ]]' unset var assertTrue "var should again be unset" '[[ -z ${var+x} ]]' assertFalse "function should start unset" 'typeset -f local_function' function local_function { :; } assertTrue "function should now be set" 'typeset -f local_function >/dev/null' unset -f local_function assertFalse "function should again be unset" 'typeset -f local_function' } function test_local { typeset a a=2 assertEquals "Local assignment" 2 "$a" typeset b=3 assertEquals "Local inline assignment" 3 "$b" function local_function { typeset c=4 } local_function assertNull "c should not be set" "${c+x}" function local_function { assertEquals "c should inherit from outer scope" 5 "$c" typeset c=4 assertEquals "c should be overridden by inner scope" 4 "$c" } c=5 local_function assertEquals "c should not be modified" 5 "$c" function local_function { typeset d=6 e=7 assertEquals "d should be set in inner scope" 6 "$d" assertEquals "e should be set in inner scope" 7 "$e" } local_function assertNull "d should not be set" "${d+x}" assertNull "e should not be set" "${e+x}" unset -f local_function } function test_here_string { assertEquals "Here string failed" "foobar" $(cat <<< "foobar") } function test_read { typeset IFS=' ' # The check of the vars must be done in the same subshell as the read, as # they won't exist after the pipeline terminates printf '%s %s %s' foo bar baz | { read a b c assertEquals "read first var" "foo" "$a" assertEquals "read second var" "bar" "$b" assertEquals "read last var" "baz" "$c" } printf '%s %s %s' foo bar baz | { read a eof assertEquals "read first var" "foo" "$a" assertEquals "read ending vars" "bar baz" "$eof" } # Same as above, but with here-string read a eof <<<"foo bar baz" assertEquals "read first var" "foo" "$a" assertEquals "read ending vars" "bar baz" "$eof" # Test -r read -r a b <<<"foo \bar" assertEquals "read first var" "foo" "$a" assertEquals "read backslash var" "\bar" "$b" # Test empty vars read a b <<<"foo" assertEquals "read first var" "foo" "$a" assertEquals "read empty var" "" "$b" } function test_parameter_expansion_unset { assertEquals "Parameter expansion unset replace unset" "foo" "${var:-foo}" assertEquals "Parameter expansion unset replace unset" "foo" "${var-foo}" # zsh treats `typeset var` equal to `typeset var=`, while ksh and bash treat # them differently. This makes the `${var-replace}` form not safe typeset var= assertEquals "Parameter expansion unset replace empty" "foo" "${var:-foo}" assertEquals "Parameter expansion unset replace empty" "" "${var-foo}" var=bar assertEquals "Parameter expansion unset don't replace" "bar" "${var:-foo}" assertEquals "Parameter expansion unset don't replace" "bar" "${var-foo}" unset var # This form is only useful if the `set -u` option is set, to prevent the shell # From erroring on accessing an unset variable. Think of it as a declaration # that you know it might be unset and it doesn't matter. assertEquals "Parameter expansion unset replace unset with null" "" "${var-}" assertEquals "Parameter expansion unset replace unset quoted" "foo" "${var-"foo"}" assertEquals "Parameter expansion unset replace unset with dash" "foo-bar" "${var-foo-bar}" } function test_parameter_expansion_set { assertEquals "Parameter expansion unset replace set" "" "${var:+foo}" assertEquals "Parameter expansion unset replace set" "" "${var+foo}" # zsh treats `typeset var` equal to `typeset var=""` # This makes the `${var-replace}` form not safe typeset var="" assertEquals "Parameter expansion unset replace nonempty" "" "${var:+foo}" assertEquals "Parameter expansion unset replace notset" "foo" "${var+foo}" var=bar assertEquals "Parameter expansion unset do replace" "foo" "${var:+foo}" assertEquals "Parameter expansion unset do replace" "foo" "${var+foo}" } function test_parameter_expansion_assign { assertEquals "Parameter expansion assign unset" "foo" "${var:=foo}" assertEquals "Parameter expansion assign unset assigned" "foo" "$var" unset var assertEquals "Parameter expansion assign unset" "foo" "${var=foo}" assertEquals "Parameter expansion assign unset assigned" "foo" "$var" unset var typeset var="" assertEquals "Parameter expansion assign empty" "foo" "${var:=foo}" assertEquals "Parameter expansion assign unset assigned" "foo" "$var" var="" assertEquals "Parameter expansion assign empty" "" "${var=foo}" assertEquals "Parameter expansion assign empty assigned" "" "$var" var=bar assertEquals "Parameter expansion don't assign" "bar" "${var:=foo}" assertEquals "Parameter expansion not assigned" "bar" "$var" assertEquals "Parameter expansion don't assign" "bar" "${var=foo}" assertEquals "Parameter expansion not assigned" "bar" "$var" } function test_parameter_expansion_cut { typeset var=abcdabcd assertEquals "Parameter expansion shortest starting cut" cdabcd "${var#ab}" assertEquals "Parameter expansion shortest starting cut" $var "${var#b}" assertEquals "Parameter expansion shortest starting cut glob" cdabcd "${var#*b}" assertEquals "Parameter expansion longest starting cut glob" cd "${var##*ab}" assertEquals "Parameter expansion shortest trailing cut" abcdab "${var%cd}" assertEquals "Parameter expansion shortest trailing cut" $var "${var%c}" assertEquals "Parameter expansion shortest trailing cut glob" abcdab "${var%c*}" assertEquals "Parameter expansion longest trailing cut glob" ab "${var%%cd*}" assertEquals "Parameter expansion nothing starting cut" "$var" "${var#foo}" assertEquals "Parameter expansion nothing starting cut glob" "$var" "${var##*foo}" assertEquals "Parameter expansion nothing trailing cut" "$var" "${var%foo}" assertEquals "Parameter expansion nothing trailing cut glob" "$var" "${var%%foo*}" } function test_parameter_expansion_replace { typeset var=abcdabcd assertEquals "Parameter expansion replace" cdabcd "${var/ab}" assertEquals "Parameter expansion replace ?" dabcd "${var/ab?}" assertEquals "Parameter expansion replace *" d "${var/a*c}" assertEquals "Parameter expansion replace all" cdcd "${var//ab}" assertEquals "Parameter expansion replace all ?" dd "${var//ab?}" assertEquals "Parameter expansion replace all *" d "${var//a*c}" assertEquals "Parameter expansion replace start" cdabcd "${var/#ab}" assertEquals "Parameter expansion replace start no match" $var "${var/#b}" assertEquals "Parameter expansion replace end" abcdab "${var/%cd}" assertEquals "Parameter expansion replace end no match" $var "${var/%c}" } function test_parameter_expansion_nested { typeset foo=bar assertEquals "Parameter expansion nested null" "bar" "${var:-$foo}" assertEquals "Parameter expansion nested unset" "bar" "${var-$foo}" assertEquals "Parameter expansion nested null quoted" "bar" "${var:-"$foo"}" assertEquals "Parameter expansion nested unset quoted" "bar" "${var-"$foo"}" assertEquals "Parameter expansion nested null brackets" "bar" "${var:-${foo}}" assertEquals "Parameter expansion nested unset brackets" "bar" "${var-${foo}}" } function test_substring { typeset var=abcdabcd assertEquals "Parameter expansion substring" "$var" "${var:0}" assertEquals "Parameter expansion substring" "bcdabcd" "${var:1}" assertEquals "Parameter expansion substring" "" "${var:0:0}" assertEquals "Parameter expansion substring" "a" "${var:0:1}" assertEquals "Parameter expansion substring" "ab" "${var:0:2}" assertEquals "Parameter expansion substring" "c" "${var:6:1}" assertEquals "Parameter expansion substring" "cd" "${var:6:2}" assertEquals "Parameter expansion substring" "cd" "${var:6:3}" assertEquals "Parameter expansion substring" "d" "${var:7:1}" assertEquals "Parameter expansion substring" "d" "${var:7:2}" assertEquals "Parameter expansion substring" "" "${var:8:1}" assertEquals "Parameter expansion substring" "d" "${var: -1:1}" assertEquals "Parameter expansion substring" "" "${var: -1:0}" assertEquals "Parameter expansion substring" "bcd" "${var: -3:5}" assertEquals "Parameter expansion substring" "bcd" "${var: -3}" # Negative second parameters were not supported until Bash 4.2 } function test_ansi_c_quoted_string { typeset newline=' ' assertEquals "ANSI C quoted newline" "$newline" $'\n' assertEquals "ANSI C quoted tab" " " $'\t' } function test_advanced_test { assertTrue "[[ -z empty var" '[[ -z ${var-} ]]' assertTrue "[[ -z empty var quoted" '[[ -z "${var-}" ]]' assertFalse "[[ -n empty var" '[[ -n ${var-} ]]' assertFalse "[[ -n empty var quoted" '[[ -n "${var-}" ]]' assertTrue "[[ -f" '[[ -f ./shunit2 ]]' assertFalse "[[ -f not a file" '[[ -f / ]]' assertTrue "[[ -r file" '[[ -r ./shunit2 ]]' assertTrue "[[ -r dir" '[[ -r / ]]' assertFalse "[[ -r locked file" '[[ -r /root ]]' assertTrue "[[ -w file" '[[ -w ./shunit2 ]]' assertFalse "[[ -w locked file" '[[ -w /root ]]' assertTrue "[[ -d dir" '[[ -d / ]]' assertFalse "[[ -d dir" '[[ -d ./shunit2 ]]' assertTrue "[[ =" '[[ 1 = 1 ]]' assertFalse "[[ =" '[[ 1 = 0 ]]' assertTrue "[[ ==" '[[ 1 == 1 ]]' assertFalse "[[ ==" '[[ 1 == 0 ]]' assertTrue "[[ !=" '[[ 1 != 0 ]]' assertFalse "[[ !=" '[[ 1 != 1 ]]' assertTrue "[[ == *" '[[ abcd == ab* ]]' assertFalse "[[ == *" '[[ abcd == ef* ]]' assertFalse "[[ == *" '[[ abcd == b* ]]' assertTrue "[[ == *" '[[ abcd == *b* ]]' assertFalse "[[ == *" '[[ abcd == *ef* ]]' assertTrue "[[ == *" '[[ abcd == * ]]' assertTrue "[[ == ?" '[[ abcd == abc? ]]' assertFalse "[[ == ?" '[[ abcd == ab? ]]' assertFalse "[[ == ?" '[[ abcd == ?b? ]]' assertTrue "[[ == ?" '[[ abcd == ???? ]]' assertFalse "[[ == ?" '[[ abcd == ? ]]' assertTrue "[[ == ?" '[[ abcd == ?* ]]' assertFalse "[[ == ?" '[[ "" == ? ]]' assertTrue "[[ -eq" '[[ 1 -eq 1 ]]' assertFalse "[[ -eq" '[[ 1 -eq 0 ]]' assertTrue "[[ -ne" '[[ 1 -ne 0 ]]' assertFalse "[[ -ne" '[[ 1 -ne 1 ]]' assertTrue "[[ &&" '[[ 1 -eq 1 && 0 -eq 0 ]]' assertFalse "[[ &&" '[[ 1 -eq 1 && 1 -eq 0 ]]' assertTrue "[[ ||" '[[ 1 -eq 1 || 1 -eq 1 ]]' assertTrue "[[ ||" '[[ 1 -eq 1 || 1 -eq 0 ]]' assertFalse "[[ ||" '[[ 0 -eq 1 || 1 -eq 0 ]]' assertTrue "[[ -gt" '[[ 1 -gt 0 ]]' assertFalse "[[ -gt" '[[ 1 -gt 1 ]]' assertFalse "[[ -gt" '[[ 1 -gt 2 ]]' assertTrue "[[ !" '[[ ! 1 == 0 ]]' assertFalse "[[ !" '[[ ! 1 == 1 ]]' } function test_echo { # Actually testing that echo -n doesn't print a newline is hard, since the # command substitution strips trailing newline chars. This test should be # enough, since if echo doesn't support the -n, it will print it literally assertEquals "echo -n was ignored as an option" "$(echo -n foo)" "$(echo foo)" } function test_printf { assertEquals "printf string" "test string" "$(printf 'test string')" assertEquals "printf string substitute" "test string" "$(printf %s 'test string')" assertEquals "printf literal escape" "\012" "$(printf %s '\012')" assertEquals "printf ignored extra arguments" "abc" "$(printf %s 'a' 'b' 'c')" assertEquals "printf ignored extra arguments" $'a\nb\nc' "$(printf '%s\n' 'a' 'b' 'c')" } function test_arithmetic_command { assertTrue "Command truthy" "(( 1 ))" assertFalse "Command falsey" "(( 0 ))" assertTrue "Command addition" "(( 1 + 1 ))" assertTrue "Command or" "(( 1 || 1 ))" assertTrue "Command or" "(( 1 || 0 ))" assertFalse "Command or" "(( 0 || 0 ))" assertTrue "Command and" "(( 1 && 1 ))" assertFalse "Command and" "(( 1 && 0 ))" assertTrue "Command nesting" "(( 1 || ( 1 && 1 ) ))" typeset a=2 assertTrue "Command equals" "(( a == 2 ))" assertFalse "Command equals false" "(( a == 1 ))" assertTrue "Command not equals" "(( a != 1 ))" assertFalse "Command not equals false" "(( a != 2 ))" assertTrue "Command equals with addition" "(( a = 1 + 1 ))" assertTrue "Command less than" "(( a < 3 ))" assertFalse "Command less than" "(( a < 2 ))" assertFalse "Command less than" "(( a < 1 ))" assertTrue "Command less than equal" "(( a <= 3 ))" assertTrue "Command less than equal" "(( a <= 2 ))" assertFalse "Command less than equal" "(( a <= 1 ))" assertTrue "Command greater than" "(( a > 1 ))" assertFalse "Command greater than" "(( a > 2 ))" assertFalse "Command greater than" "(( a > 3 ))" assertTrue "Command greater than equal" "(( a >= 1 ))" assertTrue "Command greater than equal" "(( a >= 2 ))" assertFalse "Command greater than equal" "(( a >= 3 ))" typeset b=1 assertTrue "Command true" "(( b ))" b=0 assertFalse "Command false" "(( b ))" (( b = 1 )) assertTrue "Command assignment true" $? assertEquals "Command assignment result" 1 $b (( b = 0 )) assertFalse "Command assignment false" $? assertEquals "Command assignment result" 0 $b assertTrue "Command negation" "(( ! 0 ))" assertFalse "Command negation" "(( ! 1 ))" } function test_integer { typeset -i int=1 assertTrue "Int equals" "(( int == 1 ))" assertFalse "Int equals" "(( int == 2 ))" assertTrue "Int true" "(( int ))" # This assignment returns 0, which evaluates as false (( int = 0 )) assertFalse "Int assignment" $? assertFalse "Int false" "(( int ))" int+=1 assertEquals "Int increment" 1 $int assertTrue "Int true" "(( int ))" int+=5 assertEquals "Int increment" 6 $int } function test_array { # Since some shells do index 1 based instead of 0 based, we need to keep # assumptions out of the code. If we assign an array with the array=(...) # notation, then we can only itterate over it, never access an element. # If we assign by index (array[idx]=...), then we can access by element, but # must make sure we never use index 0, often by adding 1 to all indexes used typeset -a array_a array_a=(foo foo foo) for item in "${array_a[@]}"; do assertEquals "array element" "foo" "$item" done typeset IFS=' ' assertEquals "whole array" "foo foo foo" "${array_a[*]}" assertEquals "size of array" 3 "${#array_a[@]}" typeset -a array_b array_b[1]=foo array_b[2]=bar array_b[5]=baz assertEquals "array index element" "foo" "${array_b[1]}" assertEquals "array index element" "bar" "${array_b[2]}" assertEquals "array index element" "baz" "${array_b[5]}" assertNull "null array index element" "${array_b[3]:+x}" } function test_source { file="${SHUNIT_TMPDIR}/sourced_file" printf '%s' 'foo=bar' > "$file" typeset foo source "$file" assertTrue "sourcing" $? assertEquals "sourced var" "bar" "$foo" rm "$file" } function test_command { assertTrue "sh command doesn't exist" 'command -v sh >/dev/null' assertFalse "no-command-foo-bar command exists, who would have thought" 'command -v no-command-foo-bar >/dev/null' } function test_dynamic_function_call { typeset foo=bar baz=qux function my_bar { : } function my_qux { false } assertTrue "called my_bar" 'my_$foo' assertFalse "called my_qux" 'my_$baz' unset -f my_bar my_qux } . ./shunit2 liquidprompt-2.2.1/tests/test_sysfs.sh000077500000000000000000000074341464055045500201740ustar00rootroot00000000000000# Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi # Load Linux version of _lp_battery() uname() { printf 'Linux'; } . ../liquidprompt --no-activate unset -f uname LP_ENABLE_BATT=1 _LP_BATTERY_FUNCTION=__lp_battery_sysfs LP_ENABLE_TEMP=1 _LP_TEMP_FUNCTION=__lp_temp_sysfs typeset -a battery_types battery_presents battery_status battery_capacities battery_out_statuses battery_values # Add test cases to these arrays like below # Empty ("") means file doesn't exist # Linux 5.11.0-38-generic #42~20.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux battery_types+=("Battery") battery_presents+=("1") battery_statuses+=("Discharging") battery_capacities+=("67") battery_out_statuses+=(0) battery_values+=("67") battery_scopes+=("") # Full, not charging battery_types+=("Battery") battery_presents+=("") battery_statuses+=("") battery_capacities+=("") battery_out_statuses+=(4) battery_values+=("") battery_scopes+=("System") # Not a battery battery_types+=("Mains") battery_presents+=("") battery_statuses+=("") battery_capacities+=("") battery_out_statuses+=(4) battery_values+=("") battery_scopes+=("") # Wrong type of battery (Wireless mouse, some other) battery_types+=("Battery") battery_presents+=("1") battery_statuses+=("") battery_capacities+=("0") battery_out_statuses+=(4) battery_values+=("") battery_scopes+=("Device") test_sysfs_battery() { _LP_LINUX_POWERSUPPLY_PATH="$SHUNIT_TMPDIR" for (( index=0; index < ${#battery_values[@]}; index++ )); do typeset power_supply="${_LP_LINUX_POWERSUPPLY_PATH}/${index}" mkdir "$power_supply" if [[ -n ${battery_types[index]-} ]]; then printf '%s\n' "${battery_types[index]}" > "${power_supply}/type" fi if [[ -n ${battery_presents[index]-} ]]; then printf '%s\n' "${battery_presents[index]}" > "${power_supply}/present" fi if [[ -n ${battery_statuses[index]-} ]]; then printf '%s\n' "${battery_statuses[index]}" > "${power_supply}/status" fi if [[ -n ${battery_capacities[index]-} ]]; then printf '%s\n' "${battery_capacities[index]}" > "${power_supply}/capacity" fi if [[ -n ${battery_scopes[index]} ]]; then printf '%s\n' "${battery_scopes[index]}" > "${power_supply}/scope" fi LP_BATTERY_THRESHOLD=100 _lp_battery assertEquals "sysfs battery below returns at index ${index}" "${battery_out_statuses[$index]}" "$?" assertEquals "sysfs battery value at index ${index}" "${battery_values[$index]}" "${lp_battery-}" _status=${battery_out_statuses[$index]} (( _status < 4 )) && _status=$(( _status + 1 )) LP_BATTERY_THRESHOLD=0 _lp_battery assertEquals "sysfs battery above returns at index ${index}" "$_status" "$?" assertEquals "sysfs battery value at index ${index}" "${battery_values[$index]}" "${lp_battery-}" # Must delete the "device", or liquidpropmt will find the first one again. rm -r "$power_supply" done } test_sysfs_temperature() { _LP_LINUX_TEMPERATURE_FILES=( "${SHUNIT_TMPDIR}/hwmon0_temp1_input" "${SHUNIT_TMPDIR}/hwmon1_temp1_input" "${SHUNIT_TMPDIR}/hwmon2_temp1_input" "${SHUNIT_TMPDIR}/thermal_zone0_temp" ) typeset -i i=0 printf '%s\n' 27000 > "${_LP_LINUX_TEMPERATURE_FILES[i++]}" printf '%s\n' 12000 > "${_LP_LINUX_TEMPERATURE_FILES[i++]}" printf '%s\n' 17000 > "${_LP_LINUX_TEMPERATURE_FILES[i++]}" printf '%s\n' 27000 > "${_LP_LINUX_TEMPERATURE_FILES[i++]}" LP_TEMP_THRESHOLD=100 _lp_temperature assertEquals "sysfs temperature below returns" 1 "$?" assertEquals "sysfs temperature value" 27 "${lp_temperature-}" LP_TEMP_THRESHOLD=0 _lp_temperature assertEquals "sysfs temperature above returns at index" 0 "$?" assertEquals "sysfs temperature value" 27 "${lp_temperature-}" } . ./shunit2 liquidprompt-2.2.1/tests/test_terminal_device.sh000066400000000000000000000020571464055045500221500ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ../liquidprompt --no-activate typeset -a tty_outputs values # Add test cases to these arrays like below # Linux 4.18.0-193.19.1.el8_2.x86_64 #1 SMP Mon Sep 14 14:37:00 UTC 2020 x86_64 GNU/Linux CentOS Linux release 8.2.2004 (Core) tty_outputs+=( "/dev/pts/0" ) values+=("0") # Darwin Kernel Version 18.7.0: Tue Nov 10 00:07:31 PST 2020; root:xnu-4903.278.51~1/RELEASE_X86_64 x86_64 i386 MacBookPro15,1 Darwin tty_outputs+=( "/dev/ttys135" ) values+=("ttys135") # Linux 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64 GNU/Linux Debian 9.13 (stretch) tty_outputs+=( "/dev/pts/75" ) values+=("75") function test_terminal_device { tty() { printf '%s\n' "$__tty_output" } for (( index=0; index < ${#values[@]}; index++ )); do __tty_output=${tty_outputs[$index]} _lp_terminal_device assertEquals "Terminal device basename at index ${index}" "${values[$index]}" "$lp_terminal_device" done } . ./shunit2 liquidprompt-2.2.1/tests/test_tools.sh000066400000000000000000000020411464055045500201470ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit fi LP_ROOT="${PWD%/tests}" SSH_CONNECTION="1.2.3.4 111 5.6.7.8 222" function setUp { cd "$LP_ROOT" } function test_theme_preview { # This does not really test the tool, just verify that it does not error. . ./tools/theme-preview.sh default . ./tools/theme-preview.sh powerline ./themes/powerline/powerline.theme . ./tools/theme-preview.sh powerline_full ./themes/powerline/powerline.theme . ./tools/theme-preview.sh alternate_vcs ./themes/alternate_vcs/alternate_vcs.theme . ./tools/theme-preview.sh unfold ./themes/unfold/unfold.theme --reproducible . ./tools/theme-preview.sh unfold ./themes/unfold/unfold.theme --config-file contrib/presets/colors/256-colors-dark.conf . ./tools/theme-preview.sh --template-file=templates/minimal/minimal.ps1 } function test_external_tool_tester { . ./tools/external-tool-tester.sh >/dev/null } function test_config_from_doc { . ./tools/config-from-doc.sh >/dev/null } . ./shunit2 liquidprompt-2.2.1/tests/test_utils.sh000066400000000000000000001010101464055045500201430ustar00rootroot00000000000000 # Error on unset variables set -u if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit fi . ../liquidprompt --no-activate function test_strip_escape { typeset ret # The escape sequences are different on Bash and Zsh __lp_strip_escapes "${_LP_OPEN_ESC}bad text${_LP_CLOSE_ESC}a normal string without ${_LP_OPEN_ESC}color${_LP_CLOSE_ESC}colors" assertEquals "basic text removal" "a normal string without colors" "$ret" __lp_strip_escapes "${_LP_OPEN_ESC}"$'\a\b'"${_LP_CLOSE_ESC}str${_LP_OPEN_ESC}"$'\001\E'"${_LP_CLOSE_ESC}ing" assertEquals "control character internal removal" "string" "$ret" __lp_strip_escapes "${_LP_OPEN_ESC}"$'\a\b'"${_LP_CLOSE_ESC}st"$'\t'"r${_LP_OPEN_ESC}"$'\001\E'"${_LP_CLOSE_ESC}ing" assertEquals "control character external removal" $'st\tring' "$ret" __lp_strip_escapes "${_LP_OPEN_ESC}"$'\a\b'"${_LP_CLOSE_ESC}st\\\\r${_LP_OPEN_ESC}"$'\001\E'"${_LP_CLOSE_ESC}ing" assertEquals "control character escaped removal" $'st\\ring' "$ret" } function test_line_count { typeset test_string="a normal string" __lp_line_count "$test_string" assertEquals "normal 1 line string" $(printf %s "$test_string" | wc -l) $count test_string="\ a longer string" __lp_line_count "$test_string" assertEquals "3 line string" $(printf %s "$test_string" | wc -l) $count test_string="\ a longer string with many consecutive breaks" __lp_line_count "$test_string" assertEquals "consecutive blank lines string" $(printf %s "$test_string" | wc -l) $count test_string="" __lp_line_count "$test_string" assertEquals "null string" $(printf %s "$test_string" | wc -l) $count } function test_floating_scale { typeset ret __lp_floating_scale '1.23' 100 assertEquals "scaling 100" '123' "$ret" __lp_floating_scale '1.00' 100 assertEquals "scaling 100" '100' "$ret" __lp_floating_scale '1.' 100 assertEquals "scaling 100" '100' "$ret" __lp_floating_scale '1' 100 assertEquals "scaling 100" '100' "$ret" __lp_floating_scale '.01' 100 assertEquals "scaling 100" '1' "$ret" __lp_floating_scale '.01' 100 assertEquals "scaling 100" '1' "$ret" __lp_floating_scale '.10' 100 assertEquals "scaling 100" '10' "$ret" __lp_floating_scale '.1' 100 assertEquals "scaling 100" '10' "$ret" __lp_floating_scale '.001' 100 assertEquals "scaling 100" '0' "$ret" __lp_floating_scale '1000001.001' 100 assertEquals "scaling 100" '100000100' "$ret" __lp_floating_scale '11.1' 1000 assertEquals "scaling 1000" '11100' "$ret" __lp_floating_scale '12.3' 1 assertEquals "scaling 1" '12' "$ret" __lp_floating_scale '12.3' 10 assertEquals "scaling 10" '123' "$ret" __lp_floating_scale '12.34' 10 assertEquals "scaling 10" '123' "$ret" __lp_floating_scale '12.345' 10 assertEquals "scaling 10" '123' "$ret" } function test_get_last_command_line() { if (( _LP_SHELL_zsh )); then # This is simpler, and only shows one test as skipped instead of per assert. startSkipping assertTrue '' endSkipping return fi builtin() { printf '%s\n' "$history_line" } typeset command history_line=' 100 command' __lp_get_last_command_line assertEquals "normal history" 'command' "$command" history_line='1000 a command' __lp_get_last_command_line assertEquals "no leading space" 'a command' "$command" history_line=' 0 a different command' __lp_get_last_command_line assertEquals "single digit index" 'a different command' "$command" history_line=' 119* a modified command' __lp_get_last_command_line assertEquals "modified history" 'a modified command' "$command" unset -f builtin } function test_pwd_tilde { typeset HOME="/home/user" typeset PWD="/a/test/path" __lp_pwd_tilde assertEquals "unchanged path" "$PWD" "$lp_pwd_tilde" PWD="/home/user/a/test/path" __lp_pwd_tilde assertEquals "shorted home path" "~/a/test/path" "$lp_pwd_tilde" __lp_pwd_tilde "/home/user/a/different/path" assertEquals "shorted home path" "~/a/different/path" "$lp_pwd_tilde" } function pathSetUp { # We cannot use SHUNIT_TMPDIR because we need to know the start of the path typeset long_path="/tmp/_lp/a/very/long/pathname" mkdir -p "${long_path}/" "${long_path/name/foo}/" } function pathTearDown { rm -r "/tmp/_lp/" } function test_get_unique_directory { pathSetUp typeset lp_unique_directory __lp_get_unique_directory "/" assertFalse "No shortening on '/'" "$?" __lp_get_unique_directory "~" assertFalse "No shortening on '~'" "$?" __lp_get_unique_directory "/tmp/_lp/a" assertFalse "No shortening on 'a'" "$?" __lp_get_unique_directory "/tmp/_lp/a/very" assertTrue "Shortening on 'very'" "$?" assertEquals "Shortening on 'very'" "v" "$lp_unique_directory" __lp_get_unique_directory "/tmp/_lp/a/very/long/pathname" assertTrue "Partial shortening on 'pathname'" "$?" assertEquals "Partial shortening on 'pathname'" "pathn" "$lp_unique_directory" pathTearDown } function test_path_format_from_path_left() { typeset HOME="/home/user" typeset PWD="/" LP_ENABLE_PATH=1 _lp_find_vcs() { return 1 } LP_ENABLE_SHORTEN_PATH=1 LP_ENABLE_HYPERLINKS=0 typeset COLUMNS=100 LP_PATH_LENGTH=100 LP_PATH_KEEP=0 LP_PATH_VCS_ROOT=1 LP_PATH_METHOD=truncate_chars_from_path_left LP_MARK_SHORTEN_PATH="..." typeset lp_path lp_path_format _lp_path_format '{format}' assertEquals "root directory" '/' "$lp_path" assertEquals "root directory formatting" '{format}/' "$lp_path_format" _lp_path_format '{format}' '' '' '' '[' assertEquals "root directory ignore separator" '/' "$lp_path" assertEquals "root directory formatting ignore separator" '{format}/' "$lp_path_format" PWD="/tmp" _lp_path_format '' assertEquals "tmp directory" '/tmp' "$lp_path" assertEquals "tmp directory no formatting" '/tmp' "$lp_path_format" _lp_path_format '' '' '' '' '^' assertEquals "tmp directory no custom separator" '/tmp' "$lp_path" assertEquals "tmp directory no formatting custom separator" '/^tmp' "$lp_path_format" PWD=$HOME _lp_path_format '{format}' assertEquals "home directory" '~' "$lp_path" assertEquals "home directory formatting" '{format}~' "$lp_path_format" PWD="/tmp/_lp/a" _lp_path_format '' assertEquals "short directory" "$PWD" "$lp_path" assertEquals "short directory formatting" "$PWD" "$lp_path_format" LP_PATH_LENGTH=1 PWD="/tmp/_lp/a/very" _lp_path_format '' assertEquals "short directory" ".../very" "$lp_path" assertEquals "short directory formatting" ".../very" "$lp_path_format" _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "shortened directory" ".../very" "$lp_path" assertEquals "shortened directory formatting" "{s}.../{l}very" "$lp_path_format" LP_PATH_LENGTH=13 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "medium directory" ".../_lp/a/very" "$lp_path" assertEquals "medium directory formatting" "{s}.../{n}_lp/{n}a/{l}very" "$lp_path_format" LP_PATH_KEEP=2 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "medium directory" "/tmp/.../very" "$lp_path" assertEquals "medium directory formatting" "{n}/{n}tmp/{s}.../{l}very" "$lp_path_format" LP_PATH_KEEP=3 # Don't shorten if it would make longer _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "medium directory" "/tmp/_lp/a/very" "$lp_path" assertEquals "medium directory formatting" "{n}/{n}tmp/{n}_lp/{n}a/{l}very" "$lp_path_format" _lp_find_vcs() { lp_vcs_root="/tmp/_lp/a/very" } LP_PATH_KEEP=0 PWD="/tmp/_lp/a/very/long/pathname" _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory" ".../very/.../pathname" "$lp_path" assertEquals "full directory formatting" "{s}.../{v}very/{s}.../{l}pathname" "$lp_path_format" _lp_path_format '{n}' '{l}' '{v}' '{s}' '^' '{^}' assertEquals "full directory with separator" ".../very/.../pathname" "$lp_path" assertEquals "full directory formatting with separator" "{s}...{^}^{v}very{^}^{s}...{^}^{l}pathname" "$lp_path_format" _lp_path_format '{n}' '{l}' '{v}' '{s}' '///' assertEquals "full directory with multichar separator" ".../very/.../pathname" "$lp_path" assertEquals "full directory formatting with multichar separator" "{s}...///{v}very///{s}...///{l}pathname" "$lp_path_format" LP_PATH_KEEP=2 PWD="/tmp/averylong/superduperlong/obviouslytoolong/dir" LP_PATH_LENGTH=30 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory formatting length $LP_PATH_LENGTH" "{n}/{n}tmp/{s}...g/{n}obviouslytoolong/{l}dir" "$lp_path_format" LP_PATH_LENGTH=29 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory formatting length $LP_PATH_LENGTH" "{n}/{n}tmp/{s}.../{n}obviouslytoolong/{l}dir" "$lp_path_format" LP_PATH_LENGTH=28 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory formatting length $LP_PATH_LENGTH" "{n}/{n}tmp/{s}...obviouslytoolong/{l}dir" "$lp_path_format" LP_PATH_LENGTH=27 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory formatting length $LP_PATH_LENGTH" "{n}/{n}tmp/{s}...bviouslytoolong/{l}dir" "$lp_path_format" PWD="/tmp/a/bc/last" LP_PATH_LENGTH=$(( ${#PWD} - 1 )) _lp_path_format '' assertEquals "2 short dirs shortening" "/tmp/.../last" "$lp_path_format" PWD="/tmp/a/b/last" LP_PATH_LENGTH=$(( ${#PWD} - 1 )) _lp_path_format '' assertEquals "2 short dirs no shortening" "/tmp/a/b/last" "$lp_path_format" PWD="/tmp/a/b/c/last" LP_PATH_LENGTH=$(( ${#PWD} - 1 )) _lp_path_format '' assertEquals "3 short dirs shortening" "/tmp/...c/last" "$lp_path_format" LP_PATH_LENGTH=${#PWD} _lp_path_format '' assertEquals "3 short dirs no shortening" "/tmp/a/b/c/last" "$lp_path_format" _lp_find_vcs() { lp_vcs_root="/tmp/a/b" } LP_PATH_LENGTH=$(( ${#PWD} - 1 )) _lp_path_format '' assertEquals "no shortening" "/tmp/a/b/c/last" "$lp_path_format" PWD=$'/a_fake_\\n_newline/and_%100_fresh/and_a_real_\n_newline' LP_PATH_LENGTH=${#PWD} _lp_path_format '' if (( _LP_SHELL_zsh )); then assertEquals "shell escapes" $'/a_fake_\\n_newline/and_%100_fresh/and_a_real_\n_newline' "$lp_path" assertEquals "shell escapes format" $'/a_fake_\\\\n_newline/and_%%100_fresh/and_a_real_\n_newline' "$lp_path_format" else assertEquals "shell escapes" $'/a_fake_\\n_newline/and_%100_fresh/and_a_real_\n_newline' "$lp_path" assertEquals "shell escapes format" $'/a_fake_\\\\n_newline/and_%100_fresh/and_a_real_\n_newline' "$lp_path_format" fi } function test_path_format_from_dir_right { typeset HOME="/home/user" typeset PWD="/" LP_ENABLE_PATH=1 _lp_find_vcs() { return 1 } LP_ENABLE_SHORTEN_PATH=1 LP_ENABLE_HYPERLINKS=0 typeset COLUMNS=100 LP_PATH_LENGTH=100 LP_PATH_KEEP=0 LP_PATH_VCS_ROOT=1 LP_PATH_METHOD=truncate_chars_from_dir_right LP_MARK_SHORTEN_PATH="..." LP_PATH_CHARACTER_KEEP=1 typeset lp_path lp_path_format _lp_path_format '{format}' assertEquals "root directory" '/' "$lp_path" assertEquals "root directory formatting" '{format}/' "$lp_path_format" _lp_path_format '{format}' '' '' '' '[' assertEquals "root directory ignore separator" '/' "$lp_path" assertEquals "root directory formatting ignore separator" '{format}/' "$lp_path_format" PWD="/tmp" _lp_path_format '' assertEquals "tmp directory" '/tmp' "$lp_path" assertEquals "tmp directory no formatting" '/tmp' "$lp_path_format" _lp_path_format '' '' '' '' '^' assertEquals "tmp directory custom separator" '/tmp' "$lp_path" assertEquals "tmp directory no formatting custom separator" '/^tmp' "$lp_path_format" PWD=$HOME _lp_path_format '{format}' assertEquals "home directory" '~' "$lp_path" assertEquals "home directory formatting" '{format}~' "$lp_path_format" PWD="/tmp/_lp/a" _lp_path_format '' assertEquals "short directory" "$PWD" "$lp_path" assertEquals "short directory formatting" "$PWD" "$lp_path_format" LP_PATH_LENGTH=1 PWD="/tmp/_lp/a/very" _lp_path_format '' assertEquals "short directory" "$PWD" "$lp_path" assertEquals "short directory formatting" "$PWD" "$lp_path_format" PWD="/avery/muchlong/pathname" _lp_path_format '' assertEquals "short directory formatting" "/a.../m.../pathname" "$lp_path_format" LP_PATH_LENGTH=$(( ${#PWD} - 1 )) _lp_path_format '' assertEquals "medium directory formatting" "/a.../muchlong/pathname" "$lp_path_format" LP_PATH_KEEP=2 _lp_path_format '' assertEquals "medium directory formatting" "/avery/m.../pathname" "$lp_path_format" _lp_find_vcs() { lp_vcs_root="/tmp/_lp/a/very" } LP_PATH_KEEP=0 LP_MARK_SHORTEN_PATH="." PWD="/tmp/_lp/a/very/long/pathname" _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory" "/t./_./a/very/l./pathname" "$lp_path" assertEquals "full directory formatting" "{n}/{s}t./{s}_./{n}a/{v}very/{s}l./{l}pathname" "$lp_path_format" _lp_path_format '{n}' '{l}' '{v}' '{s}' '///' assertEquals "full directory with multichar separator" "/t./_./a/very/l./pathname" "$lp_path" assertEquals "full directory formatting with multichar separator" "{n}////{s}t.///{s}_.///{n}a///{v}very///{s}l.///{l}pathname" "$lp_path_format" LP_PATH_KEEP=2 PWD="/tmp/averylong/superduperlong/obviouslytoolong/dir" LP_PATH_LENGTH=31 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory length $LP_PATH_LENGTH" "/tmp/a./s./obviouslytoolong/dir" "$lp_path" assertEquals "full directory formatting length $LP_PATH_LENGTH" "{n}/{n}tmp/{s}a./{s}s./{n}obviouslytoolong/{l}dir" "$lp_path_format" LP_PATH_LENGTH=30 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory length $LP_PATH_LENGTH" "/tmp/a./s./o./dir" "$lp_path" assertEquals "full directory formatting length $LP_PATH_LENGTH" "{n}/{n}tmp/{s}a./{s}s./{s}o./{l}dir" "$lp_path_format" } function test_path_format_from_dir_middle { typeset HOME="/home/user" typeset PWD="/" _lp_find_vcs() { return 1 } LP_ENABLE_PATH=1 LP_ENABLE_SHORTEN_PATH=1 LP_ENABLE_HYPERLINKS=0 typeset COLUMNS=100 LP_PATH_LENGTH=100 LP_PATH_KEEP=0 LP_PATH_VCS_ROOT=1 LP_PATH_METHOD=truncate_chars_from_dir_middle LP_MARK_SHORTEN_PATH="..." LP_PATH_CHARACTER_KEEP=1 typeset lp_path lp_path_format _lp_path_format '{format}' assertEquals "root directory" '/' "$lp_path" assertEquals "root directory formatting" '{format}/' "$lp_path_format" _lp_path_format '{format}' '' '' '' '[' assertEquals "root directory ignore separator" '/' "$lp_path" assertEquals "root directory formatting ignore separator" '{format}/' "$lp_path_format" PWD="/tmp" _lp_path_format '' assertEquals "tmp directory" '/tmp' "$lp_path" assertEquals "tmp directory no formatting" '/tmp' "$lp_path_format" _lp_path_format '' '' '' '' '^' assertEquals "tmp directory custom separator" '/tmp' "$lp_path" assertEquals "tmp directory no formatting custom separator" '/^tmp' "$lp_path_format" PWD=$HOME _lp_path_format '{format}' assertEquals "home directory" '~' "$lp_path" assertEquals "home directory formatting" '{format}~' "$lp_path_format" PWD="/tmp/_lp/a" _lp_path_format '' assertEquals "short directory" "$PWD" "$lp_path" assertEquals "short directory formatting" "$PWD" "$lp_path_format" LP_PATH_LENGTH=1 PWD="/tmp/_lp/a/very" _lp_path_format '' assertEquals "short directory" "$PWD" "$lp_path" assertEquals "short directory formatting" "$PWD" "$lp_path_format" PWD="/avery/muchlong/pathname" _lp_path_format '' assertEquals "short directory" "/avery/m...g/pathname" "$lp_path" assertEquals "short directory formatting" "/avery/m...g/pathname" "$lp_path_format" LP_MARK_SHORTEN_PATH="." PWD="/avery/muchlong/pathname" _lp_path_format '' assertEquals "short directory" "/a.y/m.g/pathname" "$lp_path" assertEquals "short directory formatting" "/a.y/m.g/pathname" "$lp_path_format" LP_PATH_LENGTH=$(( ${#PWD} - 1 )) _lp_path_format '' assertEquals "medium directory" "/a.y/muchlong/pathname" "$lp_path" assertEquals "medium directory formatting" "/a.y/muchlong/pathname" "$lp_path_format" LP_PATH_KEEP=2 _lp_path_format '' assertEquals "medium directory" "/avery/m.g/pathname" "$lp_path" assertEquals "medium directory formatting" "/avery/m.g/pathname" "$lp_path_format" _lp_find_vcs() { lp_vcs_root="/tmp/_lp/a/very" } LP_PATH_KEEP=0 PWD="/tmp/_lp/a/very/long/pathname" _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory" "/tmp/_lp/a/very/l.g/pathname" "$lp_path" assertEquals "full directory formatting" "{n}/{n}tmp/{n}_lp/{n}a/{v}very/{s}l.g/{l}pathname" "$lp_path_format" _lp_path_format '{n}' '{l}' '{v}' '{s}' '///' assertEquals "full directory with multichar separator" "/tmp/_lp/a/very/l.g/pathname" "$lp_path" assertEquals "full directory formatting with multichar separator" "{n}////{n}tmp///{n}_lp///{n}a///{v}very///{s}l.g///{l}pathname" "$lp_path_format" LP_PATH_KEEP=2 PWD="/tmp/averylong/superduperlong/obviouslytoolong/dir" LP_PATH_LENGTH=33 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory length $LP_PATH_LENGTH" "/tmp/a.g/s.g/obviouslytoolong/dir" "$lp_path" assertEquals "full directory formatting length $LP_PATH_LENGTH" "{n}/{n}tmp/{s}a.g/{s}s.g/{n}obviouslytoolong/{l}dir" "$lp_path_format" LP_PATH_LENGTH=32 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory length $LP_PATH_LENGTH" "/tmp/a.g/s.g/o.g/dir" "$lp_path" assertEquals "full directory formatting length $LP_PATH_LENGTH" "{n}/{n}tmp/{s}a.g/{s}s.g/{s}o.g/{l}dir" "$lp_path_format" } function test_path_format_unique() { pathSetUp typeset HOME="/home/user" typeset PWD="/" _lp_find_vcs() { return 1 } LP_ENABLE_PATH=1 LP_ENABLE_SHORTEN_PATH=1 LP_ENABLE_HYPERLINKS=0 typeset COLUMNS=100 LP_PATH_LENGTH=100 LP_PATH_KEEP=0 LP_PATH_VCS_ROOT=1 LP_PATH_METHOD=truncate_chars_to_unique_dir typeset lp_path lp_path_format _lp_path_format '{format}' assertEquals "root directory" '/' "$lp_path" assertEquals "root directory formatting" '{format}/' "$lp_path_format" _lp_path_format '{format}' '' '' '' '[' assertEquals "root directory ignore separator" '/' "$lp_path" assertEquals "root directory formatting ignore separator" '{format}/' "$lp_path_format" PWD="/tmp" _lp_path_format '' assertEquals "tmp directory" '/tmp' "$lp_path" assertEquals "tmp directory no formatting" '/tmp' "$lp_path_format" _lp_path_format '' '' '' '' '^' assertEquals "tmp directory custom separator" '/tmp' "$lp_path" assertEquals "tmp directory no formatting custom separator" '/^tmp' "$lp_path_format" PWD=$HOME _lp_path_format '{format}' assertEquals "home directory" '~' "$lp_path" assertEquals "home directory formatting" '{format}~' "$lp_path_format" PWD="/tmp/_lp/a" _lp_path_format '' assertEquals "short directory" "$PWD" "$lp_path" assertEquals "short directory formatting" "$PWD" "$lp_path_format" LP_PATH_LENGTH=13 PWD="/tmp/_lp/a/very" _lp_path_format '' assertEquals "short directory" "/t/_lp/a/very" "$lp_path" assertEquals "short directory formatting" "/t/_lp/a/very" "$lp_path_format" LP_PATH_LENGTH=1 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "shortened directory" "/t/_/a/very" "$lp_path" assertEquals "shortened directory formatting" "{n}/{s}t/{s}_/{n}a/{l}very" "$lp_path_format" LP_PATH_LENGTH=13 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "medium directory" "/t/_lp/a/very" "$lp_path" assertEquals "medium directory formatting" "{n}/{s}t/{n}_lp/{n}a/{l}very" "$lp_path_format" LP_PATH_KEEP=2 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "medium directory" "/tmp/_/a/very" "$lp_path" assertEquals "medium directory formatting" "{n}/{n}tmp/{s}_/{n}a/{l}very" "$lp_path_format" LP_PATH_KEEP=3 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "medium directory" "/tmp/_lp/a/very" "$lp_path" assertEquals "medium directory formatting" "{n}/{n}tmp/{n}_lp/{n}a/{l}very" "$lp_path_format" _lp_find_vcs() { lp_vcs_root="/tmp/_lp/a/very" } LP_PATH_KEEP=0 PWD="/tmp/_lp/a/very/long/pathname" _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory " "/t/_/a/very/l/pathname" "$lp_path" assertEquals "full directory formatting" "{n}/{s}t/{s}_/{n}a/{v}very/{s}l/{l}pathname" "$lp_path_format" _lp_path_format '{n}' '{l}' '{v}' '{s}' '^' '{^}' assertEquals "full directory with separator" "/t/_/a/very/l/pathname" "$lp_path" assertEquals "full directory formatting with separator" "{n}/{^}^{s}t{^}^{s}_{^}^{n}a{^}^{v}very{^}^{s}l{^}^{l}pathname" "$lp_path_format" _lp_path_format '{n}' '{l}' '{v}' '{s}' '///' assertEquals "full directory with multichar separator" "/t/_/a/very/l/pathname" "$lp_path" assertEquals "full directory formatting with multichar separator" "{n}////{s}t///{s}_///{n}a///{v}very///{s}l///{l}pathname" "$lp_path_format" pathTearDown } function test_path_format_last_dir() { typeset HOME="/home/user" typeset PWD="/" _lp_find_vcs() { return 1 } LP_ENABLE_PATH=1 LP_ENABLE_SHORTEN_PATH=1 LP_ENABLE_HYPERLINKS=0 LP_PATH_VCS_ROOT=1 LP_PATH_METHOD=truncate_to_last_dir typeset lp_path lp_path_format _lp_path_format '{format}' assertEquals "root directory" '/' "$lp_path" assertEquals "root directory formatting" '{format}/' "$lp_path_format" _lp_path_format '{format}' '' '' '' '[' assertEquals "root directory ignore separator" '/' "$lp_path" assertEquals "root directory formatting ignore separator" '{format}/' "$lp_path_format" PWD="/tmp" _lp_path_format '' assertEquals "tmp directory" 'tmp' "$lp_path" assertEquals "tmp directory no formatting" 'tmp' "$lp_path_format" _lp_path_format '' '' '' '' '^' assertEquals "tmp directory no custom separator" 'tmp' "$lp_path" assertEquals "tmp directory no formatting custom separator" 'tmp' "$lp_path_format" PWD=$HOME _lp_path_format '{format}' assertEquals "home directory" '~' "$lp_path" assertEquals "home directory formatting" '{format}~' "$lp_path_format" PWD="/tmp/_lp/a" _lp_path_format '' assertEquals "short directory" "a" "$lp_path" assertEquals "short directory formatting" "a" "$lp_path_format" PWD="/tmp/_lp/a/very" _lp_path_format '' assertEquals "short directory" "very" "$lp_path" assertEquals "short directory formatting" "very" "$lp_path_format" _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "shortened directory" "very" "$lp_path" assertEquals "shortened directory formatting" "{l}very" "$lp_path_format" _lp_find_vcs() { lp_vcs_root="$PWD" } PWD="/tmp/_lp/a/very" _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory vcs" "very" "$lp_path" assertEquals "full directory vcs formatting" "{v}very" "$lp_path_format" LP_PATH_VCS_ROOT=0 _lp_path_format '{n}' '{l}' '{v}' '{s}' assertEquals "full directory" "very" "$lp_path" assertEquals "full directory formatting" "{l}very" "$lp_path_format" PWD="/tmp/_lp/a/very/long/pathname" _lp_path_format '{n}' '{l}' '{v}' '{s}' '^' '{^}' assertEquals "full directory with separator" "pathname" "$lp_path" assertEquals "full directory formatting with separator" "{l}pathname" "$lp_path_format" _lp_path_format '{n}' '{l}' '{v}' '{s}' '///' assertEquals "full directory with multichar separator" "pathname" "$lp_path" assertEquals "full directory formatting with multichar separator" "{l}pathname" "$lp_path_format" } function test_no_path_format() { typeset HOME="/home/user" typeset PWD="/" LP_ENABLE_PATH=0 _lp_path_format '{format}' assertEquals "$?" "2" } function test_path_links() { typeset HOME="/home/user" typeset PWD="/" typeset SSH_CONNECTION="1.2.3.4 111 5.6.7.8 222" _lp_find_vcs() { return 1 } LP_ENABLE_PATH=1 LP_ENABLE_SHORTEN_PATH=0 LP_ENABLE_HYPERLINKS=0 LP_PATH_VCS_ROOT=1 typeset lp_path lp_path_format _lp_path_format '{format}' assertEquals "root directory" '/' "$lp_path" assertContains "root directory formatting" "$lp_path_format" '{format}/' LP_ENABLE_HYPERLINKS=1 typeset url="https://test.io/" typeset label="liquid link" typeset expected_link="$_LP_OPEN_ESC"$'\E]8;;'"${url}"$'\E'"${_LP_BACKSLASH}${_LP_CLOSE_ESC}${label}${_LP_OPEN_ESC}"$'\E]8;;\E'"${_LP_BACKSLASH}$_LP_CLOSE_ESC" _lp_create_link "$url" "$label" assertEquals "typical OSC-8 escape sequence" "$expected_link" "$lp_link" url="https://testé.io/?var=1&dbg=2" label="liquid\tlink" expected_link="$_LP_OPEN_ESC"$'\E]8;;'"${url}"$'\E'"${_LP_BACKSLASH}${_LP_CLOSE_ESC}${label}${_LP_OPEN_ESC}"$'\E]8;;\E'"${_LP_BACKSLASH}$_LP_CLOSE_ESC" _lp_create_link "$url" "$label" assertEquals "typical OSC-8 escape sequence with complex text" "$expected_link" "$lp_link" typeset pathword="home" typeset PWD="/home/nojhan" typeset USER="nojhan" typeset SSH_CLIENT="ssh" typeset expected_url="sftp://$USER@5.6.7.8:111/$PWD/" expected_link="$_LP_OPEN_ESC"$'\E]8;;'"${expected_url}"$'\E'"${_LP_BACKSLASH}${_LP_CLOSE_ESC}home${_LP_OPEN_ESC}"$'\E]8;;\E'"${_LP_BACKSLASH}$_LP_CLOSE_ESC" _lp_create_link_path "$pathword" assertEquals "SSH: path element linked to SFTP" "$expected_link" "$lp_link_path" unset SSH_CLIENT SSH2_CLIENT SSH_TTY ps() { printf "su" } typeset expected_url="file://$PWD/" expected_link="$_LP_OPEN_ESC"$'\E]8;;'"${expected_url}"$'\E'"${_LP_BACKSLASH}${_LP_CLOSE_ESC}home${_LP_OPEN_ESC}"$'\E]8;;\E'"${_LP_BACKSLASH}$_LP_CLOSE_ESC" _lp_create_link_path "$pathword" assertEquals "su: path element linked to FILE" "$expected_link" "$lp_link_path" typeset REMOTEHOST="spongebob" _lp_create_link_path "$pathword" assertEquals "telnet: path element not linked" "$pathword" "$lp_link_path" } function test_lp_fill { typeset lp_fill COLUMNS=80 _lp_fill "Left" "Right" " " assertEquals "full width" 80 ${#lp_fill} COLUMNS=3 _lp_fill "L" "R" "-" assertEquals "single fill" "L-R" "$lp_fill" _lp_fill "L" "R" "" assertEquals "defaults to space" "L R" "$lp_fill" COLUMNS=5 _lp_fill "L" "R" "~" assertEquals "simple fill 5" "L~~~R" "$lp_fill" COLUMNS=6 _lp_fill "L" "R" "+-" assertEquals "multi-fill 6" "L+-+-R" "$lp_fill" _lp_fill "L" "R" "123" 1 assertEquals "multi-fill 6 split" "L1231R" "$lp_fill" _lp_fill "L${_LP_OPEN_ESC}${_LP_CLOSE_ESC}" "R" "123" 0 assertEquals "multi-fill 6 with escape and no split" "L${_LP_OPEN_ESC}${_LP_CLOSE_ESC}123 R" "$lp_fill" _lp_fill "L${_LP_OPEN_ESC}${_LP_CLOSE_ESC}" "${_LP_OPEN_ESC}${_LP_CLOSE_ESC}R" "123" 0 assertEquals "multi-fill 6 with double escapes and no split" "L${_LP_OPEN_ESC}${_LP_CLOSE_ESC}123 ${_LP_OPEN_ESC}${_LP_CLOSE_ESC}R" "$lp_fill" _lp_fill "L" "R" "${_LP_OPEN_ESC}${_LP_CLOSE_ESC}123" 1 assertEquals "multi-fill 6 with wrong escape and split" "L1231R" "$lp_fill" _lp_fill "L${_LP_OPEN_ESC}${_LP_CLOSE_ESC}" "R" "123" 1 assertEquals "multi-fill 6 with escape and split" "L${_LP_OPEN_ESC}${_LP_CLOSE_ESC}1231R" "$lp_fill" _lp_fill "L" "R" "${_LP_OPEN_ESC}${_LP_CLOSE_ESC}123${_LP_OPEN_ESC}${_LP_CLOSE_ESC}" 1 assertEquals "multi-fill 6 with double escapes and split" "L1231R" "$lp_fill" COLUMNS=11 _lp_fill "Left" "Right" "=" assertEquals "regular fill 11" "Left==Right" "$lp_fill" _lp_fill "Le" "Ri" "+-" assertEquals "multi-fill 11 split default" "Le+-+-+-+Ri" "$lp_fill" _lp_fill "Le" "Ri" "+-" 0 assertEquals "multi-fill 11 no split" "Le+-+-+- Ri" "$lp_fill" _lp_fill "Le" "Ri" "+-" 1 assertEquals "multi-fill 11 explicit split" "Le+-+-+-+Ri" "$lp_fill" _lp_fill "Le" "Ri" "123" 1 assertEquals "multi-fill 11 with split" "Le1231231Ri" "$lp_fill" _lp_fill "Le${_LP_OPEN_ESC}${_LP_CLOSE_ESC}" "Ri" "123" 0 assertEquals "multi-fill 11 with escape and no split" "Le${_LP_OPEN_ESC}${_LP_CLOSE_ESC}123123 Ri" "$lp_fill" _lp_fill "Le${_LP_OPEN_ESC}${_LP_CLOSE_ESC}" "Ri" "123${_LP_OPEN_ESC}${_LP_CLOSE_ESC}" 1 assertEquals "multi-fill 11 with double escape and split" "Le${_LP_OPEN_ESC}${_LP_CLOSE_ESC}1231231Ri" "$lp_fill" # The following tests require a UTF-8 locale to be set. # The Windows runners have issues with these Unicode characters. if [[ ! ( ${LC_CTYPE-} == *UTF-8 || ${LANG-} == *UTF-8 || ${LC_ALL-} == *UTF-8 ) \ || ${RUNNER_OS-} == "Windows" ]]; then # Skip all the following tests. startSkipping fi COLUMNS=32 _lp_fill "Left part·" "·right part" "⣀⠔⠉⠢" 1 assertEquals "beautiful fill" "Left part·⣀⠔⠉⠢⣀⠔⠉⠢⣀⠔⠉·right part" "$lp_fill" } function test_is_function { function my_function { :; } # Ignore errors, we just really need this to not be a function unset -f not_my_function >/dev/null 2>&1 || true assertTrue "failed to find valid function" '__lp_is_function my_function' assertFalse "claimed to find non-existent function" '__lp_is_function not_my_function' alias not_my_function=my_function assertFalse "claimed alias was a function" '__lp_is_function not_my_function' unset -f my_function unalias not_my_function } function test_hash_color { PS1="$ " lp_activate --no-config # For having _lp_foreground _lp_hash_color "Debug" assertContains "$lp_hash_color" "Debug" # FIXME How to test color? } function test_join { _lp_join "_" "A" "B " " " " C" " D " "EE" assertEquals "A_B _ _ C_ D _EE" "$lp_join" _lp_join "-" "A" assertEquals "A" "$lp_join" _lp_join "+" "" assertEquals "" "$lp_join" typeset -a arr arr=(1 2 3) _lp_join "/" "${arr[@]}" assertEquals "1/2/3" "$lp_join" } function test_grep_fields { filename=$(mktemp) printf 'key1:value1\nkey2:value2\n' > "$filename" _lp_grep_fields "$filename" ":" "key1" "key2" assertEquals 2 ${#lp_grep_fields[@]} assertEquals "value1" ${lp_grep_fields[_LP_FIRST_INDEX+0]} assertEquals "value2" ${lp_grep_fields[_LP_FIRST_INDEX+1]} # Two-char delimiter, reverse orders of keys. printf 'key1:=value1\nkey2:=value2\n' > "$filename" _lp_grep_fields "$filename" ":=" "key2" "key1" assertEquals 2 ${#lp_grep_fields[@]} assertEquals "value2" ${lp_grep_fields[_LP_FIRST_INDEX+0]} assertEquals "value1" ${lp_grep_fields[_LP_FIRST_INDEX+1]} # No end of line. printf '[section]\nkey1=value1' > "$filename" _lp_grep_fields "$filename" "=" "key1" assertEquals 1 ${#lp_grep_fields[@]} assertEquals "value1" ${lp_grep_fields[_LP_FIRST_INDEX+0]} # Bad keys with spaces. printf ' key1 :NOPE\nkey1:value1\nNOPE:NOPE\n key1:NOPE\nkey1 :NOPE' > "$filename" _lp_grep_fields "$filename" ":" "key1" assertEquals 1 ${#lp_grep_fields[@]} assertEquals "value1" ${lp_grep_fields[_LP_FIRST_INDEX+0]} # Delimiter in key name/value. printf 'key1=value1\nkey2=value=key2=?\nkey3==val\n' > "$filename" _lp_grep_fields "$filename" "=" "key1" "key2" "key3" assertEquals 3 ${#lp_grep_fields[@]} assertEquals "value1" ${lp_grep_fields[_LP_FIRST_INDEX+0]} assertEquals "value=key2=?" ${lp_grep_fields[_LP_FIRST_INDEX+1]} assertEquals "=val" ${lp_grep_fields[_LP_FIRST_INDEX+2]} # Empty file. printf '\n' > "$filename" _lp_grep_fields "$filename" ":=" "nokey" assertTrue "found a non existing key" '[[ -z "${lp_grep_fields[_LP_FIRST_INDEX+0]+x}" ]]' # Really empty file. printf '' > "$filename" _lp_grep_fields "$filename" ":=" "nokey" assertTrue "found a non existing key" '[[ -z "${lp_grep_fields[_LP_FIRST_INDEX+0]+x}" ]]' rm -f "$filename" } function test_version { _LP_VERSION=(1 2 3 beta 4) _lp_version_greatereq 1 2 3 beta 4 assertTrue "equal version" "$?" _lp_version_greatereq 1 2 3 beta 5 assertFalse "lesser version number" "$?" _lp_version_greatereq 1 2 3 rc 1 assertFalse "lesser version string" "$?" _lp_version_greatereq 1 2 4 beta 4 assertFalse "lesser version patch" "$?" _lp_version_greatereq 1 3 3 beta 4 assertFalse "lesser version minor" "$?" _lp_version_greatereq 2 2 3 beta 4 assertFalse "lesser version major" "$?" _lp_version_greatereq 1 2 3 beta 3 assertTrue "greater version number" "$?" _lp_version_greatereq 1 2 3 alpha 4 assertTrue "greater version string" "$?" _lp_version_greatereq 1 2 2 beta 4 assertTrue "greater version patch" "$?" _lp_version_greatereq 1 1 3 beta 4 assertTrue "greater version minor" "$?" _lp_version_greatereq 0 2 3 beta 4 assertTrue "greater version major" "$?" _lp_version_string # Defaults to _LP_VERSION assertEquals "1.2.3-beta.4" "$lp_version" _lp_version_string 5 4 3 rc 2 assertEquals "5.4.3-rc.2" "$lp_version" _lp_version_string 5 4 3 rc assertEquals "5.4.3-rc" "$lp_version" _lp_version_string 5 4 3 assertEquals "5.4.3" "$lp_version" _lp_version_string 5 4 assertEquals "5.4" "$lp_version" } function test_substitute { typeset sub sub=( "When" "NOK" "What?" "NOPE" "What" "OK" ) _lp_substitute "What" "${sub[@]}" assertEquals "OK" "$lp_substitute" } . ./shunit2 liquidprompt-2.2.1/themes/000077500000000000000000000000001464055045500155425ustar00rootroot00000000000000liquidprompt-2.2.1/themes/alternate_vcs/000077500000000000000000000000001464055045500203745ustar00rootroot00000000000000liquidprompt-2.2.1/themes/alternate_vcs/alternate_vcs.theme000066400000000000000000000120541464055045500242540ustar00rootroot00000000000000 # shellcheck shell=bash _lp_alternate_vcs_theme_activate() { _lp_default_theme_activate LP_ALWAYS_ALT_VCS_TAG=${LP_ALWAYS_ALT_VCS_TAG:-0} LP_ENABLE_ALT_VCS_COMMITS=${LP_ENABLE_ALT_VCS_COMMITS:-1} LP_ENABLE_ALT_VCS_DIFF=${LP_ENABLE_ALT_VCS_DIFF:-1} LP_ENABLE_ALT_VCS_STATUS=${LP_ENABLE_ALT_VCS_STATUS:-1} LP_MARK_ALT_VCS_TAG=${LP_MARK_ALT_VCS_TAG:-"🔖"} } _lp_alternate_vcs_theme_directory() { _lp_default_theme_directory } _lp_alternate_vcs_theme_prompt() { _lp_default_theme_prompt_data # TODO: This will run both VCS details, which will make this prompt slower if _lp_find_vcs && _lp_alternate_vcs_details; then LP_VCS=" $lp_alternate_vcs_details" else LP_VCS= fi _lp_default_theme_prompt_template } _lp_alternate_vcs_details() { local branch if _lp_vcs_branch; then branch="$lp_vcs_branch" if _lp_vcs_bookmark; then branch+=": $lp_vcs_bookmark" fi if (( LP_ALWAYS_ALT_VCS_TAG )) && _lp_vcs_tag; then branch+=" ${LP_MARK_ALT_VCS_TAG}${lp_vcs_tag}" fi elif _lp_vcs_bookmark; then branch="$lp_vcs_bookmark" elif _lp_vcs_tag; then branch="${LP_MARK_ALT_VCS_TAG}${lp_vcs_tag}" else _lp_vcs_commit_id branch="${lp_vcs_commit_id:0:7}" fi lp_alternate_vcs_details="$LP_COLOR_UP" local has_commit= if _lp_vcs_commits_off_remote; then lp_alternate_vcs_details="$LP_COLOR_COMMITS_BEHIND" if [[ "$lp_vcs_commit_ahead" -ne "0" && "$lp_vcs_commit_behind" -ne "0" ]]; then has_commit="${LP_COLOR_COMMITS}+$lp_vcs_commit_ahead${NO_COL}/${LP_COLOR_COMMITS_BEHIND}-$lp_vcs_commit_behind" elif [[ "$lp_vcs_commit_ahead" -ne "0" ]]; then has_commit="${LP_COLOR_COMMITS}$lp_vcs_commit_ahead" lp_alternate_vcs_details="$LP_COLOR_COMMITS" elif [[ "$lp_vcs_commit_behind" -ne "0" ]]; then has_commit="${LP_COLOR_COMMITS_BEHIND}-$lp_vcs_commit_behind" fi (( LP_ENABLE_ALT_VCS_COMMITS )) || has_commit="" fi local ret has_files= if _lp_vcs_uncommitted_files; then lp_alternate_vcs_details="$LP_COLOR_CHANGES" if (( LP_ENABLE_ALT_VCS_STATUS )); then _lp_vcs_unstaged_files; ret=$? # Only show unstaged files if the VCS supports staging, otherwise # show only uncommitted files if (( ret == 0 )); then local -i staged_files=$(( lp_vcs_uncommitted_files - lp_vcs_unstaged_files )) if (( staged_files )); then has_files="${LP_COLOR_COMMITS}S${staged_files} " fi has_files+="${LP_COLOR_CHANGES}U${lp_vcs_unstaged_files}" elif (( ret == 1 )); then has_files="${LP_COLOR_COMMITS}S${lp_vcs_uncommitted_files}" else has_files="${LP_COLOR_CHANGES}U${lp_vcs_uncommitted_files}" fi fi fi if (( LP_ENABLE_ALT_VCS_STATUS )) && _lp_vcs_untracked_files; then [[ -n $has_files ]] && has_files+=" " has_files+="${LP_COLOR_CHANGES}?${lp_vcs_untracked_files}" fi local has_lines= if (( LP_ENABLE_ALT_VCS_DIFF )) && _lp_vcs_uncommitted_lines; then _lp_vcs_unstaged_lines; ret=$? # Only show unstaged changes if the VCS supports staging, otherwise # show uncommitted changes. if (( ret == 0 )); then has_lines="+$lp_vcs_unstaged_i_lines/-$lp_vcs_unstaged_d_lines" elif (( ret == 1 )); then # If the status is on, it would be redundant to say there are no unstaged lines. if (( ! LP_ENABLE_ALT_VCS_STATUS )); then has_lines="+0/-0" fi else has_lines="+$lp_vcs_uncommitted_i_lines/-$lp_vcs_uncommitted_d_lines" fi fi lp_alternate_vcs_details+="$branch" if [[ -n $has_lines || -n $has_files || -n $has_commit ]]; then lp_alternate_vcs_details+="${NO_COL}(" if [[ -n $has_files ]]; then lp_alternate_vcs_details+="$has_files" if [[ -n $has_lines || -n $has_commit ]]; then lp_alternate_vcs_details+="${NO_COL} " fi fi if [[ -n $has_lines ]]; then lp_alternate_vcs_details+="${LP_COLOR_DIFF}${has_lines}" if [[ -n $has_commit ]]; then lp_alternate_vcs_details+="${NO_COL}," fi fi lp_alternate_vcs_details+="${has_commit}${NO_COL})" fi if _lp_vcs_stash_count; then lp_alternate_vcs_details+="${LP_COLOR_COMMITS}${LP_MARK_STASH}" fi if (( ! LP_ENABLE_ALT_VCS_STATUS )) && _lp_vcs_untracked_files; then lp_alternate_vcs_details+="${LP_COLOR_CHANGES}${LP_MARK_UNTRACKED}" fi if _lp_vcs_head_status; then lp_alternate_vcs_details+=" ${LP_COLOR_CHANGES}${lp_vcs_head_status}" if [[ -n "${lp_vcs_head_details-}" ]]; then lp_alternate_vcs_details+="(${lp_vcs_head_details})" fi fi lp_alternate_vcs_details+="$NO_COL" } # vim: ft=sh et sts=4 sw=4 tw=120 liquidprompt-2.2.1/themes/powerline/000077500000000000000000000000001464055045500175465ustar00rootroot00000000000000liquidprompt-2.2.1/themes/powerline/powerline.theme000066400000000000000000000432651464055045500226100ustar00rootroot00000000000000 # shellcheck shell=bash _lp_powerline_theme_activate() { # Load default markers if not already defined POWERLINE_HARD_DIVIDER=${POWERLINE_HARD_DIVIDER:-""} # U+E0B0 POWERLINE_SOFT_DIVIDER=${POWERLINE_SOFT_DIVIDER:-""} # U+E0B1 POWERLINE_VCS_MARKER=${POWERLINE_VCS_MARKER:-""} # U+E0A0 POWERLINE_SECURE_MARKER=${POWERLINE_SECURE_MARKER:-""} # U+E0A2 POWERLINE_ROOT_MARKER=${POWERLINE_ROOT_MARKER:-"#"} POWERLINE_STASH_MARKER=${POWERLINE_STASH_MARKER:-"ST"} POWERLINE_PYTHON_ENV_MARKER=${POWERLINE_PYTHON_ENV_MARKER:-"(e) "} POWERLINE_SPACER=${POWERLINE_SPACER:-" "} # U+00A0 non-breaking space # Load default colors if not already defined POWERLINE_HOST_COLOR=( ${POWERLINE_HOST_COLOR[@]+"${POWERLINE_HOST_COLOR[@]}"} ) [[ ${#POWERLINE_HOST_COLOR[@]} == 0 ]] && POWERLINE_HOST_COLOR=(220 166 0 0 3 2) POWERLINE_USER_COLOR=( ${POWERLINE_USER_COLOR[@]+"${POWERLINE_USER_COLOR[@]}"} ) [[ ${#POWERLINE_USER_COLOR[@]} == 0 ]] && POWERLINE_USER_COLOR=(231 31 1 0 7 6) POWERLINE_PYTHON_ENV_COLOR=( ${POWERLINE_PYTHON_ENV_COLOR[@]+"${POWERLINE_PYTHON_ENV_COLOR[@]}"} ) [[ ${#POWERLINE_PYTHON_ENV_COLOR[@]} == 0 ]] && POWERLINE_PYTHON_ENV_COLOR=(231 74 0 0 7 4) POWERLINE_PATH_COLOR=( ${POWERLINE_PATH_COLOR[@]+"${POWERLINE_PATH_COLOR[@]}"} ) [[ ${#POWERLINE_PATH_COLOR[@]} == 0 ]] && POWERLINE_PATH_COLOR=(250 240 0 0 7 0) POWERLINE_PATH_SEPARATOR_COLOR=( ${POWERLINE_PATH_SEPARATOR_COLOR[@]+"${POWERLINE_PATH_SEPARATOR_COLOR[@]}"} ) [[ ${#POWERLINE_PATH_SEPARATOR_COLOR[@]} == 0 ]] && POWERLINE_PATH_SEPARATOR_COLOR=(245 240 0 0 7 0) POWERLINE_PATH_LAST_COLOR=( ${POWERLINE_PATH_LAST_COLOR[@]+"${POWERLINE_PATH_LAST_COLOR[@]}"} ) [[ ${#POWERLINE_PATH_LAST_COLOR[@]} == 0 ]] && POWERLINE_PATH_LAST_COLOR=(252 240 1 0 7 0) POWERLINE_PATH_VCS_COLOR=( ${POWERLINE_PATH_VCS_COLOR[@]+"${POWERLINE_PATH_VCS_COLOR[@]}"} ) [[ ${#POWERLINE_PATH_VCS_COLOR[@]} == 0 ]] && POWERLINE_PATH_VCS_COLOR=(147 240 1 0 4 0) POWERLINE_PATH_SHORTENED_COLOR=( ${POWERLINE_PATH_SHORTENED_COLOR[@]+"${POWERLINE_PATH_SHORTENED_COLOR[@]}"} ) [[ ${#POWERLINE_PATH_SHORTENED_COLOR[@]} == 0 ]] && POWERLINE_PATH_SHORTENED_COLOR=(245 240 0 0 7 0) POWERLINE_JOBS_COLOR=( ${POWERLINE_JOBS_COLOR[@]+"${POWERLINE_JOBS_COLOR[@]}"} ) [[ ${#POWERLINE_JOBS_COLOR[@]} == 0 ]] && POWERLINE_JOBS_COLOR=(220 166 0 0 3 2) POWERLINE_VCS_CLEAN_COLOR=( ${POWERLINE_VCS_CLEAN_COLOR[@]+"${POWERLINE_VCS_CLEAN_COLOR[@]}"} ) [[ ${#POWERLINE_VCS_CLEAN_COLOR[@]} == 0 ]] && POWERLINE_VCS_CLEAN_COLOR=(250 236 0 0 7 0) POWERLINE_VCS_DIRTY_COLOR=( ${POWERLINE_VCS_DIRTY_COLOR[@]+"${POWERLINE_VCS_DIRTY_COLOR[@]}"} ) [[ ${#POWERLINE_VCS_DIRTY_COLOR[@]} == 0 ]] && POWERLINE_VCS_DIRTY_COLOR=(220 236 0 0 3 0) POWERLINE_VCS_STASH_COLOR=( ${POWERLINE_VCS_STASH_COLOR[@]+"${POWERLINE_VCS_STASH_COLOR[@]}"} ) [[ ${#POWERLINE_VCS_STASH_COLOR[@]} == 0 ]] && POWERLINE_VCS_STASH_COLOR=(220 236 0 0 3 0) POWERLINE_ERROR_COLOR=( ${POWERLINE_ERROR_COLOR[@]+"${POWERLINE_ERROR_COLOR[@]}"} ) [[ ${#POWERLINE_ERROR_COLOR[@]} == 0 ]] && POWERLINE_ERROR_COLOR=(231 52 0 0 7 1) __powerline_hostname_generate __powerline_username_generate } __powerline_hostname_generate() { _POWERLINE_HOSTNAME="" _POWERLINE_HOST_ICON="" local lp_hostname lp_connection if _lp_hostname; then _POWERLINE_HOSTNAME=${lp_hostname} case "$lp_connection" in ssh) _POWERLINE_HOST_ICON="${POWERLINE_SECURE_MARKER} " ;; su) _POWERLINE_HOST_ICON="${POWERLINE_ROOT_MARKER} " ;; esac fi } __powerline_username_generate() { _POWERLINE_USERNAME= local lp_username if _lp_username; then _POWERLINE_USERNAME=${lp_username} fi } _lp_powerline_theme_directory() { # Not all terminals support Powerline special characters in the title local title= title+=${lp_username_raw-} title+="${lp_hostname_raw+@}${lp_hostname_raw-}" local lp_path __powerline_path_generate [[ -n $title ]] && title+=":" title+="${lp_path}" # Include a trailing space to pad for the title command. _lp_raw_title "$title " } _lp_powerline_theme_prompt() { local powerline_sections first_section sub_section_format _lp_last_af_color _lp_last_ab_color __powerline_section "${_POWERLINE_HOST_ICON}${_POWERLINE_HOSTNAME}" "${POWERLINE_HOST_COLOR[@]}" __powerline_section "$_POWERLINE_USERNAME" "${POWERLINE_USER_COLOR[@]}" local lp_python_env if _lp_python_env; then __powerline_section "${POWERLINE_PYTHON_ENV_MARKER}${lp_python_env}" "${POWERLINE_PYTHON_ENV_COLOR[@]}" fi __powerline_section "$_lp_powerline_path" "${POWERLINE_PATH_COLOR[@]}" local lp_running_jobs lp_stopped_jobs if _lp_jobcount; then __powerline_section "$(( lp_running_jobs + lp_stopped_jobs ))" "${POWERLINE_JOBS_COLOR[@]}" fi # TODO render on left side local lp_vcs_type lp_vcs_root if _lp_find_vcs; then local lp_vcs_branch lp_vcs_uncommitted_files lp_vcs_untracked_files _lp_vcs_branch if _lp_vcs_uncommitted_files || _lp_vcs_untracked_files; then __powerline_section "${POWERLINE_VCS_MARKER} ${lp_vcs_branch}" "${POWERLINE_VCS_DIRTY_COLOR[@]}" else __powerline_section "${POWERLINE_VCS_MARKER} ${lp_vcs_branch}" "${POWERLINE_VCS_CLEAN_COLOR[@]}" fi local lp_vcs_stash_count if _lp_vcs_stash_count; then __powerline_sub_section_format -2 powerline_sections+="${sub_section_format}${POWERLINE_SOFT_DIVIDER}" __powerline_section "${POWERLINE_STASH_MARKER} ${lp_vcs_stash_count}" "${POWERLINE_VCS_STASH_COLOR[@]}" fi fi if _lp_error; then __powerline_section "${lp_error}" "${POWERLINE_ERROR_COLOR[@]}" fi __powerline_end_terminator PS1=${powerline_sections} } _lp_powerline_full_theme_activate() { _lp_powerline_theme_activate # Load default markers if not already defined POWERLINE_AWS_PROFILE_MARKER=${POWERLINE_AWS_PROFILE_MARKER:-"AWS: "} POWERLINE_CHROOT_MARKER=${POWERLINE_CHROOT_MARKER:-"chroot: "} POWERLINE_KUBECONTEXT_MARKER=${POWERLINE_KUBECONTEXT_MARKER:-$LP_MARK_KUBECONTEXT} POWERLINE_NODE_ENV_MARKER=${POWERLINE_NODE_ENV_MARKER:-"node: "} POWERLINE_PROXY_MARKER=${POWERLINE_PROXY_MARKER:-"proxy: "} POWERLINE_PERL_ENV_MARKER=${POWERLINE_PERL_ENV_MARKER:-"perl: "} POWERLINE_RUBY_ENV_MARKER=${POWERLINE_RUBY_ENV_MARKER:-"ruby: "} POWERLINE_SOFTWARE_COLLECTION_MARKER=${POWERLINE_SOFTWARE_COLLECTION_MARKER:-"(sc) "} POWERLINE_TERRAFORM_ENV_MARKER=${POWERLINE_TERRAFORM_ENV_MARKER:-"(tf) "} # Load default colors if not already defined POWERLINE_NEUTRAL_COLOR=( ${POWERLINE_NEUTRAL_COLOR[@]+"${POWERLINE_NEUTRAL_COLOR[@]}"} ) [[ ${#POWERLINE_NEUTRAL_COLOR[@]} == 0 ]] && POWERLINE_NEUTRAL_COLOR=(252 234 0 0 7 0) POWERLINE_AWS_PROFILE_COLOR=( ${POWERLINE_AWS_PROFILE_COLOR[@]+"${POWERLINE_AWS_PROFILE_COLOR[@]}"} ) [[ ${#POWERLINE_AWS_PROFILE_COLOR[@]} == 0 ]] && POWERLINE_AWS_PROFILE_COLOR=(190 236 0 0 3 0) POWERLINE_BATTERY_COLOR=( ${POWERLINE_BATTERY_COLOR[@]+"${POWERLINE_BATTERY_COLOR[@]}"} ) [[ ${#POWERLINE_BATTERY_COLOR[@]} == 0 ]] && POWERLINE_BATTERY_COLOR=(-1 238 0 0 -1 0) POWERLINE_CHROOT_COLOR=( ${POWERLINE_CHROOT_COLOR[@]+"${POWERLINE_CHROOT_COLOR[@]}"} ) [[ ${#POWERLINE_CHROOT_COLOR[@]} == 0 ]] && POWERLINE_CHROOT_COLOR=(219 30 0 0 7 4) POWERLINE_CONTAINER_COLOR=( ${POWERLINE_CONTAINER_COLOR[@]+"${POWERLINE_CONTAINER_COLOR[@]}"} ) [[ ${#POWERLINE_CONTAINER_COLOR[@]} == 0 ]] && POWERLINE_CONTAINER_COLOR=("${POWERLINE_NEUTRAL_COLOR[@]}") POWERLINE_DIRSTACK_COLOR=( ${POWERLINE_DIRSTACK_COLOR[@]+"${POWERLINE_DIRSTACK_COLOR[@]}"} ) [[ ${#POWERLINE_DIRSTACK_COLOR[@]} == 0 ]] && POWERLINE_DIRSTACK_COLOR=("${POWERLINE_NEUTRAL_COLOR[@]}") POWERLINE_KUBECONTEXT_COLOR=( ${POWERLINE_KUBECONTEXT_COLOR[@]+"${POWERLINE_KUBECONTEXT_COLOR[@]}"} ) [[ ${#POWERLINE_KUBECONTEXT_COLOR[@]} == 0 ]] && POWERLINE_KUBECONTEXT_COLOR=(231 74 0 0 7 4) POWERLINE_LOAD_COLOR=( ${POWERLINE_LOAD_COLOR[@]+"${POWERLINE_LOAD_COLOR[@]}"} ) [[ ${#POWERLINE_LOAD_COLOR[@]} == 0 ]] && POWERLINE_LOAD_COLOR=(-1 148 0 0 -1 3) POWERLINE_NODE_ENV_COLOR=( ${POWERLINE_NODE_ENV_COLOR[@]+"${POWERLINE_NODE_ENV_COLOR[@]}"} ) [[ ${#POWERLINE_NODE_ENV_COLOR[@]} == 0 ]] && POWERLINE_NODE_ENV_COLOR=("${POWERLINE_PYTHON_ENV_COLOR[@]}") POWERLINE_PROXY_COLOR=( ${POWERLINE_PROXY_COLOR[@]+"${POWERLINE_PROXY_COLOR[@]}"} ) [[ ${#POWERLINE_PROXY_COLOR[@]} == 0 ]] && POWERLINE_PROXY_COLOR=(21 219 1 0 4 7) POWERLINE_RUBY_ENV_COLOR=( ${POWERLINE_RUBY_ENV_COLOR[@]+"${POWERLINE_RUBY_ENV_COLOR[@]}"} ) [[ ${#POWERLINE_RUBY_ENV_COLOR[@]} == 0 ]] && POWERLINE_RUBY_ENV_COLOR=("${POWERLINE_PYTHON_ENV_COLOR[@]}") POWERLINE_RUNTIME_COLOR=( ${POWERLINE_RUNTIME_COLOR[@]+"${POWERLINE_RUNTIME_COLOR[@]}"} ) [[ ${#POWERLINE_RUNTIME_COLOR[@]} == 0 ]] && POWERLINE_RUNTIME_COLOR=(226 17 0 0 3 4) POWERLINE_SHLVL_COLOR=( ${POWERLINE_SHLVL_COLOR[@]+"${POWERLINE_SHLVL_COLOR[@]}"} ) [[ ${#POWERLINE_SHLVL_COLOR[@]} == 0 ]] && POWERLINE_SHLVL_COLOR=(231 58 0 0 7 2) POWERLINE_SOFTWARE_COLLECTIONS_COLOR=( ${POWERLINE_SOFTWARE_COLLECTIONS_COLOR[@]+"${POWERLINE_SOFTWARE_COLLECTIONS_COLOR[@]}"} ) [[ ${#POWERLINE_SOFTWARE_COLLECTIONS_COLOR[@]} == 0 ]] && POWERLINE_SOFTWARE_COLLECTIONS_COLOR=(231 62 0 0 7 5) POWERLINE_TEMPERATURE_COLOR=( ${POWERLINE_TEMPERATURE_COLOR[@]+"${POWERLINE_TEMPERATURE_COLOR[@]}"} ) [[ ${#POWERLINE_TEMPERATURE_COLOR[@]} == 0 ]] && POWERLINE_TEMPERATURE_COLOR=(-1 240 0 0 -1 0) POWERLINE_TERRAFORM_ENV_COLOR=( ${POWERLINE_TERRAFORM_ENV_COLOR[@]+"${POWERLINE_TERRAFORM_ENV_COLOR[@]}"} ) [[ ${#POWERLINE_TERRAFORM_ENV_COLOR[@]} == 0 ]] && POWERLINE_TERRAFORM_ENV_COLOR=(231 182 0 0 7 4) POWERLINE_TIME_COLOR=( ${POWERLINE_TIME_COLOR[@]+"${POWERLINE_TIME_COLOR[@]}"} ) [[ ${#POWERLINE_TIME_COLOR[@]} == 0 ]] && POWERLINE_TIME_COLOR=(33 17 0 0 5 4) POWERLINE_WIFI_STRENGTH_COLOR=( ${POWERLINE_WIFI_STRENGTH_COLOR[@]+"${POWERLINE_WIFI_STRENGTH_COLOR[@]}"} ) [[ ${#POWERLINE_WIFI_STRENGTH_COLOR[@]} == 0 ]] && POWERLINE_WIFI_STRENGTH_COLOR=(-1 148 0 0 -1 3) } _lp_powerline_full_theme_directory() { _lp_powerline_theme_directory } _lp_powerline_full_theme_prompt() { local powerline_sections first_section _lp_last_af_color _lp_last_ab_color __powerline_section "$LP_PS1_PREFIX" "${POWERLINE_NEUTRAL_COLOR[@]}" local lp_time lp_analog_time if _lp_time; then __powerline_section "$lp_time" "${POWERLINE_TIME_COLOR[@]}" elif _lp_analog_time; then __powerline_section "$lp_analog_time" "${POWERLINE_TIME_COLOR[@]}" fi __powerline_battery_section local lp_load_color if _lp_load_color; then __powerline_formatted_section "$lp_load_color" "${POWERLINE_LOAD_COLOR[@]}" fi local lp_temperature_color if _lp_temperature_color; then __powerline_formatted_section "$lp_temperature_color" "${POWERLINE_TEMPERATURE_COLOR[@]}" fi local lp_wifi_signal_strength_color if _lp_wifi_signal_strength_color; then __powerline_formatted_section "$lp_wifi_signal_strength_color" "${POWERLINE_WIFI_STRENGTH_COLOR[@]}" fi local lp_detached_sessions lp_running_jobs lp_stopped_jobs jobs_string= if _lp_detached_sessions; then jobs_string="${lp_detached_sessions}d" fi if _lp_jobcount; then if (( lp_running_jobs > 0 )); then [[ -n $jobs_string ]] && jobs_string+='/' jobs_string+="${lp_running_jobs}&" fi if (( lp_stopped_jobs > 0 )); then [[ -n $jobs_string ]] && jobs_string+='/' jobs_string+="${lp_stopped_jobs}z" fi fi __powerline_section "$jobs_string" "${POWERLINE_JOBS_COLOR[@]}" __powerline_section "$_POWERLINE_USERNAME" "${POWERLINE_USER_COLOR[@]}" __powerline_section "${_POWERLINE_HOST_ICON}${_POWERLINE_HOSTNAME}" "${POWERLINE_HOST_COLOR[@]}" __powerline_section "$_lp_powerline_path" "${POWERLINE_PATH_COLOR[@]}" if _lp_dirstack; then __powerline_section "${LP_MARK_DIRSTACK}${lp_dirstack}" "${POWERLINE_DIRSTACK_COLOR[@]}" fi if _lp_shell_level; then __powerline_section "${LP_MARK_SHLVL}${lp_shell_level}" "${POWERLINE_SHLVL_COLOR[@]}" fi local lp_chroot if _lp_chroot; then __powerline_section "${POWERLINE_CHROOT_MARKER}${lp_chroot}" "${POWERLINE_CHROOT_COLOR[@]}" fi local lp_software_collections if _lp_software_collections; then __powerline_section "${POWERLINE_SOFTWARE_COLLECTION_MARKER}${lp_software_collections}" "${POWERLINE_SOFTWARE_COLLECTIONS_COLOR[@]}" fi local lp_aws_profile if _lp_aws_profile; then __powerline_section "${POWERLINE_AWS_PROFILE_MARKER}${lp_aws_profile}" "${POWERLINE_AWS_PROFILE_COLOR[@]}" fi local lp_python_env if _lp_python_env; then __powerline_section "${POWERLINE_PYTHON_ENV_MARKER}${lp_python_env}" "${POWERLINE_PYTHON_ENV_COLOR[@]}" fi local lp_node_env if _lp_node_env; then __powerline_section "${POWERLINE_NODE_ENV_MARKER}${lp_node_env}" "${POWERLINE_NODE_ENV_COLOR[@]}" fi local lp_perl_env if _lp_perl_env; then __powerline_section "${POWERLINE_PERL_ENV_MARKER}${lp_perl_env}" "${POWERLINE_PERL_ENV_COLOR[@]}" fi local lp_ruby_env if _lp_ruby_env; then __powerline_section "${POWERLINE_RUBY_ENV_MARKER}${lp_ruby_env}" "${POWERLINE_RUBY_ENV_COLOR[@]}" fi local lp_kubernetes_context if _lp_kubernetes_context; then __powerline_section "${POWERLINE_KUBECONTEXT_MARKER}${lp_kubernetes_context}" "${POWERLINE_KUBECONTEXT_COLOR[@]}" fi local lp_terraform_env if _lp_terraform_env; then __powerline_section "${POWERLINE_TERRAFORM_ENV_MARKER}${lp_terraform_env}" "${POWERLINE_TERRAFORM_ENV_COLOR[@]}" fi local lp_http_proxy if _lp_http_proxy; then __powerline_section "${POWERLINE_PROXY_MARKER}${lp_http_proxy}" "${POWERLINE_PROXY_COLOR[@]}" fi __powerline_vcs_section if _lp_runtime_format; then __powerline_section "${lp_runtime_format}" "${POWERLINE_RUNTIME_COLOR[@]}" fi if _lp_error; then __powerline_section "${lp_error}" "${POWERLINE_ERROR_COLOR[@]}" fi __powerline_section "$LP_PS1_POSTFIX" "${POWERLINE_NEUTRAL_COLOR[@]}" __powerline_end_terminator PS1=$powerline_sections } __powerline_section() { # string, (color array) local section_arrow lp_terminal_format string="${1-}" shift [[ -z $string ]] && return 1 __powerline_section_arrow "$@" lp_terminal_format "$@" powerline_sections+="${section_arrow}${lp_terminal_format}${POWERLINE_SPACER}${string}${POWERLINE_SPACER}" } # Same as __powerline_section(), but it resets formatting after the input string __powerline_formatted_section() { local section_arrow lp_terminal_format string="${1-}" shift [[ -z $string ]] && return 1 __powerline_section_arrow "$@" lp_terminal_format "$@" powerline_sections+="${section_arrow}${lp_terminal_format}${POWERLINE_SPACER}${string}${lp_terminal_format}${POWERLINE_SPACER}" } # Reset background for end of prompt __powerline_end_terminator() { # Always add a end terminator, even if nothing is before it local first_section="true" __powerline_section_arrow -1 lp_terminal_format -1 powerline_sections+="${section_arrow}${lp_terminal_format}${POWERLINE_SPACER}" } __powerline_section_arrow() { # _, background_color, _, _, _, fallback_background_color if [[ -n ${first_section-} ]]; then local lp_terminal_format lp_terminal_format -3 "${2-}" 0 0 -1 "${6-}" section_arrow="${lp_terminal_format}${POWERLINE_HARD_DIVIDER}" else first_section="true" section_arrow= fi } __powerline_sub_section_format() { # foreground_color, _, _, _, fallback_foreground_color local lp_terminal_format lp_terminal_format "${1-}" -2 0 0 "${5-}" sub_section_format="${lp_terminal_format}" } # We don't want to generate the path every prompt, so create the full formatted # path once for each dir. __powerline_path_generate() { local lp_terminal_format sub_section_format _lp_last_af_color _lp_last_ab_color lp_terminal_format "${POWERLINE_PATH_COLOR[@]}" local path_format="$lp_terminal_format" __powerline_sub_section_format "${POWERLINE_PATH_SEPARATOR_COLOR[@]}" local separator_format="$sub_section_format" lp_terminal_format "${POWERLINE_PATH_SHORTENED_COLOR[@]}" local shortened_format="$lp_terminal_format" lp_terminal_format "${POWERLINE_PATH_VCS_COLOR[@]}" local vcs_format="$lp_terminal_format" lp_terminal_format "${POWERLINE_PATH_LAST_COLOR[@]}" local last_dir_format="$lp_terminal_format" local lp_path_format _lp_path_format "$path_format" "$last_dir_format" "$vcs_format" "$shortened_format" \ "${POWERLINE_SPACER}${POWERLINE_SOFT_DIVIDER}${POWERLINE_SPACER}" "$separator_format" _lp_powerline_path=${lp_path_format} } # Is this a dirty hack? Yes. Am I proud of it? Also yes. __powerline_battery_section() { local lp_battery_color NO_COL='' if _lp_battery_color; then __powerline_formatted_section "$lp_battery_color" "${POWERLINE_BATTERY_COLOR[@]}" fi } __powerline_vcs_section() { local lp_vcs_type lp_vcs_root if _lp_find_vcs; then local section_arrow lp_terminal_format __powerline_section_arrow "${POWERLINE_VCS_CLEAN_COLOR[@]}" lp_terminal_format "${POWERLINE_VCS_CLEAN_COLOR[@]}" local lp_vcs_details_color NO_COL="$lp_terminal_format" _lp_vcs_details_color powerline_sections+="${section_arrow}${lp_terminal_format}${POWERLINE_SPACER}${lp_vcs_details_color}${POWERLINE_SPACER}" fi } # vim: ft=sh et sts=4 sw=4 tw=120 liquidprompt-2.2.1/themes/unfold/000077500000000000000000000000001464055045500170315ustar00rootroot00000000000000liquidprompt-2.2.1/themes/unfold/unfold.theme000066400000000000000000000025221464055045500213450ustar00rootroot00000000000000 # shellcheck shell=bash _lp_unfold_theme_activate() { _lp_default_theme_activate } _lp_unfold_theme_directory() { _lp_default_theme_directory } _lp_unfold_theme_prompt() { _lp_default_theme_prompt_data # add title escape time, jobs, load and battery local left="${LP_PS1_PREFIX}" # add user, host, permissions colon, working directory, proxy, user-defined env, and dirstack left+="${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_PERM}${LP_PWD}${LP_DIRSTACK}${LP_BRACKET_CLOSE}${LP_PROXY}${LP_ENVVARS}${LP_SHLVL}" # Add VCS infos # If root, the info has not been collected unless LP_ENABLE_VCS_ROOT # is set. left+="${LP_VCS}" # Add the list of development environments/config/etc. local right="${LP_DEV_ENV} ${LP_JOBS}${LP_BATT}${LP_LOAD}${LP_TEMP}${LP_RAM}${LP_DISK}${LP_WIFI}${LP_TIME}" # add return code and prompt mark local main="${LP_RUNTIME}${LP_ERR}${LP_MARK_PREFIX}${LP_COLOR_MARK}${LP_MARK}${LP_PS1_POSTFIX}" local n=$'\n' _lp_fill "$left" "$right" " " 0 "" "" PS1="${lp_fill}${n}${main}" # Get the core sections without prompt escapes and make them into a title. _lp_formatted_title "${LP_PS1_PREFIX}${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_MARK_PERM}${lp_path-}${LP_BRACKET_CLOSE}${LP_MARK_PREFIX}${LP_MARK}${LP_PS1_POSTFIX}" } # vim: ft=sh et sts=4 sw=4 tw=120 liquidprompt-2.2.1/tools/000077500000000000000000000000001464055045500154155ustar00rootroot00000000000000liquidprompt-2.2.1/tools/bug-report.sh000077500000000000000000000021471464055045500200460ustar00rootroot00000000000000 # Do NOT error on failed commands set +e if ! (return 0 2>/dev/null); then printf 'Error: script must be sourced to load config options correctly Ex: source %s\n' "$0" >&2 exit 1 fi report="bug-report.txt" if [[ -f "$report" ]]; then printf '"%s" already exists, refusing to overwrite!\n' "$report" >&2 return 1 fi ( if [[ -n "${ZSH_VERSION-}" ]]; then printf -- '---Shell: Zsh\n\n' typeset -m PS1 typeset -m 'LP_*' SCRIPT_DIR="${0:A:h}" else printf -- '---Shell: Bash\n\n' printf 'PROMPT_COMMAND:\n' printf '%q\n' "${PROMPT_COMMAND[@]}" printf '\n' vars="$(compgen -A variable LP_)" IFS=$'\n' for var in PS1 $vars; do printf '%s=%s\n' "$var" "${!var}" done SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) fi printf -- '\n---Git details:\ngit describe: "%s"\ngit rev-parse: "%s"\n\n' \ "$(git describe 2>/dev/null)" "$(git rev-parse HEAD 2>/dev/null)" "${SCRIPT_DIR}/external-tool-tester.sh" ) >>"$report" printf 'Bug report written to %s\nAttach the file in a GitHub issue comment.\n' "$report" >&2 liquidprompt-2.2.1/tools/config-from-doc.sh000077500000000000000000000111431464055045500207250ustar00rootroot00000000000000#!/bin/bash file="docs/config.rst" usage="This tool extracts the default configuration from the documentation, so that the resulting file can be used as a preset configuration. Usage: ./tools/config-from-doc.sh [--verbose] [|…|] > my_output.conf Ex.: ./tools/config-from-doc.sh > default_commented.conf It must be started from the root directory of the liquidprompt repository, so that it finds the right documentation file. By default, every key=value are commented out. You must edit it manually to get a working configuration file. You may enable warning about the parsing with the '--verbose' flag. Warnings will be printed to stderr and will not appear in the output file. The output is made so that it can be easily manipulated. For instance if you want to get rid of comments and enable every feature: ./tools/config-from-doc.sh | grep '^#\S' | sed 's/=0$/=1/' > full_raw.conf " if [ -t 1 ]; then # Error if the output is a terminal printf 'ERROR: This script must be redirected to a file or piped.\n\n' 1>&2 printf "%s" "$usage" 1>&2 exit 2 fi if [[ $# -gt 1 ]]; then printf "ERROR: This script does not accept more than one argument.\n\n" 1>&2 printf "%s" "$usage" 1>&2 exit 2 fi verbose=0 if [[ $# -eq 1 ]]; then if [[ "$1" != "--verbose" ]]; then printf "ERROR: unknown argument: \"%s\".\n\n" "${1}" 1>&2 printf "%s" "$usage" 1>&2 exit 2 else verbose=1 fi fi printf "# This file shows the default presets configuration for Liquid Prompt. # # You may edit it and load it from your shell configuration file # to have your own permanent configuration. # # For instance: # source ~/whatever/my_liquidprompt.conf # source ~/liquidprompt/liquidprompt # # Entries are commented out and show the default values. # There is no need to uncomment them if you do not change # their value from the default. # # Note that the file is automatically extracted from the documentation, # but does not show all the help for each entry. # You should refer to the full documentation to get more details, # in the 'Config Options' section: # https://liquidprompt.readthedocs.io/en/stable/config.html # You can also load multiple presets files in sequence. # See the 'contrib/presets/' directories for examples. " # We test for $line in the loop is here to ensure that we read the last line, # even if the file does not ends with a \n. # This bypass a known behavior of the C standard, not fixed in POSIX. while IFS='' read -r line || [[ -n "$line" ]] ; do if [[ "$line" == *".. attribute:: LP_"* ]]; then att="${line##*' '}" IFS=' ' read -r t atype IFS=' ' read -r v avalue if [[ "$t" == ":type:" && "$v" == ":value:" ]]; then if [[ "$avalue" == *"lp_terminal_format"* ]]; then ((verbose)) && printf "WARNING: attribute %s default shows lp_terminal_format.\n" "$att" 1>&2 fi IFS='' read -r # Empty line IFS='' read -r line if [[ -n "$line" ]]; then if [[ "$line" != *"deprecated"* ]]; then doc="" while [[ -n "$line" ]]; do doc="${doc}"$'\n'"#${line}" IFS='' read -r line done doc="${doc//:attr:/}" # Remove all :attr: tags. doc="${doc// / }" # Remove all triple spaces (indentations). doc="${doc//\`\`/\`}" # Remove all double back ticks. if [[ "${doc:0-1}" != "." ]]; then ((verbose)) && printf "WARNING: doc for attribute %s do not end with a period.\n" "$att" 1>&2 fi # Everything should be good here, we print. moreinfo="https://liquidprompt.readthedocs.io/en/stable/config.html#${att}" # all="#${doc}"$'\n'"# Type: ${atype}, more information: ${moreinfo}"$'\n'"#${att}=${avalue}"$'\n\n' # all="${all//%/%%}" # Escape percents. # printf "%s" "$all" printf '%s\n# Type: %s\n# More information: %s\n#%s=%s\n' \ "$doc" "$atype" "$moreinfo" "$att" "$avalue" else ((verbose)) && printf "NOTE: attribute %s is deprecated, bypass.\n" "$att" 1>&2 fi else ((verbose)) && printf "WARNING: attribute %s does not have doc.\n" "$att" 1>&2 fi else ((verbose)) && printf "WARNING: attribute %s does not have type or value.\n" "$att" 1>&2 fi fi done <"$file" # vim: ft=sh et sts=4 sw=4 tw=120 liquidprompt-2.2.1/tools/external-tool-tester.sh000077500000000000000000000061261464055045500220620ustar00rootroot00000000000000#!/bin/sh # Do NOT error on failed commands set +e # Don't error (or do anything) for no matching globs. if [ -n "${ZSH_VERSION-}" ]; then setopt nullglob fi # Error if the output is a terminal if [ -t 1 ]; then printf 'This script must be redirected to a file, or special characters will be lost Ex: %s > external-tool-results.txt\nAttach the file in a GitHub issue comment.\n' "$0" exit 2 fi # Export needed variables export LC_ALL=C # Print OS info printf -- '---Uname:\n' uname -a printf -- '---lpb_release:\n' lsb_release -a 2>/dev/null || printf '\n' printf -- '---/etc/*release:\n' cat /etc/*release 2>/dev/null \n' printf -- '---/etc/issue*:\n' cat /etc/issue* 2>/dev/null \n' printf -- '---/proc/version:\n' cat /proc/version 2>/dev/null \n' # Sanity check to verify special characters have not been lost on upload printf '\nSpecial character check: \a\b\t\001\r\n' test_tool() { printf '\nCommand: "%s"\n--------stdout--------\n' "$*" { stderr="$( { "$@"; } 2>&1 1>&3 3>&- )"; } 3>&1 printf '\n--------stderr--------\n%s\n----------------------\nReturn code: "%s"\n' "$stderr" "$?" } test_tool bash --version test_tool zsh --version test_tool uname test_tool uname -s test_tool uname -s -m test_tool uname -o hostname_cksum() { hostname | cksum } test_tool hostname_cksum test_tool tput sgr0 test_tool tput me test_tool tput bold test_tool tput md test_tool tput smul test_tool tput us test_tool tput colors test_tool tput bel test_tool tput bl test_tool tput setaf 0 test_tool tput AF 0 test_tool tput AF 0 0 0 test_tool tput setab 0 test_tool tput AB 0 test_tool tput AB 0 0 0 test_tool ps -o comm= -p "$PPID" test_tool logname test_tool screen -ls test_tool tmux list-sessions for power_supply in "/sys/class/power_supply/"*; do for interface in "${power_supply}/"*; do test_tool cat "$interface" done done test_tool acpi --battery test_tool pmset -g batt test_tool nproc # Not actually a command used, we read directly from the file test_tool cat /proc/loadavg test_tool cat /proc/meminfo test_tool cat /proc/net/wireless test_tool cat /var/run/dmesg.boot test_tool /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport --getinfo test_tool sysctl -n hw.ncpu test_tool sysctl -n vm.loadavg test_tool kstat -m cpu_info test_tool uptime test_tool df -k -P test_tool vm_stat test_tool cat /proc/meminfo test_tool cat /var/run/dmesg.boot test_tool sensors -u test_tool acpi -t for interface in \ /sys/class/hwmon/hwmon*/temp*_input \ /sys/class/hwmon/hwmon*/device/temp*_input \ /sys/devices/platform/coretemp.*/hwmon/hwmon*/temp*_input \ /sys/class/thermal/thermal_zone*/temp \ ; do test_tool cat "$interface" done test_tool date '+%I %M' test_tool tty test_tool basename -- /dev/pts/0 test_tool perbrew use test_tool plenv version-name test_tool rvm-prompt i v g s test_tool rbenv version-name # shellcheck disable=SC2016 printf 'Tests complete.\nMake sure to upload the file directly, do not `cat` and copy paste!\n' >&2 # vim: ft=sh et sts=2 sw=2 tw=120 liquidprompt-2.2.1/tools/theme-preview.sh000077500000000000000000000165641464055045500205510ustar00rootroot00000000000000#!/bin/bash #shellcheck disable=SC2317 set -u usage() { printf ' Usage: %s theme [options...] [sourced files...] Print out example prompts based on a standard set of input conditions. Designed to showcase Liquid Prompt themes. Options: -h, --help Print this help text. --reproducible Set the terminal size to a static value. Load no config files. Overrides any --config-file or --user-config arguments. --user-config Load the user, or if not found, the system config file. --template-file= Load as a default theme template. Implies "default" theme. --config-file= Load as an additional Liquid Prompt config file or config presets. Example usage: %s alternate_vcs themes/alternate_vcs/alternate_vcs.theme %s unfold themes/unfold/unfold.theme --reproducible %s unfold themes/unfold/unfold.theme --user-config --config-file contrib/presets/colors/256-colors-dark.conf %s default --template-file templates/minimal/minimal.ps1 ' 1>&2 "$0" "$0" "$0" "$0" "$0" } sourced_files=() config_files=() options_ended=false user_config=false reproducible=false unset theme while [[ -n ${1-} ]]; do if [[ ($1 == "--"* || $1 == "-h") && $options_ended == "false" ]]; then if [[ $1 == "--" ]]; then options_ended=true elif [[ $1 == "--help" || $1 == "-h" ]]; then usage exit 0 elif [[ $1 == "--config-file" ]]; then config_files+=("$2") shift elif [[ $1 == "--config-file="* ]]; then config_files+=("${1#"--config-file="}") elif [[ $1 == "--template-file" ]]; then LP_PS1_FILE="$2" shift elif [[ $1 == "--template-file="* ]]; then LP_PS1_FILE="${1#"--template-file="}" elif [[ $1 == "--user-config" ]]; then user_config=true elif [[ $1 == "--reproducible" ]]; then reproducible=true else printf 'Error: unknown option "%s"\n' "$1" exit 1 fi elif [[ -z ${theme+x} ]]; then theme=$1 else sourced_files+=("$1") fi shift done if [[ -z ${theme-} ]]; then if [[ -n ${LP_PS1_FILE-} ]]; then theme=default else usage exit 2 fi fi activate_args=() if [[ $user_config == "false" ]]; then activate_args+=("--no-config") fi activate_args+=(${config_files[@]+"${config_files[@]}"}) if [[ $reproducible == "true" ]]; then # Reset args to only no config. activate_args=("--no-config") if [[ $user_config == "true" || ${#config_files[@]} -gt 0 ]]; then printf "WARNING: the use of '--reproducible' overrides --config-file and --user-config.\n" >&2 fi fi . ./liquidprompt --no-activate for file in ${sourced_files[@]+"${sourced_files[@]}"}; do # shellcheck disable=SC1090 . "$file" done # Liquid Prompt depends on PS1 being set to detect if it has installed itself. PS1="$ " # Since the shell is not evaluating PS1, if we print the PS1 to the console, # the shell escape sequences will not be hidden, and it will look wrong. We # cannot strip them ahead of time, since they are required to know where to # look to remove formatting, so we have to do it right before printing it. __remove_shell_escapes() { # PS1 -> PS1 PS1="${PS1//"${_LP_OPEN_ESC}"/}" PS1="${PS1//"${_LP_CLOSE_ESC}"/}" } ## Short # Configure options LP_ENABLE_PERM=0 LP_ENABLE_SHORTEN_PATH=0 LP_ENABLE_PROXY=0 LP_ENABLE_TEMP=0 LP_ENABLE_JOBS=0 LP_ENABLE_DETACHED_SESSIONS=0 LP_ENABLE_LOAD=0 LP_ENABLE_BATT=0 LP_ENABLE_GIT=0 LP_ENABLE_SVN=0 LP_ENABLE_FOSSIL=0 LP_ENABLE_HG=0 LP_ENABLE_BZR=0 LP_ENABLE_TIME=0 LP_ENABLE_RUNTIME=0 LP_ENABLE_RUNTIME_BELL=0 LP_ENABLE_VIRTUALENV=0 LP_ENABLE_NODE_VENV=0 LP_ENABLE_RUBY_VENV=0 LP_ENABLE_TERRAFORM=0 LP_ENABLE_SCLS=0 LP_ENABLE_VCS_ROOT=1 LP_DISABLED_VCS_PATHS=() LP_ENABLE_TITLE=0 LP_ENABLE_SUDO=0 LP_ENABLE_COLOR=1 LP_ENABLE_ERROR=0 LP_ENABLE_SHLVL=0 LP_ENABLE_PERL_VENV=0 LP_ENABLE_AWS_PROFILE=0 LP_USER_ALWAYS=1 LP_HOSTNAME_ALWAYS=-1 LP_MARK_DEFAULT='$' # Stub data functions _lp_username() { lp_username=user } # Setup Env HOME=/home/user PWD=$HOME # Activate and generate lp_activate ${activate_args[@]+"${activate_args[@]}"} # Only needs to be done once lp_theme "$theme" || exit "$?" if [[ $reproducible == "true" ]]; then COLUMNS=160 fi __lp_set_prompt __remove_shell_escapes printf 'Short prompt:\n\n%s\n\n' "$PS1" ## Medium # Configure options # lp_activate() is too smart: it will disable features if the tool is not installed. # To make sure that doesn't happen, set these config options after activation too. _config() { LP_ENABLE_JOBS=1 LP_HOSTNAME_ALWAYS=1 LP_ENABLE_GIT=1 if [[ $reproducible == "true" ]]; then COLUMNS=160 fi } _config # Stub data functions _lp_jobcount() { lp_running_jobs=1 lp_stopped_jobs=0 } _lp_hostname() { _lp_connection lp_hostname=server } _lp_connection() { lp_connection=ssh SSH_CONNECTION="192.168.0.254 56314 192.168.0.1 22" } _lp_connected_display() { return 1; } _lp_find_vcs() { lp_vcs_type=git lp_vcs_root=$PWD } _lp_git_active() { return 0; } _lp_git_branch() { lp_vcs_branch=main } _lp_git_bookmark() { return 2; } _lp_git_tag() { return 2; } _lp_git_commit_id() { return 2; } _lp_git_head_status() { return 2; } _lp_git_stash_count() { return 2; } _lp_git_commits_off_remote() { return 2; } _lp_git_untracked_files() { return 2; } _lp_git_uncommitted_files() { return 2; } _lp_git_uncommitted_lines() { return 2; } _lp_git_unstaged_files() { return 2; } _lp_git_unstaged_lines() { return 2; } # Setup Env PWD=$HOME/liquidprompt # Activate and generate lp_activate ${activate_args[@]+"${activate_args[@]}"} _config __lp_set_prompt __remove_shell_escapes printf 'Medium prompt:\n\n%s\n\n' "$PS1" ## Long # Configure options _long_config() { LP_ENABLE_SHORTEN_PATH=1 LP_PATH_LENGTH=29 LP_PATH_KEEP=1 LP_PATH_VCS_ROOT=1 LP_ENABLE_TIME=1 LP_TIME_ANALOG=1 LP_ENABLE_BATT=1 LP_ENABLE_LOAD=1 LP_ENABLE_TEMP=1 LP_ENABLE_DETACHED_SESSIONS=1 LP_ENABLE_PERM=1 LP_ENABLE_VIRTUALENV=1 LP_ENABLE_RUNTIME=1 LP_ENABLE_ERROR=1 LP_ENABLE_DIRSTACK=1 LP_ENABLE_SHLVL=1 LP_ALWAYS_DISPLAY_VALUES=1 LP_DISPLAY_VALUES_AS_PERCENTS=1 if [[ $reproducible == "true" ]]; then COLUMNS=160 fi } _long_config # Stub data functions _lp_analog_time() { lp_analog_time="🕤" } _lp_battery() { lp_battery=24 } _lp_load() { lp_load=1.68 lp_load_adjusted=42 } _lp_temperature() { lp_temperature=90 } _lp_detached_sessions() { lp_detached_sessions=3 } _lp_jobcount() { lp_running_jobs=2 lp_stopped_jobs=1 } _lp_python_env() { lp_python_env=pyenv } _lp_find_vcs() { lp_vcs_type=git lp_vcs_root="${HOME}/code/liquidprompt" } _lp_git_uncommitted_files() { lp_vcs_uncommitted_files=2 } _lp_git_uncommitted_lines() { lp_vcs_uncommitted_i_lines=10 lp_vcs_uncommitted_d_lines=5 } _lp_git_commits_off_remote() { lp_vcs_commit_ahead=3 lp_vcs_commit_behind=1 } _lp_git_stash_count() { lp_vcs_stash_count=1 } _lp_git_untracked_files() { lp_vcs_untracked_files=1 } _lp_runtime_format() { lp_runtime_format=20s } _lp_error() { lp_error=125 } _lp_dirstack() { lp_dirstack=3 } _lp_shell_level() { lp_shell_level=2 } # Setup Env PWD="${HOME}/code/liquidprompt/docs/theme" # Activate and generate lp_activate ${activate_args[@]+"${activate_args[@]}"} _long_config __lp_set_prompt __remove_shell_escapes printf 'Long prompt:\n\n%s\n\n' "$PS1" # vim: ft=sh et sts=2 sw=2 tw=120