pax_global_header00006660000000000000000000000064142501724160014514gustar00rootroot0000000000000052 comment=6f0dc9f7dda99fe98c6dce26be5e461692782c6d liquidprompt-2.1.2/000077500000000000000000000000001425017241600142475ustar00rootroot00000000000000liquidprompt-2.1.2/.github/000077500000000000000000000000001425017241600156075ustar00rootroot00000000000000liquidprompt-2.1.2/.github/ISSUE_TEMPLATE/000077500000000000000000000000001425017241600177725ustar00rootroot00000000000000liquidprompt-2.1.2/.github/ISSUE_TEMPLATE/bug.md000066400000000000000000000023221425017241600210700ustar00rootroot00000000000000--- name: Bug report about: Create a report to help us improve Liquidprompt title: '' labels: 'bug' assignees: '' --- Shell: Operating system: Liquidprompt version: ### Steps to Reproduce 1. 2. 3. ### Expected Behavior ### Current Behavior ### Possible Solution liquidprompt-2.1.2/.github/ISSUE_TEMPLATE/config.yml000066400000000000000000000000341425017241600217570ustar00rootroot00000000000000blank_issues_enabled: false liquidprompt-2.1.2/.github/ISSUE_TEMPLATE/enhancement.md000066400000000000000000000007301425017241600226010ustar00rootroot00000000000000--- name: Feature request about: Suggest an idea for Liquidprompt title: '' labels: 'enhancement' assignees: '' --- ### Description ### How will this be useful? ### Example prompt liquidprompt-2.1.2/.github/workflows/000077500000000000000000000000001425017241600176445ustar00rootroot00000000000000liquidprompt-2.1.2/.github/workflows/docs-lint.yml000066400000000000000000000007711425017241600222700ustar00rootroot00000000000000name: Lint Documentation on: push: paths: - 'docs/**' pull_request: jobs: docs-lint: name: Lint Documentation runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 1 - name: Set up Python uses: actions/setup-python@v2 with: python-version: '3.x' - name: Lint run: | cd docs/ python3 -m pip install -r requirements.txt make dummy make linkcheck liquidprompt-2.1.2/.github/workflows/release.yml000066400000000000000000000032431425017241600220110ustar00rootroot00000000000000on: 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 steps: - name: Checkout code uses: actions/checkout@v2 with: fetch-depth: 1 - name: Set up Python uses: actions/setup-python@v2 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.tar.gz . - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} draft: true prerelease: false - name: Get the tag name id: tag_name run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/} - name: Upload Release Asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./.output/liquidprompt.tar.gz asset_name: liquidprompt-${{ steps.tag_name.outputs.tag }}.tar.gz asset_content_type: application/gzip liquidprompt-2.1.2/.github/workflows/shellcheck.yml000066400000000000000000000004571425017241600225020ustar00rootroot00000000000000name: ShellCheck on: push: paths-ignore: - 'docs/**' pull_request: jobs: shellcheck: runs-on: ubuntu-latest container: image: koalaman/shellcheck-alpine:stable steps: - uses: actions/checkout@v2 with: fetch-depth: 1 - run: ./shellcheck.sh liquidprompt-2.1.2/.github/workflows/tests.yml000066400000000000000000000007261425017241600215360ustar00rootroot00000000000000name: 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@v2 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.1.2/.mailmap000066400000000000000000000030351425017241600156710ustar00rootroot00000000000000nojhan 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.1.2/.readthedocs.yml000066400000000000000000000004131425017241600173330ustar00rootroot00000000000000# 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 python: version: 3 install: - requirements: docs/requirements.txt liquidprompt-2.1.2/CHANGELOG.md000066400000000000000000001743771425017241600161030ustar00rootroot00000000000000# 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.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()` renamed to `__lp_set_dirtrim()` ([decaece]) - **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 Liquidprompt 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**: Liquidprompt 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/nojhan/liquidprompt/compare/v2.1.2...master [2.1.2]: https://github.com/nojhan/liquidprompt/releases/tag/v2.1.2 [2.1.1]: https://github.com/nojhan/liquidprompt/releases/tag/v2.1.1 [2.1.0]: https://github.com/nojhan/liquidprompt/releases/tag/v2.1.0 [2.0.5]: https://github.com/nojhan/liquidprompt/releases/tag/v2.0.5 [2.0.4]: https://github.com/nojhan/liquidprompt/releases/tag/v2.0.4 [2.0.3]: https://github.com/nojhan/liquidprompt/releases/tag/v2.0.3 [2.0.2]: https://github.com/nojhan/liquidprompt/releases/tag/v2.0.2 [2.0.1]: https://github.com/nojhan/liquidprompt/releases/tag/v2.0.1 [2.0.0]: https://github.com/nojhan/liquidprompt/releases/tag/v2.0.0 [1.12.1]: https://github.com/nojhan/liquidprompt/releases/tag/v1.12.1 [1.12.0]: https://github.com/nojhan/liquidprompt/releases/tag/v1.12.0 [1.11]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.11 [1.10]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.10 [1.9]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.9 [1.8]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.8 [1.7]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.7 [1.6]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.6 [1.5]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.5 [1.4]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.4 [1.3]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.3 [1.2]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.2 [1.1]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.1 [1.0]: https://github.com/nojhan/liquidprompt/releases/tag/v_1.0 [#110]: https://github.com/nojhan/liquidprompt/issues/110 [#117]: https://github.com/nojhan/liquidprompt/issues/117 [#139]: https://github.com/nojhan/liquidprompt/issues/139 [#148]: https://github.com/nojhan/liquidprompt/issues/148 [#149]: https://github.com/nojhan/liquidprompt/issues/149 [#217]: https://github.com/nojhan/liquidprompt/issues/217 [#237]: https://github.com/nojhan/liquidprompt/issues/237 [#254]: https://github.com/nojhan/liquidprompt/pull/254 [#256]: https://github.com/nojhan/liquidprompt/issues/256 [#261]: https://github.com/nojhan/liquidprompt/pull/261 [#265]: https://github.com/nojhan/liquidprompt/pull/265 [#266]: https://github.com/nojhan/liquidprompt/pull/266 [#267]: https://github.com/nojhan/liquidprompt/pull/267 [#268]: https://github.com/nojhan/liquidprompt/pull/268 [#269]: https://github.com/nojhan/liquidprompt/pull/269 [#270]: https://github.com/nojhan/liquidprompt/pull/270 [#273]: https://github.com/nojhan/liquidprompt/pull/273 [#274]: https://github.com/nojhan/liquidprompt/pull/274 [#277]: https://github.com/nojhan/liquidprompt/pull/277 [#287]: https://github.com/nojhan/liquidprompt/pull/287 [#288]: https://github.com/nojhan/liquidprompt/issues/288 [#289]: https://github.com/nojhan/liquidprompt/issues/289 [#291]: https://github.com/nojhan/liquidprompt/issues/291 [#293]: https://github.com/nojhan/liquidprompt/pull/293 [#294]: https://github.com/nojhan/liquidprompt/pull/294 [#298]: https://github.com/nojhan/liquidprompt/issues/298 [#299]: https://github.com/nojhan/liquidprompt/pull/299 [#300]: https://github.com/nojhan/liquidprompt/pull/300 [#301]: https://github.com/nojhan/liquidprompt/issues/301 [#302]: https://github.com/nojhan/liquidprompt/pull/302 [#303]: https://github.com/nojhan/liquidprompt/pull/303 [#304]: https://github.com/nojhan/liquidprompt/issues/304 [#308]: https://github.com/nojhan/liquidprompt/pull/308 [#313]: https://github.com/nojhan/liquidprompt/pull/313 [#317]: https://github.com/nojhan/liquidprompt/pull/317 [#319]: https://github.com/nojhan/liquidprompt/pull/319 [#326]: https://github.com/nojhan/liquidprompt/issues/326 [#334]: https://github.com/nojhan/liquidprompt/pull/334 [#335]: https://github.com/nojhan/liquidprompt/issues/335 [#340]: https://github.com/nojhan/liquidprompt/pull/340 [#344]: https://github.com/nojhan/liquidprompt/issues/344 [#345]: https://github.com/nojhan/liquidprompt/issues/345 [#349]: https://github.com/nojhan/liquidprompt/issues/349 [#354]: https://github.com/nojhan/liquidprompt/issues/354 [#355]: https://github.com/nojhan/liquidprompt/pull/355 [#357]: https://github.com/nojhan/liquidprompt/pull/357 [#360]: https://github.com/nojhan/liquidprompt/issues/360 [#361]: https://github.com/nojhan/liquidprompt/pull/361 [#363]: https://github.com/nojhan/liquidprompt/issues/363 [#365]: https://github.com/nojhan/liquidprompt/pull/365 [#369]: https://github.com/nojhan/liquidprompt/pull/369 [#370]: https://github.com/nojhan/liquidprompt/issues/370 [#371]: https://github.com/nojhan/liquidprompt/pull/371 [#372]: https://github.com/nojhan/liquidprompt/pull/372 [#379]: https://github.com/nojhan/liquidprompt/issues/379 [#380]: https://github.com/nojhan/liquidprompt/pull/380 [#381]: https://github.com/nojhan/liquidprompt/pull/381 [#387]: https://github.com/nojhan/liquidprompt/pull/387 [#389]: https://github.com/nojhan/liquidprompt/issues/389 [#390]: https://github.com/nojhan/liquidprompt/pull/390 [#391]: https://github.com/nojhan/liquidprompt/pull/391 [#404]: https://github.com/nojhan/liquidprompt/pull/404 [#406]: https://github.com/nojhan/liquidprompt/pull/406 [#407]: https://github.com/nojhan/liquidprompt/issues/407 [#409]: https://github.com/nojhan/liquidprompt/pull/409 [#410]: https://github.com/nojhan/liquidprompt/issues/410 [#415]: https://github.com/nojhan/liquidprompt/issues/415 [#416]: https://github.com/nojhan/liquidprompt/pull/416 [#420]: https://github.com/nojhan/liquidprompt/issues/420 [#423]: https://github.com/nojhan/liquidprompt/pull/423 [#425]: https://github.com/nojhan/liquidprompt/pull/425 [#427]: https://github.com/nojhan/liquidprompt/pull/427 [#430]: https://github.com/nojhan/liquidprompt/pull/430 [#432]: https://github.com/nojhan/liquidprompt/pull/432 [#433]: https://github.com/nojhan/liquidprompt/pull/433 [#443]: https://github.com/nojhan/liquidprompt/pull/443 [#444]: https://github.com/nojhan/liquidprompt/pull/444 [#445]: https://github.com/nojhan/liquidprompt/issues/445 [#450]: https://github.com/nojhan/liquidprompt/issues/450 [#451]: https://github.com/nojhan/liquidprompt/issues/451 [#453]: https://github.com/nojhan/liquidprompt/pull/453 [#455]: https://github.com/nojhan/liquidprompt/pull/455 [#461]: https://github.com/nojhan/liquidprompt/issues/461 [#462]: https://github.com/nojhan/liquidprompt/pull/462 [#463]: https://github.com/nojhan/liquidprompt/issues/463 [#469]: https://github.com/nojhan/liquidprompt/issues/469 [#472]: https://github.com/nojhan/liquidprompt/issues/472 [#472]: https://github.com/nojhan/liquidprompt/issues/472 [#474]: https://github.com/nojhan/liquidprompt/issues/474 [#476]: https://github.com/nojhan/liquidprompt/pull/476 [#479]: https://github.com/nojhan/liquidprompt/issues/479 [#480]: https://github.com/nojhan/liquidprompt/pull/480 [#483]: https://github.com/nojhan/liquidprompt/issues/483 [#486]: https://github.com/nojhan/liquidprompt/issues/486 [#496]: https://github.com/nojhan/liquidprompt/pull/496 [#497]: https://github.com/nojhan/liquidprompt/pull/497 [#499]: https://github.com/nojhan/liquidprompt/issues/499 [#501]: https://github.com/nojhan/liquidprompt/issues/501 [#503]: https://github.com/nojhan/liquidprompt/pull/503 [#506]: https://github.com/nojhan/liquidprompt/issues/506 [#508]: https://github.com/nojhan/liquidprompt/pull/508 [#509]: https://github.com/nojhan/liquidprompt/pull/509 [#517]: https://github.com/nojhan/liquidprompt/issues/517 [#520]: https://github.com/nojhan/liquidprompt/issues/520 [#522]: https://github.com/nojhan/liquidprompt/issues/522 [#523]: https://github.com/nojhan/liquidprompt/pull/523 [#524]: https://github.com/nojhan/liquidprompt/issues/524 [#524]: https://github.com/nojhan/liquidprompt/issues/524 [#527]: https://github.com/nojhan/liquidprompt/issues/527 [#530]: https://github.com/nojhan/liquidprompt/issues/530 [#543]: https://github.com/nojhan/liquidprompt/issues/543 [#548]: https://github.com/nojhan/liquidprompt/issues/548 [#549]: https://github.com/nojhan/liquidprompt/pull/549 [#552]: https://github.com/nojhan/liquidprompt/issues/552 [#563]: https://github.com/nojhan/liquidprompt/issues/563 [#564]: https://github.com/nojhan/liquidprompt/issues/564 [#569]: https://github.com/nojhan/liquidprompt/issues/569 [#571]: https://github.com/nojhan/liquidprompt/pull/571 [#578]: https://github.com/nojhan/liquidprompt/pull/578 [#581]: https://github.com/nojhan/liquidprompt/issues/581 [#582]: https://github.com/nojhan/liquidprompt/pull/582 [#592]: https://github.com/nojhan/liquidprompt/issues/592 [#596]: https://github.com/nojhan/liquidprompt/issues/596 [#604]: https://github.com/nojhan/liquidprompt/pull/604 [#605]: https://github.com/nojhan/liquidprompt/pull/605 [#606]: https://github.com/nojhan/liquidprompt/issues/606 [#607]: https://github.com/nojhan/liquidprompt/issues/607 [#609]: https://github.com/nojhan/liquidprompt/issues/609 [#612]: https://github.com/nojhan/liquidprompt/issues/612 [#613]: https://github.com/nojhan/liquidprompt/issues/613 [#614]: https://github.com/nojhan/liquidprompt/issues/614 [#615]: https://github.com/nojhan/liquidprompt/issues/615 [#623]: https://github.com/nojhan/liquidprompt/pull/623 [#625]: https://github.com/nojhan/liquidprompt/pull/625 [#626]: https://github.com/nojhan/liquidprompt/issues/626 [#628]: https://github.com/nojhan/liquidprompt/pull/628 [#635]: https://github.com/nojhan/liquidprompt/pull/635 [#637]: https://github.com/nojhan/liquidprompt/pull/637 [#644]: https://github.com/nojhan/liquidprompt/issues/644 [#648]: https://github.com/nojhan/liquidprompt/pull/648 [#649]: https://github.com/nojhan/liquidprompt/pull/649 [#650]: https://github.com/nojhan/liquidprompt/pull/650 [#656]: https://github.com/nojhan/liquidprompt/issues/656 [#657]: https://github.com/nojhan/liquidprompt/issues/657 [#658]: https://github.com/nojhan/liquidprompt/issues/658 [#662]: https://github.com/nojhan/liquidprompt/pull/662 [#663]: https://github.com/nojhan/liquidprompt/pull/663 [#664]: https://github.com/nojhan/liquidprompt/pull/664 [#665]: https://github.com/nojhan/liquidprompt/pull/665 [#667]: https://github.com/nojhan/liquidprompt/issues/667 [#669]: https://github.com/nojhan/liquidprompt/pull/669 [#670]: https://github.com/nojhan/liquidprompt/issues/670 [#671]: https://github.com/nojhan/liquidprompt/pull/671 [#672]: https://github.com/nojhan/liquidprompt/pull/672 [#673]: https://github.com/nojhan/liquidprompt/pull/673 [#676]: https://github.com/nojhan/liquidprompt/issues/676 [#678]: https://github.com/nojhan/liquidprompt/pull/678 [#679]: https://github.com/nojhan/liquidprompt/pull/679 [#681]: https://github.com/nojhan/liquidprompt/pull/681 [#684]: https://github.com/nojhan/liquidprompt/issues/684 [#686]: https://github.com/nojhan/liquidprompt/issues/686 [#688]: https://github.com/nojhan/liquidprompt/pull/688 [#689]: https://github.com/nojhan/liquidprompt/pull/689 [#690]: https://github.com/nojhan/liquidprompt/issues/690 [#695]: https://github.com/nojhan/liquidprompt/issues/695 [#696]: https://github.com/nojhan/liquidprompt/issues/696 [#701]: https://github.com/nojhan/liquidprompt/issues/701 [#702]: https://github.com/nojhan/liquidprompt/pull/702 [#708]: https://github.com/nojhan/liquidprompt/issues/708 [#709]: https://github.com/nojhan/liquidprompt/issues/709 [#713]: https://github.com/nojhan/liquidprompt/issues/713 [#715]: https://github.com/nojhan/liquidprompt/issues/715 [0200b99]: https://github.com/nojhan/liquidprompt/commit/0200b99ebd8485ba8ba2c91da7703e87c40ec15d [0234a58]: https://github.com/nojhan/liquidprompt/commit/0234a581d023fb6c40e5339f6dcbd619a33b4553 [02bc49e]: https://github.com/nojhan/liquidprompt/commit/02bc49edf306749c47d7a389dc916cb68e992cc8 [03434d3]: https://github.com/nojhan/liquidprompt/commit/03434d388686792b6ed2aa0bf0e09851c90a7479 [0368523]: https://github.com/nojhan/liquidprompt/commit/036852371680a9e92d7e341be604088e8dc0519b [03c73fe]: https://github.com/nojhan/liquidprompt/commit/03c73fe05e5a3b48252a9f527e6e62666afbd726 [0548290]: https://github.com/nojhan/liquidprompt/commit/05482901fe86788032ab4089525c415384937a24 [05e0a50]: https://github.com/nojhan/liquidprompt/commit/05e0a502e8ae4e2a4711f5222f39c2589c6f582f [07be967]: https://github.com/nojhan/liquidprompt/commit/07be96765bbd742c5c2846ef6adbb0c253948216 [07d18d4]: https://github.com/nojhan/liquidprompt/commit/07d18d4ca3f4a77377591d62dc054e00f4616cc7 [09cfced]: https://github.com/nojhan/liquidprompt/commit/09cfced24745dd7aea086a292ab042f070ce4fbb [0b94b74]: https://github.com/nojhan/liquidprompt/commit/0b94b74d02046077a21d3fb83842c6a1fe74f6e5 [0c23a33]: https://github.com/nojhan/liquidprompt/commit/0c23a33eacc6ced0febc1a750c748010c3a87ad5 [0ce7646]: https://github.com/nojhan/liquidprompt/commit/0ce764653a5f000598b6ad11c974fcefb65832da [0d420d2]: https://github.com/nojhan/liquidprompt/commit/0d420d2f3ac84a83e150110f9e09fc21e919df7f [0e0cc12]: https://github.com/nojhan/liquidprompt/commit/0e0cc12fabc474b6c0cfed7abf80c9f61efb68fc [0e0cc87]: https://github.com/nojhan/liquidprompt/commit/0e0cc870c2dcf3fbfed1b2e187e918d74dd6d3db [0f0fd37]: https://github.com/nojhan/liquidprompt/commit/0f0fd3739a8dd9821b34b78859de13b47b2d856d [0f80162]: https://github.com/nojhan/liquidprompt/commit/0f80162f1f22277e497b69f243894a87fcaec643 [13e128b]: https://github.com/nojhan/liquidprompt/commit/13e128bb320034a0303f7354fad66a5674c6b4da [145f146]: https://github.com/nojhan/liquidprompt/commit/145f146e9cb4fb3c30a22e6c35529120f4650a28 [1a22e1e]: https://github.com/nojhan/liquidprompt/commit/1a22e1ec54ad46a311ed9bdd65ed2bd1459e606e [1a56d58]: https://github.com/nojhan/liquidprompt/commit/1a56d58d4e63f395545fed820278c5b4561dfa95 [1a9fcd0]: https://github.com/nojhan/liquidprompt/commit/1a9fcd0944711ccab20045e5a3f3bde9d7f0ec59 [1be52e0]: https://github.com/nojhan/liquidprompt/commit/1be52e0d048f68db9ab0ffd2f4d2a4212b685f93 [1c65748]: https://github.com/nojhan/liquidprompt/commit/1c657481fd3481720b54187f9aa464df0e62a3f2 [1fc0308]: https://github.com/nojhan/liquidprompt/commit/1fc030813069ebc0cfc0542d049a9e4998100490 [1fe1559]: https://github.com/nojhan/liquidprompt/commit/1fe1559ebb18ae2ff39e1c4703a06d35f0f6538f [22dd760]: https://github.com/nojhan/liquidprompt/commit/22dd760926c3a7b8e4f4fa28902d43b06e68e6a8 [230c9d7]: https://github.com/nojhan/liquidprompt/commit/230c9d7d45c10b8f319b9d5c64b4fd59261c8008 [239a574]: https://github.com/nojhan/liquidprompt/commit/239a5740866962a40a614057065188810830207d [23eb3f2]: https://github.com/nojhan/liquidprompt/commit/23eb3f23b633a8e849f91867948c96976108df6b [282359a]: https://github.com/nojhan/liquidprompt/commit/282359a4b7c80a6032ec043eddb1bf378084e64e [28c13f2]: https://github.com/nojhan/liquidprompt/commit/28c13f27e652b84373a7c73389cbd0a5a10b88c3 [2d659f0]: https://github.com/nojhan/liquidprompt/commit/2d659f04628a804409e6262733f0f909c3c2675b [3079299]: https://github.com/nojhan/liquidprompt/commit/3079299f816ee2d893c2b7c2284e9e6034164d16 [309b443]: https://github.com/nojhan/liquidprompt/commit/309b443461a25f552754663d3d67a5ee0f97571f [30f977b]: https://github.com/nojhan/liquidprompt/commit/30f977b09f6ee36c38e1ec07a272b5b0e621729f [36ab8fa]: https://github.com/nojhan/liquidprompt/commit/36ab8fa8ff7c27284163aebbfcb9f82fc2f572ac [37db052]: https://github.com/nojhan/liquidprompt/commit/37db052c18d99fc36f4c4a4ede798155e519e2ca [3b75185]: https://github.com/nojhan/liquidprompt/commit/3b751856bfe701f38f842e8ae96d803a3990f13d [3e615cd]: https://github.com/nojhan/liquidprompt/commit/3e615cded01b583870a7e6e9529f341280eb40a6 [3f57231]: https://github.com/nojhan/liquidprompt/commit/3f57231d73112ea1090e3a607539e515f21de794 [3fadce9]: https://github.com/nojhan/liquidprompt/commit/3fadce962396d6d3a1f7c2c8e23c1d9fdc22c098 [40c4331]: https://github.com/nojhan/liquidprompt/commit/40c4331f6eda1cb836e8ae62426cb7755fdec371 [44e3a6f]: https://github.com/nojhan/liquidprompt/commit/44e3a6fe8ea9aa61f7cedb32286eb321fc93c6ed [454112f]: https://github.com/nojhan/liquidprompt/commit/454112f385c49e0bdf408ffd6123f8eaa39d0b0c [4572bd0]: https://github.com/nojhan/liquidprompt/commit/4572bd02fa289b989de3d24e246be187dbd25f65 [45f8091]: https://github.com/nojhan/liquidprompt/commit/45f80913da7aaf869a80288c5433c4d71ffc28c4 [461f0ee]: https://github.com/nojhan/liquidprompt/commit/461f0ee05e1466a0f14afebcbc2aaeabe711e38a [46918f6]: https://github.com/nojhan/liquidprompt/commit/46918f62ef80f26bec379a5542d669654e5e3280 [46df995]: https://github.com/nojhan/liquidprompt/commit/46df99503698c838ad6bb9c030a271e9fda87b15 [48f1b02]: https://github.com/nojhan/liquidprompt/commit/48f1b022dd078ce45f786a28dbe75a8acea37031 [4a52696]: https://github.com/nojhan/liquidprompt/commit/4a526965cba546978423a4d51bfbb0a2d1000246 [4b7fd88]: https://github.com/nojhan/liquidprompt/commit/4b7fd88da0777d005d67d28d285be9255f1666c7 [4c8ac92]: https://github.com/nojhan/liquidprompt/commit/4c8ac9219f4191a458a9d472360f54d24060f2d6 [4ebc26e]: https://github.com/nojhan/liquidprompt/commit/4ebc26e92be20ddf5d068fb25d2cecfcf479c1ea [4fff496]: https://github.com/nojhan/liquidprompt/commit/4fff49644a86fe93f1373825f09e1b1fdfb20f54 [5069c22]: https://github.com/nojhan/liquidprompt/commit/5069c22dbece5ef8726b1393df5ae91550a2b3fe [5076dbe]: https://github.com/nojhan/liquidprompt/commit/5076dbe68788586f317c4d0590e1ea60e4dec07a [5425a5e]: https://github.com/nojhan/liquidprompt/commit/5425a5eb56433d4332441d37eae69d159ab456c1 [5813a71]: https://github.com/nojhan/liquidprompt/commit/5813a710fc0feb2970e1d1e6615f822777b111c7 [58693b0]: https://github.com/nojhan/liquidprompt/commit/58693b0664964e2a06b46fa8d5bdffd23ada417f [58969b2]: https://github.com/nojhan/liquidprompt/commit/58969b205f484dbf9ac5c151db81a2cc4c3762d6 [59078f0]: https://github.com/nojhan/liquidprompt/commit/59078f04622ea7b1c658e214435724d46307a443 [5a9293d]: https://github.com/nojhan/liquidprompt/commit/5a9293db78cad4739f2b105e1c438d21372c25f1 [5bd80ce]: https://github.com/nojhan/liquidprompt/commit/5bd80ce1da07adc501a46c375eae0ca741f3960e [5c56e65]: https://github.com/nojhan/liquidprompt/commit/5c56e65888d92f9f0239096c02ac86e568d53ad1 [5cfd2c2]: https://github.com/nojhan/liquidprompt/commit/5cfd2c2e7a892d1435cfd7b61cce697d5658db5c [5ee3c53]: https://github.com/nojhan/liquidprompt/commit/5ee3c53cbbc95b5288fe5baf5a3c5b21d2a7212d [5ef795d]: https://github.com/nojhan/liquidprompt/commit/5ef795d262839e99183db00a3dc7572e06f9b610 [5f8fcc4]: https://github.com/nojhan/liquidprompt/commit/5f8fcc46eade20015291833118055b7cd76a5c0a [5fa9054]: https://github.com/nojhan/liquidprompt/commit/5fa905481c9c7c4579cadc0065648b6617b9c775 [6085cd2]: https://github.com/nojhan/liquidprompt/commit/6085cd21b958c16853c3bb5ea7bfdb7daf11e2cf [61df03a]: https://github.com/nojhan/liquidprompt/commit/61df03a02367e29f80d470196b4cc193729ef37a [62f0270]: https://github.com/nojhan/liquidprompt/commit/62f0270888ec668ec50df2af826727ca8ba9d6c6 [63b9f73]: https://github.com/nojhan/liquidprompt/commit/63b9f73d72218d4e72c0d43bc6a60a82ea0e15e8 [64029ad]: https://github.com/nojhan/liquidprompt/commit/64029ad75d108a0619958c337fd64fe18560988e [66d1d2b]: https://github.com/nojhan/liquidprompt/commit/66d1d2ba3baade138d7470317aca527c138732fe [67dc0a9]: https://github.com/nojhan/liquidprompt/commit/67dc0a9ae9eebf0c2b85b4ee6fc2d6b5562b6412 [695d629]: https://github.com/nojhan/liquidprompt/commit/695d629dd5cf7109e8892075d4cf7fadd8c17d94 [6961f99]: https://github.com/nojhan/liquidprompt/commit/6961f998b83f491995ce731bd232c5170cf4be5f [69c75a3]: https://github.com/nojhan/liquidprompt/commit/69c75a3e6c4998d682e480fb3df935e4eb224444 [6cdb860]: https://github.com/nojhan/liquidprompt/commit/6cdb86006e4d2ad6dee06e60e229842144305594 [6d94db6]: https://github.com/nojhan/liquidprompt/commit/6d94db6de7de879c14da842df535163a57dce638 [6ea54e9]: https://github.com/nojhan/liquidprompt/commit/6ea54e91f84be1c491314c3680e82b06d769218e [70b4ef6]: https://github.com/nojhan/liquidprompt/commit/70b4ef65c034c5050173dbe70178b459e5acddc2 [70ce708]: https://github.com/nojhan/liquidprompt/commit/70ce708b8142d71647c14817cb40801c5dfdb756 [73f2057]: https://github.com/nojhan/liquidprompt/commit/73f205748fe6f09abcfe01ec150a456518aecc18 [7402f79]: https://github.com/nojhan/liquidprompt/commit/7402f79a7518e74e16d36c74e8b5943d11f390d7 [7602c09]: https://github.com/nojhan/liquidprompt/commit/7602c09fd7754f371db98bfad15bc075ef1ec93a [77dc561]: https://github.com/nojhan/liquidprompt/commit/77dc561c707a88ab9158f3f00231137f8f34c624 [782fad0]: https://github.com/nojhan/liquidprompt/commit/782fad08fd37cbf2144ea203430f37608b156ae8 [78dee3c]: https://github.com/nojhan/liquidprompt/commit/78dee3c70ab73eee04a5e869172e5f07ac916774 [7c21470]: https://github.com/nojhan/liquidprompt/commit/7c214708d72a4fa7d298678167450693a1ffbc00 [7db4ada]: https://github.com/nojhan/liquidprompt/commit/7db4ada711c5e9859ea79a11a1d03ca7d7311547 [7e7734e]: https://github.com/nojhan/liquidprompt/commit/7e7734e6247a1b32d636b5e39fe99d8d23dde669 [81b080e]: https://github.com/nojhan/liquidprompt/commit/81b080e2a6e6c24a3bab9348c187fb308c25ffe8 [82ee823]: https://github.com/nojhan/liquidprompt/commit/82ee823e9cd2fb8581b653b38c4ea501b795a607 [8605378]: https://github.com/nojhan/liquidprompt/commit/86053782d08b0d41ca69f4f45dde9ce619db1008 [862dcfb]: https://github.com/nojhan/liquidprompt/commit/862dcfbe6c82bf4e4125cf584a010161a533b917 [884c069]: https://github.com/nojhan/liquidprompt/commit/884c0697b71b0f87e2ea2a88159e08d33d3c6088 [89540d3]: https://github.com/nojhan/liquidprompt/commit/89540d312543b897b3c116370deabdfe9db15dcb [8a987f4]: https://github.com/nojhan/liquidprompt/commit/8a987f436ffc6144eab1dadaacad9c460b9bfa1f [8bf1772]: https://github.com/nojhan/liquidprompt/commit/8bf1772d771904bd2095a974b35795c9db2c96cc [8cb609d]: https://github.com/nojhan/liquidprompt/commit/8cb609d49cc1ba92f09adc87e3fbed243d04626e [8da3314]: https://github.com/nojhan/liquidprompt/commit/8da33144c89075dfd2309feaa718ccf3fe693ff6 [8de1a72]: https://github.com/nojhan/liquidprompt/commit/8de1a729f7190612d573218625dc1aaf4c2f78bf [8f730c8]: https://github.com/nojhan/liquidprompt/commit/8f730c8eb7b2488093db47045db1bcd239b02b9a [9038ec8]: https://github.com/nojhan/liquidprompt/commit/9038ec8884f11f7cf47fbfee1c86b9dbf6440307 [93df016]: https://github.com/nojhan/liquidprompt/commit/93df0169499c4ca8563add267e95dcd343d95f12 [954bace]: https://github.com/nojhan/liquidprompt/commit/954bace48637528795743785c4cc8cb42f204a7e [9604203]: https://github.com/nojhan/liquidprompt/commit/9604203fb9f90b44a8c806f32e7746588b70a83b [9633ac8]: https://github.com/nojhan/liquidprompt/commit/9633ac83cad5f5702c1e853940c0ab2e166961bf [9a00ead]: https://github.com/nojhan/liquidprompt/commit/9a00eada113cb1d5e33aa177f5b9180c25d6a843 [9a2c067]: https://github.com/nojhan/liquidprompt/commit/9a2c06709544ce7609b432aa03d81f7cf4750283 [9b40ca1]: https://github.com/nojhan/liquidprompt/commit/9b40ca139a43e51b4d0fbdc780d0661bfffbf6ae [9ba5d28]: https://github.com/nojhan/liquidprompt/commit/9ba5d2824571d41c1aa7a3573a3cf17ed729f2bb [9ba6e86]: https://github.com/nojhan/liquidprompt/commit/9ba6e86f8200c08543502185447185a5a4089685 [9c1c8a3]: https://github.com/nojhan/liquidprompt/commit/9c1c8a378846c23e0a39be2aadd11531c2ecf196 [9c6d073]: https://github.com/nojhan/liquidprompt/commit/9c6d073e3cc7a49cfce209ce4307881d70340161 [9e205f5]: https://github.com/nojhan/liquidprompt/commit/9e205f51db459443e5c2ead0efa76f6a33c47c24 [a1d0a54]: https://github.com/nojhan/liquidprompt/commit/a1d0a54027dba5efc5acccc630b2be432e705f67 [a23af79]: https://github.com/nojhan/liquidprompt/commit/a23af79232fc3b716dc54bc3927b3e05bd777189 [a314677]: https://github.com/nojhan/liquidprompt/commit/a314677b8031804130c69de94d4604e9c319575a [a35032f]: https://github.com/nojhan/liquidprompt/commit/a35032fe03ab3d84093141c403a7c6615f7c38d9 [a70e80f]: https://github.com/nojhan/liquidprompt/commit/a70e80f0f501031ef97ea8baf88ca6d7ef56ad8a [a8114dd]: https://github.com/nojhan/liquidprompt/commit/a8114dd9550e2e7fd33b93eb7885de08b3e64933 [a8571bb]: https://github.com/nojhan/liquidprompt/commit/a8571bb2920d9f11006754e634304242d929db57 [a8aa8c9]: https://github.com/nojhan/liquidprompt/commit/a8aa8c94ca6b3d6486195a2d03cf7868d995f3a2 [a97c0da]: https://github.com/nojhan/liquidprompt/commit/a97c0da0e6a6f037a6038c427a51a9ee840b45f2 [aa870b5]: https://github.com/nojhan/liquidprompt/commit/aa870b54d27cd6deda50a24f2030511d8a23c45e [acb5430]: https://github.com/nojhan/liquidprompt/commit/acb54302d9711c6b7b8b68bc8a692ef232fb09d4 [ae769dc]: https://github.com/nojhan/liquidprompt/commit/ae769dc9a71df27c24025a6bd29e840f4d97ce08 [af8382b]: https://github.com/nojhan/liquidprompt/commit/af8382b56833e8ce08834c61c70c6eda805b413f [afe3195]: https://github.com/nojhan/liquidprompt/commit/afe319526a14e6ab73fba175c06e7a45188a37c4 [b1a3145]: https://github.com/nojhan/liquidprompt/commit/b1a3145ae5432e39ff85d144207eb490f3af341a [b523025]: https://github.com/nojhan/liquidprompt/commit/b523025221c2c9084a933cf545fa9cb999916323 [b53e53b]: https://github.com/nojhan/liquidprompt/commit/b53e53b6a5a5b783896b8fd75d341dbb1d7d5e5c [b699dea]: https://github.com/nojhan/liquidprompt/commit/b699dea7aec3b081292becf52fa1899fe82c3c8b [bb19836]: https://github.com/nojhan/liquidprompt/commit/bb198362d78310905ef213bbdedce1ace5002b99 [bc120d5]: https://github.com/nojhan/liquidprompt/commit/bc120d50c265ece6158317ddea0488919e0747dd [bcefaf3]: https://github.com/nojhan/liquidprompt/commit/bcefaf32e9e301e13706fc5c39de814c1a2630aa [bf2b9c6]: https://github.com/nojhan/liquidprompt/commit/bf2b9c60a788c32f38078f580b79ba80540d3bdf [c0e74b8]: https://github.com/nojhan/liquidprompt/commit/c0e74b8953db777e1ae84fa5faa3620af5247511 [c3d4970]: https://github.com/nojhan/liquidprompt/commit/c3d49708e598a79eca50caa0f96fca6230ce204e [c7b5003]: https://github.com/nojhan/liquidprompt/commit/c7b5003616d769ac1a4edc06d28ba6b84bfe0418 [c946155]: https://github.com/nojhan/liquidprompt/commit/c9461552d9618548d4a858b0153671cf0fdbdac3 [c98f16d]: https://github.com/nojhan/liquidprompt/commit/c98f16d52f9cc22723679124c3d64b06cbcb6e6e [c9bdefe]: https://github.com/nojhan/liquidprompt/commit/c9bdefe020c30bb053c0815a1633e5e3be25e4ef [cad6286]: https://github.com/nojhan/liquidprompt/commit/cad6286b6f923376a05ebe8c13a4302e91a9cfe3 [cafb8b2]: https://github.com/nojhan/liquidprompt/commit/cafb8b2e5388fd9336c316248908881a8d66a4a5 [cb9d71b]: https://github.com/nojhan/liquidprompt/commit/cb9d71b952954006ebedd66a7ea63de7562f9676 [cc1be7e]: https://github.com/nojhan/liquidprompt/commit/cc1be7e29d1b7fa6ef25e960e02da6612ff8bde9 [cef9cb1]: https://github.com/nojhan/liquidprompt/commit/cef9cb1581a419f7c7248954069fd0d4e5966284 [cf01d02]: https://github.com/nojhan/liquidprompt/commit/cf01d02445c38ee9504bad00f079af080a7bdfe2 [cf8bf97]: https://github.com/nojhan/liquidprompt/commit/cf8bf97b01a83a939eadc31b9da806172c91c444 [d41b5c8]: https://github.com/nojhan/liquidprompt/commit/d41b5c8361381fcc785494f5552a2b5319c3c9d1 [d485ed1]: https://github.com/nojhan/liquidprompt/commit/d485ed191fb6b896290a32848c4fefd0342e2046 [d62bf31]: https://github.com/nojhan/liquidprompt/commit/d62bf310d0d5a30fac6d047f03d832b81070c884 [d9cb55d]: https://github.com/nojhan/liquidprompt/commit/d9cb55da834720ac3cd4893bb4a35808ab67d376 [dc11eb4]: https://github.com/nojhan/liquidprompt/commit/dc11eb48ecb133930355f396578e5c9b06b49afc [dc7be25]: https://github.com/nojhan/liquidprompt/commit/dc7be2540d677600a484dcd0c2d05dc0945382e5 [dd1f8f8]: https://github.com/nojhan/liquidprompt/commit/dd1f8f873e6d71b9dc9d9a820cd7fe1a3f313c67 [dd9a024]: https://github.com/nojhan/liquidprompt/commit/dd9a024b485d9c017aa935809bd20e7436dff46c [debb794]: https://github.com/nojhan/liquidprompt/commit/debb794bf2f99ab53d539e5080f0b28579333cb8 [decaece]: https://github.com/nojhan/liquidprompt/commit/decaece03b9bfe826d7f33a3fb56dfb33916884a [df5b88a]: https://github.com/nojhan/liquidprompt/commit/df5b88a93d51ae6da220fb23c8737b53b07a8e7c [e058b61]: https://github.com/nojhan/liquidprompt/commit/e058b619ce80918d3cdf924e07220a7028a8bb1b [e121179]: https://github.com/nojhan/liquidprompt/commit/e121179d1bb943ec3673e451deac2a0577adbb75 [e122d21]: https://github.com/nojhan/liquidprompt/commit/e122d21ba14f2bdfe5fa88b70083249456c67b5b [e1f8bd5]: https://github.com/nojhan/liquidprompt/commit/e1f8bd585d5dfc41d21d4bf88343f3a30fb3d071 [e2ba86e]: https://github.com/nojhan/liquidprompt/commit/e2ba86e0e5fc8bf5191cf8d8ac6aa1cd2b81a596 [e48856b]: https://github.com/nojhan/liquidprompt/commit/e48856b59e51731b7accab27e679154bcff53ed4 [e5047c0]: https://github.com/nojhan/liquidprompt/commit/e5047c0bbc1e95f811ae56265306851d3d5769e4 [e843ccf]: https://github.com/nojhan/liquidprompt/commit/e843ccfd7c719f84baf7e628697f78ff59703e5d [e927985]: https://github.com/nojhan/liquidprompt/commit/e9279856c4af191d501e8e46898dde3b4447e6dd [e9c35dd]: https://github.com/nojhan/liquidprompt/commit/e9c35ddeb473da1ac24eb27331b8974f3ba05237 [eb30942]: https://github.com/nojhan/liquidprompt/commit/eb309422009c8f8e2a105381317b71ace5d42e13 [eb6dafc]: https://github.com/nojhan/liquidprompt/commit/eb6dafc314a3dc1fc5ca560d79c408db81af0288 [ed4f383]: https://github.com/nojhan/liquidprompt/commit/ed4f3832fe2f7380ec1b7949777fffe2a7f63f34 [edc490f]: https://github.com/nojhan/liquidprompt/commit/edc490f3a3e92e9b0a94e9021a0589d64c6a7881 [ee63435]: https://github.com/nojhan/liquidprompt/commit/ee6343567d2178cd57daa89498868be6ea2ef156 [f2276fc]: https://github.com/nojhan/liquidprompt/commit/f2276fc29530fcba63bd5602364e20187a8d44c6 [f3404f9]: https://github.com/nojhan/liquidprompt/commit/f3404f99d3c08a5811eec0a8c326abe6763c6c14 [f35d9ac]: https://github.com/nojhan/liquidprompt/commit/f35d9acfddacc1f7f74174b45cf4c4aa9c84beca [f3f20ec]: https://github.com/nojhan/liquidprompt/commit/f3f20ecbe0309842ab43d36c006e75928cd5dae4 [f434b6d]: https://github.com/nojhan/liquidprompt/commit/f434b6dc663d704e9d616b8864908371862b9e23 [f436867]: https://github.com/nojhan/liquidprompt/commit/f4368670bf258257fece5611a9aad17e88f10b5a [f445eff]: https://github.com/nojhan/liquidprompt/commit/f445eff684558e8bf200df2f3f897c09374b7d6c [f4636e6]: https://github.com/nojhan/liquidprompt/commit/f4636e66455a80586f20bb1ea9624a15299cea58 [f4afc5d]: https://github.com/nojhan/liquidprompt/commit/f4afc5d0a8f776c96308001fcdae4a5aa1dac2bd [f681cdf]: https://github.com/nojhan/liquidprompt/commit/f681cdf9d8dd1d847aaf5f0b69222606a181c648 [f86a097]: https://github.com/nojhan/liquidprompt/commit/f86a097d5eb9cab2a2fbca7629e9c2c389f1e12e [f8c1c47]: https://github.com/nojhan/liquidprompt/commit/f8c1c4770aab0a1c15f3e17b0b47a421f024f1b7 [f9038e0]: https://github.com/nojhan/liquidprompt/commit/f9038e0331df1dfedbeb442c84ec62d63a90c37d [f9fd12e]: https://github.com/nojhan/liquidprompt/commit/f9fd12eed963ce2d64762e09b04adb06e00692a4 [fabc775]: https://github.com/nojhan/liquidprompt/commit/fabc775cb8bfe1be5a39cf577d2d2187398881b0 [fb123f4]: https://github.com/nojhan/liquidprompt/commit/fb123f4c5eee08c265eb91cc5a4d3de7e9c6c75d [fdbd7ca]: https://github.com/nojhan/liquidprompt/commit/fdbd7ca545a2847fb3e862a6088740aa2a06c799 [fe9919f]: https://github.com/nojhan/liquidprompt/commit/fe9919f5e7dc01ba59cc85a128fea94e5b2163c4 [fefbe01]: https://github.com/nojhan/liquidprompt/commit/fefbe01d9830a9033bdb008c454c0d0590548638 liquidprompt-2.1.2/CONTRIBUTING.md000066400000000000000000000162711425017241600165070ustar00rootroot00000000000000# 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/nojhan/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/nojhan/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/nojhan/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/nojhan/liquidprompt/wiki/FAQ) and open [Issues](https://github.com/nojhan/liquidprompt/issues)** so you don't duplicate a feature request. [Open a new Issue](https://github.com/nojhan/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/nojhan/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/nojhan/liquidprompt/wiki/Shell-standards) for our standards on shell language. ### How do I make a pull request?? $ git clone -o upstream git://github.com/nojhan/liquidprompt.git $ cd liquidprompt # Run liquidprompt 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. ### 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. 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.1.2/CONTRIBUTORS.md000066400000000000000000000161701425017241600165330ustar00rootroot00000000000000# 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) ### 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) ### 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) ### 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 liquidprompt-2.1.2/LICENSE000066400000000000000000001033301425017241600152540ustar00rootroot00000000000000 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.1.2/README.md000066400000000000000000000045101425017241600155260ustar00rootroot00000000000000Liquid Prompt — a useful adaptive prompt for Bash & zsh ======================================================= ![Tests](https://github.com/nojhan/liquidprompt/workflows/tests/badge.svg) [![Documentation Status](https://readthedocs.org/projects/liquidprompt/badge/?version=stable)](https://liquidprompt.readthedocs.io/) Liquid Prompt gives you a nicely displayed prompt with useful information when you need it. 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. ![Screenshot](https://raw.github.com/nojhan/liquidprompt/master/demo.png) ## Documentation 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). 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. ## 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 `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](https://dn-works.com/ufas/) font, designed by Georges Douros, is known to work well. On Debian or Ubuntu install try the `fonts-symbola` or `ttf-ancient-fonts` package. * 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. ## Authors Current Maintainer: [Rycieos](https://github.com/Rycieos) And many [contributors](CONTRIBUTORS.md)! liquidprompt-2.1.2/contrib/000077500000000000000000000000001425017241600157075ustar00rootroot00000000000000liquidprompt-2.1.2/contrib/README.md000066400000000000000000000017071425017241600171730ustar00rootroot00000000000000# liquidprompt/contrib Policy This directory contains files that have been contributed by contributors but that the core Liquidprompt 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.1.2/contrib/dist/000077500000000000000000000000001425017241600166525ustar00rootroot00000000000000liquidprompt-2.1.2/contrib/dist/archlinux-aur/000077500000000000000000000000001425017241600214345ustar00rootroot00000000000000liquidprompt-2.1.2/contrib/dist/archlinux-aur/PKGBUILD000066400000000000000000000017441425017241600225660ustar00rootroot00000000000000# 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/nojhan/liquidprompt" arch=('any') license=('AGPLv3') optdepends=('screen' 'acpi') makedepends=('git') md5sums=('SKIP') install=liquidprompt.install _gitroot="git://github.com/nojhan/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." } 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.1.2/contrib/dist/archlinux-aur/liquidprompt.install000066400000000000000000000001151425017241600255520ustar00rootroot00000000000000post_install() { echo "Use 'source liquidprompt' to enable the prompt." } liquidprompt-2.1.2/contrib/dist/debian/000077500000000000000000000000001425017241600200745ustar00rootroot00000000000000liquidprompt-2.1.2/contrib/dist/debian/create_deb.sh000077500000000000000000000006631425017241600225150ustar00rootroot00000000000000#!/bin/sh echo "Creating Debian's package..." nano ./liquidprompt/DEBIAN/control echo "Copying files..." cp ../../liquidprompt ./liquidprompt/usr/bin/liquidprompt 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.1.2/contrib/dist/debian/liquidprompt/000077500000000000000000000000001425017241600226255ustar00rootroot00000000000000liquidprompt-2.1.2/contrib/dist/debian/liquidprompt/DEBIAN/000077500000000000000000000000001425017241600235475ustar00rootroot00000000000000liquidprompt-2.1.2/contrib/dist/debian/liquidprompt/DEBIAN/control000066400000000000000000000004621425017241600251540ustar00rootroot00000000000000Package: liquidprompt Version: 1.3-0 Section: base Priority: optional Architecture: all Depends: bash Recommends: acpi Suggests: git, screen, tmux Maintainer: Julien Pecqueur Description: A slick adaptative prompt for Bash and Zsh. Homepage: http://github.com/nojhan/liquidprompt liquidprompt-2.1.2/demo.png000066400000000000000000004011131425017241600157010ustar00rootroot00000000000000PNG  IHDR<sRGBbKGDC pHYs  tIME c$` IDATxy|TwL&d!!d# ;"hDH؍) (BV ! btYZ׺گ_ڪEhok[wdc_zWfsιs=9ϣdZ/O17?xcg/c_=MP`EycXV"5 ̊l6'8v|ҍ#G ?$Q?رc룔N2d b-qD\ziM[^", \硷٩ᆮrq ,IDQnO1̆d />H9bMp;vvY󰸺vkă 5f1Q*)=NkJ QD1bTb\Sc!8tBT#,%~lp8^"F$my 3oCb국Vd ,nZsYOjbW/jm|و؀)FXli]̑QVT+敱lNgA-x$rc=[g-،YΡZ-,(_NXQp?IsՊb|>_}'(igu}3w2geDI&FD3⓪QZ~S&I8MzmD a;/G4,ZjPW "Q?igEͯ>o⚒Q>T";Z38 A*gP 3uԖ=@G.w{Ftg,_ATՖ]MCQbi2L14Xse0EgryJv HDDd >!+1 MљkıOum$zdT~\u6ۢx,͐]8zjɆJPlXGM*' g$hۀiWZ$NsLQp:ɳWžaU9XRf(U g|P' }]g`,b(JfHn.,/--{س_楼»oucnU bE۟3Yq[@"gqQ{ē&gVsCnuiWxT(ҋeziAiFj{7~v$kX/79.PíjE Mv ̷o`zq FG1taW+BhhJhW X|i~ozK;j#ӥ)n7t3K̺sU0fn}|3GzY.[ԇ-lSl!p&5CMȵXs{PzOi}bf팍~$vlO1UÄ9~^]W,][r̖9rG9Tü[(WRSǾ1dmO2yĴ[[^>]Πҩ9 ff3¦4 $~FXY\ܔl5@yV8 jelԶ۟d1a-.nޭ`Ųۛ UNPB!lπhݻ-ǏhQ[ܽ Ppp̜qGq `@~'_{?-dUT"wL[~ve<kųF̾0msXwQ5 47KJ.boȠf$IoVٳu-}\v{>]GmYH Tm7O@;ؿs"KqR$2~:(n{5`]^)WMlhSD}C4WzmBď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m$]nt few+gElS6Tq,T Ә F"oz ̉?N|g'3+/+!+-cbSY)"E?卢{3'NYdK&WN|ʆ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.1.2/docs/000077500000000000000000000000001425017241600151775ustar00rootroot00000000000000liquidprompt-2.1.2/docs/.gitignore000066400000000000000000000000161425017241600171640ustar00rootroot00000000000000_build/ venv/ liquidprompt-2.1.2/docs/Makefile000066400000000000000000000011721425017241600166400ustar00rootroot00000000000000# 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.1.2/docs/conf.py000066400000000000000000000051041425017241600164760ustar00rootroot00000000000000# 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 = 'Liquidprompt' copyright = '2011-%s, Liquidprompt 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', ] # This value determines how to group the document tree into manual pages man_pages = [ ('functions', 'liquidprompt', 'Liquidprompt functions', [], 3), ('config', 'liquidprompt', 'Liquidprompt configuration', [], 5), ('theme', 'liquidprompt', 'Liquidprompt 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' # 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'] # 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/$' ] liquidprompt-2.1.2/docs/config.rst000066400000000000000000001247751425017241600172160ustar00rootroot00000000000000Config Options ************** .. contents:: :local: Almost every feature in Liquidprompt can be turned on or off using these config options. They can either be set before sourcing Liquidprompt (in ``.bashrc`` or ``.zshrc``), or set in a Liquidprompt 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. Liquidprompt ships with an example config file, ``liquidpromptrc-dist``. You can start from this file for your config:: cp ~/liquidprompt/liquidpromptrc-dist ~/.config/liquidpromptrc 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. 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 .. 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 ``~/MyS...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_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_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_PERCENTS_ALWAYS` 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_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-nspawn). .. note:: Containers may inherit some or even no variables from their parent shell, so this may behave inconsisently with different container software. For example, Docker doesn't 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_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_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_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_PERCENTS_ALWAYS`, and :attr:`LP_COLORMAP`. .. 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_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_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. 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_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 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`, and :attr:`LP_COLORMAP`. .. 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_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_PERCENTS_ALWAYS` is enabled. Both Linux and MacOS are supported. See also: :attr:`LP_MARK_WIFI` and :attr:`LP_COLORMAP`. .. versionadded:: 2.1 .. 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_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 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_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_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 centiload are still accepted, but deprecated. .. 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_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`. .. 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`. .. 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_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_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_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_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 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_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 .. 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 .. 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_SHLVL :type: string :value: "└" Mark used to indicate the shell is inside another shell. See also: :attr:`LP_ENABLE_SHLVL` 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_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 ------ 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 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. The default array is:: ( "" $GREEN $BOLD_GREEN $YELLOW $BOLD_YELLOW $RED $BOLD_RED $WARN_RED $CRIT_RED $DANGER_RED ) 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_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. .. 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`. .. 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_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_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. .. 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_NODE_VENV :type: string :value: $LP_COLOR_VIRTUALENV Color used for displaying a Node.js virtual env. 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_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_PROXY :type: string :value: $BOLD_BLUE Color used for :attr:`LP_MARK_PROXY`. See also: :attr:`LP_ENABLE_PROXY`. .. attribute:: LP_COLOR_RUBY_VENV :type: string :value: $LP_COLOR_VIRTUALENV Color used for displaying a Ruby virtual env. 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` 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 env 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. .. attribute:: LP_COLOR_X11_ON :type: string :value: $GREEN Color used for indicating that a display is connected. liquidprompt-2.1.2/docs/functions.rst000066400000000000000000000012531425017241600177420ustar00rootroot00000000000000Functions ********* 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 Liquidprompt 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.1.2/docs/functions/000077500000000000000000000000001425017241600172075ustar00rootroot00000000000000liquidprompt-2.1.2/docs/functions/data.rst000066400000000000000000000404061425017241600206560ustar00rootroot00000000000000Data 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_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_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 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 .. 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_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_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_mulitplexer Returns ``true`` if the current shell context is inside a terminal multiplexer. Returns a string matching the multiplexer: * ``tmux`` * ``screen`` .. versionadded:: 2.0 .. 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 .. 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 :attr:`LP_HOST_SYMBOL` to the same return string. Added :attr:`LP_HOSTNAME_METHOD` to configure display method. .. 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.1.2/docs/functions/data/000077500000000000000000000000001425017241600201205ustar00rootroot00000000000000liquidprompt-2.1.2/docs/functions/data/vcs.rst000066400000000000000000000553271425017241600214610ustar00rootroot00000000000000Version 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_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. .. note:: *lp_vcs_dir* will not be set for Fossil repositories. Protect it with ``"${lp_vcs_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. .. 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 Liquidprompt 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 repo 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_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 Liquidprompt 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 checkin 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 Liquidprompt 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 Liquidprompt 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 Liquidprompt 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/nojhan/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 Liquidprompt 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.1.2/docs/functions/internal.rst000066400000000000000000000240061425017241600215570ustar00rootroot00000000000000Internal Functions ****************** .. contents:: :local: These functions are designed to be used only by Liquidprompt 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 Liquidprompt. 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 Liquidprompt 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 filesystem. .. 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.1.2/docs/functions/public.rst000066400000000000000000000123011425017241600212140ustar00rootroot00000000000000Public 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. This function supports shell autocompletion. .. versionadded:: 2.0 .. 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.1.2/docs/functions/theme.rst000066400000000000000000000211401425017241600210410ustar00rootroot00000000000000Default 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 .. 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_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 .. 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_error_color() -> var:lp_error_color Returns :func:`_lp_error` with color from :attr:`LP_COLOR_ERR`. .. versionadded:: 2.0 .. 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`, :attr:`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 .. 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 .. 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 .. 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 .. 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 .. 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 :attr:`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 .. 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.1.2/docs/functions/util.rst000066400000000000000000000061421425017241600207210ustar00rootroot00000000000000Utility 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_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_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_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_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_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 liquidprompt-2.1.2/docs/index.rst000066400000000000000000000015101425017241600170350ustar00rootroot00000000000000.. Liquidprompt 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. Welcome to Liquidprompt's documentation! ======================================== Liquidprompt 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. To get started, view the :doc:`install` documentation, which includes instructions for trying Liquidprompt temporarily. .. toctree:: :maxdepth: 2 :caption: Contents: install config theme functions release-notes upgrading Indices and tables ================== * :ref:`genindex` * :ref:`search` liquidprompt-2.1.2/docs/install.rst000066400000000000000000000065551425017241600174120ustar00rootroot00000000000000Installation ************ .. contents:: :local: .. toctree:: :maxdepth: 1 install/packages 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/nojhan/liquidprompt.git ~/liquidprompt Or, if you want to use the development (non-stable) branch:: git clone https://github.com/nojhan/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 nojhan/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 nojhan/liquidprompt Dependencies ============ Liquidprompt 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 that the suggested ``~/liquidprompt``. .. _shell-installation: Shell Installation ================== To use Liquidprompt 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 Liquidprompt in interactive shells, not from a script or from scp [[ $- = *i* ]] && source ~/liquidprompt/liquidprompt Adjust the path if you installed to a different location that 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 Liquidprompt to avoid history and timing 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. Next up are the :doc:`config`. liquidprompt-2.1.2/docs/install/000077500000000000000000000000001425017241600166455ustar00rootroot00000000000000liquidprompt-2.1.2/docs/install/packages.rst000066400000000000000000000046611425017241600211640ustar00rootroot00000000000000Packages ******** .. contents:: :local: Liquidprompt 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: Liquidprompt packaging status Source: `repology.org `_. Install commands ================ Archlinux --------- .. image:: https://repology.org/badge/version-for-repo/aur/liquidprompt.svg :alt: Archlinux package :target: https://aur.archlinux.org/packages/liquidprompt .. code-block:: pacman -S liquidprompt 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 Liquidprompt at startup. * If no previous ``~/.config/liquidpromptrc`` file exists, it will be created. So, to get Liquidprompt 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_stable/liquidprompt.svg :alt: nixpkgs stable package :target: https://github.com/NixOS/nixpkgs/blob/master/pkgs/shells/liquidprompt/default.nix .. code-block:: nix-env -i liquidprompt liquidprompt-2.1.2/docs/make.bat000066400000000000000000000013701425017241600166050ustar00rootroot00000000000000@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.1.2/docs/release-notes.rst000066400000000000000000000007211425017241600204770ustar00rootroot00000000000000Release 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/nojhan/liquidprompt/blob/master/CHANGELOG.md .. toctree:: :maxdepth: 2 :reversed: release-notes/v1.12 release-notes/v2.0 release-notes/v2.1 liquidprompt-2.1.2/docs/release-notes/000077500000000000000000000000001425017241600177455ustar00rootroot00000000000000liquidprompt-2.1.2/docs/release-notes/v1.12.rst000066400000000000000000000022141425017241600212450ustar00rootroot00000000000000Version 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 Liquidprompt 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.1.2/docs/release-notes/v2.0.rst000066400000000000000000000065461425017241600211770ustar00rootroot00000000000000Version 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`` 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 ============== Liquidprompt 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 Liquidprompt 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, Liquidprompt would not display any repository information until the current directory was changed. Thanks to the speed improvements, Liquidprompt 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 untility functions. A handful of bugs were caught using the tests, so the investment has already paid off! Dirstack 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.1.2/docs/release-notes/v2.1.rst000066400000000000000000000036741425017241600211770ustar00rootroot00000000000000Version 2.1 Release Notes ************************* Version 2.1 has a whole host of new data sources, features, and compatibility fixes. .. contents:: :local: Title Command ============= Liquidprompt 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 inteface 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 ========================== Liquidprompt now supports running along side `bash-preexec`_. Simply load Liquidprompt `after` bash-preexec. .. _bash-preexec: https://github.com/rcaloras/bash-preexec liquidprompt-2.1.2/docs/requirements.txt000066400000000000000000000000641425017241600204630ustar00rootroot00000000000000sphinx>=4.3.0,<4.4.0 sphinx_rtd_theme>=1.0.0,<1.1.0 liquidprompt-2.1.2/docs/theme.rst000066400000000000000000000032251425017241600170350ustar00rootroot00000000000000Theming ******* Liquidprompt 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 Liquidprompt version 1), that allows for custom prompt ordering in the default theme. Liquidprompt ships with some :doc:`theme/included` other than the default as well. See the `Liquidprompt Theme List`_ on the wiki for user created themes. If you want to create your own theme, see :doc:`theme/custom`. .. _`Liquidprompt Theme List`: https://github.com/nojhan/liquidprompt/wiki/Themes .. toctree:: :maxdepth: 2 theme/default theme/included theme/custom .. contents:: :local: Switching Themes ---------------- Liquidprompt 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 Powerline theme, source the theme file:: $ source themes/powerline/powerline.theme Now both the default theme and Powerline are loaded. To show what themes are loaded and available, run :func:`lp_theme`:: $ lp_theme --list default powerline_full powerline To switch to a different theme, call :func:`lp_theme` with the name of the theme as the argument:: $ lp_theme powerline 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.1.2/docs/theme/000077500000000000000000000000001425017241600163015ustar00rootroot00000000000000liquidprompt-2.1.2/docs/theme/custom.rst000066400000000000000000000050741425017241600203530ustar00rootroot00000000000000Custom 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. 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/nojhan/liquidprompt/wiki/Themes .. _`Theme sharing`: https://github.com/nojhan/liquidprompt/wiki/Theme-sharing liquidprompt-2.1.2/docs/theme/default-long.png000066400000000000000000000204071425017241600213730ustar00rootroot00000000000000PNG  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!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DUz(OQ"XknZK.J QsKt@6Vk_qos\ӌa(=>fDP'E/ ᵴI~wYdsx=B5Qԛ E(oE}v;PJi鼼RIENDB`liquidprompt-2.1.2/docs/theme/default-short.png000066400000000000000000000013071425017241600215710ustar00rootroot00000000000000PNG  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.1.2/docs/theme/default.rst000066400000000000000000000213251425017241600204620ustar00rootroot00000000000000Default Theme ************* .. contents:: :local: Preview ======= If there is nothing special about the current context, the appearance of Liquidprompt 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 Liquidprompt 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 Liquidprompt 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: liquid.ps1_. .. _liquid.ps1: https://github.com/nojhan/liquidprompt/blob/master/liquid.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. .. note:: Omitting a template section from your template will **not** disable that feature. While it will not be displayed in the prompt, Liquidprompt 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_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_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_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_PROXY A ↥ (:attr:`LP_MARK_PROXY`) if an HTTP proxy is in use. See :attr:`LP_ENABLE_PROXY`. .. 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`. :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. liquidprompt-2.1.2/docs/theme/included.rst000066400000000000000000000003471425017241600206260ustar00rootroot00000000000000Included Themes *************** Liquidprompt ships with some included themes that will have features added to them as they are added to Liquidprompt. .. toctree:: :maxdepth: 2 included/alternate_vcs included/powerline liquidprompt-2.1.2/docs/theme/included/000077500000000000000000000000001425017241600200705ustar00rootroot00000000000000liquidprompt-2.1.2/docs/theme/included/alternate_vcs-demo.png000066400000000000000000000421271425017241600243600ustar00rootroot00000000000000PNG  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%/ k/:Vu*ԍ.$jĮ3FR=Osz~V=vgYք+kb7 -TD4βAqk꩏.K{jZg}|\'bE~ϪyIII~_ y5-WUsKkgjnTscxG Qx'Kd2u1E~,&r_j|$nȶZkSޅ!~M+@RA&s_)GS7e<~R$e.8zYbrVgLW&gs8}؅gzmݷ]jw`Ra,oxo֟_0i h]Į$"fקQ^SUٽ9?P+^ѽc7C5c!v\>A]䶨r$g@_ 9w/9?K5] A`˖UZqK- ċsugq )Ѯ)?댲m{gT,2}:o)l6)#'iek.e*Zt^n3SF55CUs{V^ZK5ɱ{&뼍joE%U6câ{v vToM5T?hgWU& iN5YVjԺfDkj6G[40[}R5{fQYuԩ@Y ֿPMՑ'т5Q5O2w6\Gx-H2GH*) `M?jV㪆>RQ(^:1捥NhV9o~ܻM2e&ɯŹ`mf|\j{ߋpU{$M56C1`qbBP YjcniϢwkǑ&AgnqK5U=B?# CUlVjj質)dc 㬝lթ+M 7zmC5GԬ۩[NլC~ {5_VWc\2m_S*7bK\Z)]'diV7F+;('^}`  [:?fP RlE[fMö[5lqf;&F5ݤ!:{G5lVMEܸ qjy UOfhg6V8kvdTͶ[T0ϕA5.=z7͵*6r_ԫf/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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.1.2/docs/theme/included/alternate_vcs.rst000066400000000000000000000052701425017241600234600ustar00rootroot00000000000000*************************** Alternate VCS Details Theme *************************** The included ``themes/powerline/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 Liquidprompt 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 ============= Liquidprompt Configuration -------------------------- All Liquidprompt 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.1.2/docs/theme/included/powerline-long.png000066400000000000000000000132461425017241600235450ustar00rootroot00000000000000PNG  IHDR^9AgAMA asRGB pHYs+;IDATxMhWJV!W˙@E `Bn/bCf92vÌA BtɈЃA0˛6l#hEiի^i[w*pQT\|wb[ZFsۃWk*pyecxWfAs;oa BpH0wgǯfmԹs|m6þż2ҍٲVjxJ/M_wYE܁j}ՂޞnTH\v0R3&!镺ks5@n?=MsրuMkί%w}?̡VmXWε_8k@?WX[c k 4'c.(;5@(;0|vSG@sDOwjY3s-;.hyn/ ;r9;p<@+qU}*9k"OǑ{Mw׆®ٷ֖6r=;PPo~9ٮw502 ^\싿#ۓ++qJ{5zׯIsXXŹg&.>h(Lfb~59ϵ" Fe]{bk@݀΄C({a#2n܁3٥=O݁OKf "\cX%835U5~֣}X㢞>vb?]*&P0)a;ptրx2qpW+j4߇X9/E @xc]f2pRRA&hXʊ HyIVt΂,B eP׾ISvր+#^"sq a(%} N~mqn1+L 1ϵjIeZ{2k-ý G{h/ZT况u>]l *TMݮ :;NcXO jXq'LU(;ʶ;Ǿ.ا2ޟ"KN&y=/:q FP|yN̬i/ LѥAaByf+;p݇O< WwwOw}_@gekW` lee ʬ;vga Fx2= 0kWG@\ݧb꽬 BA?_Mc Tz?Tf ^}>) #$+TID#uWOx|l |X5X}j9gb0mQo!=C'f{݂F]с4'UV@ QB:[A')yL Y1+k'Nڽ3XbB>5p3vJuF⨁ w{U轹 sb ԋ9spTat3{~SS |X s&ha+piTPٲ݇/h߆AT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ZposhJܑVlLjT  ϦRY{QBڥT +qb~=)#9i:mM }d4#>/TI.314K_^]QDŽr]ꐞ~w}ϟ^9wh!ZKDA}Ədev4~ꏝ^#3mAG2d7#2MG|3}?xth8nёΈ#C#A2k"5ԑڧmJ{C'ؓV+kTB躈٦4'z_^I5i'Y6@G'x!s4F=mbIudN|¨:R5ĔN"J5G *ݴ:RsI0Ʃ@t|"G!!H5$z{_ZBkAAR+~é/uDB#/n|tr6s :BttBf3 H8"ej1#'VU.DUEd CĶ0#eޗ&+ /k rĖDuln_iёl!ȭ#f&kT);RIG23ʪeqT .%bPY~Q Bt⚆*uԞd.ʭ.$XZOK*Ϫ f$V[GW2 c:YJQ-LU&ְhZ#HH a%7SxeM11N:uDOyuRy֨02+#ʳ.]G++1ˣ{r~!Ɠj!{$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.1.2/docs/theme/included/powerline.rst000066400000000000000000000336051425017241600226350ustar00rootroot00000000000000*************** Powerline Theme *************** 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 Liquidprompt can do what Powerline does, but faster. That said, this is a fully usable theme. .. versionadded:: 2.0 .. _`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 Liquidprompt 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 Liquidprompt. 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 ============= Liquidprompt Configuration -------------------------- The following Liquidprompt 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 Liquidprompt provides. The ordering is the same as the default theme. .. versionadded:: 2.0 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 Liquidprompt 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 ============= Liquidprompt Configuration -------------------------- All Liquidprompt 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_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_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.1.2/docs/theme/included/powerline_full-long.png000066400000000000000000000253221425017241600245650ustar00rootroot00000000000000PNG  IHDRt9ygAMA asRGB pHYs+*gIDATx_hG1-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+(?Kv(wGI.(Ɓdx:rdGJοΞ o\#,(^ehb\Pφuk~s2TY}M,:Tx~Mَ̏b>i6@j5/LqnD!]=`hwVP,oW!A;–.f=cw*:DqH^hPy%pqk ӚΪoqEwyjp\)ӨLV^=scQ-(#mĜ8s1cku6/ikoUu>fceP8&nY@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.1.2/docs/theme/included/powerline_full-short.png000066400000000000000000000014071425017241600247630ustar00rootroot00000000000000PNG  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.1.2/docs/upgrading.rst000066400000000000000000000006701425017241600177140ustar00rootroot00000000000000Upgrading Liquidprompt ********************** We try our best to make new versions of Liquidprompt 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.1.2/docs/upgrading/000077500000000000000000000000001425017241600171575ustar00rootroot00000000000000liquidprompt-2.1.2/docs/upgrading/v2.0.rst000066400000000000000000000315531425017241600204050ustar00rootroot00000000000000Version 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: 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` 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() ----------------- Renamed to :func:`__lp_set_dirtrim`. Recommended that :attr:`lp_path` is used instead. _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 `_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.1.2/docs/upgrading/v2.1.rst000066400000000000000000000012071425017241600203770ustar00rootroot00000000000000Version 2.1 Upgrade Notes ************************* Upgrading to version 2.1 is almost completely painless, as there is only one deprecation. .. contents:: :local: 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.1.2/example.bashrc000066400000000000000000000012331425017241600170650ustar00rootroot00000000000000 # 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.1.2/liquid.ps1000066400000000000000000000020341425017241600161620ustar00rootroot00000000000000 ####################################### # LIQUID PROMPT EXAMPLE TEMPLATE FILE # ####################################### # This file is not updated with new template sections. This is an example of # how to make a template, not what can go in one. # Available sections can be found in the documentation: # https://liquidprompt.readthedocs.io/en/stable/theme/default.html#templates # Remember that most features come with their corresponding colors. # add time, jobs, load and battery LP_PS1="${LP_PS1_PREFIX}${LP_TIME}${LP_BATT}${LP_LOAD}${LP_TEMP}${LP_JOBS}" # add user, host and permissions colon LP_PS1+="${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_PERM}" LP_PS1+="${LP_PWD}${LP_BRACKET_CLOSE}${LP_SCLS}${LP_VENV}${LP_RUBY_VENV}${LP_TFSPACE}${LP_PROXY}" # Add VCS infos LP_PS1+="${LP_VCS}" # add return code and prompt mark LP_PS1+="${LP_RUNTIME}${LP_ERR}${LP_MARK_PREFIX}${LP_COLOR_MARK}${LP_MARK}${LP_PS1_POSTFIX}" # Get the current prompt on the fly and make it a title _lp_formatted_title "$LP_PS1" # vim: set et sts=4 sw=4 tw=120 ft=sh: liquidprompt-2.1.2/liquid.theme000066400000000000000000000113521425017241600165640ustar00rootroot00000000000000 #################################### # LIQUID PROMPT DEFAULT THEME FILE # #################################### # Special characters # Be sure to use characters that exists in the font you use. You can use several # characters at once. # Below is an example of how to fallback to ASCII if the term is not Unicode-capable. # Defaults to UTF-8 characters. if [[ "$(locale -k LC_CTYPE | sed -n 's/^charmap="\(.*\)"/\1/p')" == *"UTF-8"* ]]; then # If charset is UTF-8. LP_MARK_BATTERY="⌁" # in front of the battery charge LP_MARK_ADAPTER="⏚" # displayed when plugged LP_MARK_LOAD="⌂" # in front of the load LP_MARK_TEMP="θ" # in front of the temp LP_MARK_PROXY="↥" # indicate a proxy in use LP_MARK_HG="☿" # prompt mark in hg repositories LP_MARK_SVN="‡" # prompt mark in svn repositories LP_MARK_GIT="±" # prompt mark in git repositories LP_MARK_FOSSIL="⌘" # prompt mark in fossil repositories LP_MARK_DISABLED="⌀" # prompt mark in directory with disabled VCS info LP_MARK_UNTRACKED="*" # if git has untracked files LP_MARK_STASH="+" # if git has stashs LP_MARK_SHORTEN_PATH=" … " # prompt mark in shortened paths LP_MARK_PERM=":" # separator between host and path LP_MARK_KUBECONTEXT="⎈" # Kubernetes context else # If charset is anything else, fallback to ASCII chars LP_MARK_BATTERY="b" LP_MARK_ADAPTER="p" LP_MARK_LOAD="c" LP_MARK_TEMP="T" LP_MARK_PROXY="^" LP_MARK_HG="m" LP_MARK_SVN="=" LP_MARK_GIT="+" LP_MARK_FOSSIL="f" LP_MARK_DISABLED="!" LP_MARK_UNTRACKED="*" LP_MARK_STASH="+" LP_MARK_SHORTEN_PATH=" ... " LP_MARK_PERM=":" LP_MARK_KUBECONTEXT="k8s:" fi LP_MARK_BRACKET_OPEN="[" # open bracket LP_MARK_BRACKET_CLOSE="]" # close bracket #LP_MARK_DEFAULT="" # default prompt mark LP_MARK_PREFIX=" " # prompt mark prefix LP_PS1_PREFIX="" LP_PS1_POSTFIX="" # Colors # Available colors are: # BOLD, BLACK, BOLD_GRAY, WHITE, BOLD_WHITE, # RED, BOLD_RED, WARN_RED, CRIT_RED, DANGER_RED, # GREEN, BOLD_GREEN, YELLOW, BOLD_YELLOW, BLUE, # BOLD_BLUE, PURPLE, PINK, CYAN, BOLD_CYAN # Set to a null string "" if you do not want color. # Current working directory LP_COLOR_PATH="$BOLD" # as normal user LP_COLOR_PATH_ROOT="$BOLD_YELLOW" # as root # Color of the proxy mark LP_COLOR_PROXY="$BOLD_BLUE" # Jobs count LP_COLOR_JOB_D="$YELLOW" # Detached (aka screen sessions) LP_COLOR_JOB_R="$BOLD_YELLOW" # Running (xterm &) LP_COLOR_JOB_Z="$BOLD_YELLOW" # Sleeping (Ctrl-Z) # Last error code LP_COLOR_ERR="$PURPLE" # Prompt mark LP_COLOR_MARK="$BOLD" # as user LP_COLOR_MARK_ROOT="$BOLD_RED" # as root LP_COLOR_MARK_SUDO="$BOLD_RED" # when sudo credentials are cached # Current user LP_COLOR_USER_LOGGED="" # user who logged in LP_COLOR_USER_ALT="$BOLD" # user but not the one who logged in LP_COLOR_USER_ROOT="$BOLD_YELLOW" # root # Hostname LP_COLOR_HOST="" # local host LP_COLOR_SSH="$BLUE" # connected via SSH LP_COLOR_SU="$BOLD_YELLOW" # connected remotely but in new environment through su/sudo LP_COLOR_TELNET="$WARN_RED" # connected via telnet LP_COLOR_X11_ON="$GREEN" # connected with X11 support LP_COLOR_X11_OFF="$YELLOW" # connected without X11 support # Separation mark (aka permission in the working dir) LP_COLOR_WRITE="$GREEN" # have write permission LP_COLOR_NOWRITE="$RED" # do not have write permission # VCS LP_COLOR_UP="$GREEN" # repository is up to date / a push have been made LP_COLOR_COMMITS="$YELLOW" # some commits have not been pushed LP_COLOR_COMMITS_BEHIND="$BOLD_RED" # some commits have not been pushed LP_COLOR_CHANGES="$RED" # there is some changes to commit LP_COLOR_DIFF="$PURPLE" # number of lines impacted by current changes # Battery LP_COLOR_CHARGING_ABOVE="$GREEN" # charging and above threshold LP_COLOR_CHARGING_UNDER="$YELLOW" # charging but under threshold LP_COLOR_DISCHARGING_ABOVE="$YELLOW" # discharging but above threshold LP_COLOR_DISCHARGING_UNDER="$RED" # discharging and under threshold # Time LP_COLOR_TIME="$BLUE" # Brackets inside screen/tmux LP_COLOR_IN_MULTIPLEXER="$BOLD_BLUE" # Virtual environment LP_COLOR_VIRTUALENV="$CYAN" # Kubernetes LP_COLOR_KUBECONTEXT="$CYAN" # Terraform LP_COLOR_TERRAFORM="$PINK" # Runtime LP_COLOR_RUNTIME="$YELLOW" # Color map (for battery and load levels, and temperature) # Range from 0 (nothing special) to 9 (alert) LP_COLORMAP=( "" "$GREEN" "$BOLD_GREEN" "$YELLOW" "$BOLD_YELLOW" "$RED" "$BOLD_RED" "$WARN_RED" "$CRIT_RED" "$DANGER_RED" ) # vim: set et sts=4 sw=4 tw=120 ft=sh: liquidprompt-2.1.2/liquidprompt000077500000000000000000003467321425017241600167450ustar00rootroot00000000000000################################################################################ # LIQUID PROMPT # An intelligent and non-intrusive prompt for Bash and zsh ################################################################################ # 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>&1 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 # 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() { if ! shopt -q extglob ; then local _lp_no_extglob=true shopt -s extglob fi ret="${1//"${_LP_OPEN_ESC}"!(*"${_LP_CLOSE_ESC}"*)"${_LP_CLOSE_ESC}"}" if [[ -n ${_lp_no_extglob-} ]]; then shopt -u extglob fi 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>&1 return fi _LP_SHELL_bash=0 _LP_SHELL_zsh=1 _LP_OPEN_ESC="%{" _LP_CLOSE_ESC="%}" _LP_MARK_SYMBOL='%%' _LP_FIRST_INDEX=1 _LP_PERCENT='%%' __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 ################# # CONFIGURATION # ################# # 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_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_PERCENTS_ALWAYS=${LP_PERCENTS_ALWAYS:-1} LP_PS1=${LP_PS1:-""} LP_PS1_PREFIX=${LP_PS1_PREFIX:-""} LP_PS1_POSTFIX=${LP_PS1_POSTFIX:-""} LP_MARK_KUBECONTEXT=${LP_MARK_KUBECONTEXT:-"⎈"} LP_DELIMITER_KUBECONTEXT_SUFFIX=${LP_DELIMITER_KUBECONTEXT_SUFFIX:-""} LP_DELIMITER_KUBECONTEXT_PREFIX=${LP_DELIMITER_KUBECONTEXT_PREFIX:-""} 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_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_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_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_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_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_SSH_COLORS=${LP_ENABLE_SSH_COLORS:-0} LP_DISABLED_VCS_PATHS=( ${LP_DISABLED_VCS_PATHS[@]+"${LP_DISABLED_VCS_PATHS[@]}"} ) LP_ENABLE_SUDO=${LP_ENABLE_SUDO:-0} LP_ENABLE_COLOR=${LP_ENABLE_COLOR:-1} LP_ENABLE_ERROR=${LP_ENABLE_ERROR:-1} 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_SHLVL=${LP_ENABLE_SHLVL:-1} LP_ENABLE_WIFI_STRENGTH=${LP_ENABLE_WIFI_STRENGTH:-0} 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_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_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_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_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_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_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_SHLVL=${LP_COLOR_SHLVL:-$BOLD_GREEN} 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" 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 return fi # 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=liquidpromptrc-dist source "$configfile" break fi 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 # 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 } # 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_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 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_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_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; then (( LP_ENABLE_TITLE = LP_ENABLE_TITLE && LP_ENABLE_SCREEN_TITLE )) LP_TITLE_OPEN=$'\Ek' 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() { # 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]}" } # 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 local cksum="$(hostname | 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 } ########################## # 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() { 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 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_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_path_format="${vcs_root_format}${ret}" else lp_path_format="${last_directory_format}${ret}" 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}${ret}" 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}${ret}" 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}${ret}" 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}${ret}" 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}${ret}" 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}${ret}" 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}${ret}" fi else __lp_end_path_left_shortening lp_path+=$current_directory __lp_escape "$current_directory" lp_path_format+="${path_format}${ret}" fi if [[ -n $path_to_proccess && ( $current_path != "/" || $separator != "/" ) ]] && (( ! is_shortening )); then if [[ $current_path != "/" ]]; then lp_path+="/" fi lp_path_format+="${separator_format}${separator}" fi done } ############### # Environment # ############### # If we are connected with a X11 support _lp_connected_display() { [[ -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() { if [[ -r /etc/debian_chroot ]]; then IFS= read -r lp_chroot /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() { _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}]" } # 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) # 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}${lp_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_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() { _lp_aws_profile || return "$?" lp_aws_profile_color="[${LP_COLOR_AWS_PROFILE}${lp_aws_profile}${NO_COL}]" } _lp_shell_level() { (( LP_ENABLE_SHLVL )) || return 2 lp_shell_level=${SHLVL:-1} (( lp_shell_level > 1 )) } _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_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_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 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 lp_vcs_details_color+="$NO_COL" } # Check if the detected VCS is enabled in Liquidprompt 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" } # GIT # # Check if Git is enabled in Liquidprompt 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() { 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_dir}/MERGE_HEAD" ]]; then lp_vcs_head_status="MERGING" elif [[ -d "${lp_vcs_dir}/rebase-merge" ]]; then read -r step <"${lp_vcs_dir}/rebase-merge/msgnum" read -r total <"${lp_vcs_dir}/rebase-merge/end" if [[ -f "${lp_vcs_dir}/rebase-merge/interactive" ]]; then lp_vcs_head_status="REBASE-i" else lp_vcs_head_status="REBASE-m" fi elif [[ -d "${lp_vcs_dir}/rebase-apply" ]]; then read -r step <"${lp_vcs_dir}/rebase-apply/next" read -r total <"${lp_vcs_dir}/rebase-apply/last" if [[ -f "${lp_vcs_dir}/rebase-apply/rebasing" ]]; then lp_vcs_head_status="REBASE" elif [[ -f "${lp_vcs_dir}/rebase-apply/applying" ]]; then lp_vcs_head_status="AM" else lp_vcs_head_status="AM/REBASE" fi elif [[ -f "${lp_vcs_dir}/CHERRY_PICK_HEAD" ]]; then lp_vcs_head_status="CHERRY-PICKING" elif [[ -f "${lp_vcs_dir}/REVERT_HEAD" ]]; then lp_vcs_head_status="REVERTING" elif [[ -f "${lp_vcs_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 } # MERCURIAL # # Check if Mercurial is enabled in Liquidprompt 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/nojhan/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 ; } # SUBVERSION # # Check if Subversion is enabled in Liquidprompt 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 ; } # FOSSIL # # Check if Fossil is enabled in Liquidprompt 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 ; } # Bazaar # # Check if Bazaar is enabled in Liquidprompt 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_fossil_unstaged_files() { return 2 ; } _lp_fossil_unstaged_lines() { return 2 ; } _lp_fossil_staged_files() { return 2 ; } _lp_fossil_staged_lines() { 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_PERCENTS_ALWAYS )); 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_PERCENTS_ALWAYS )); 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 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 ) } _lp_cpu_load () { local _ IFS=$' \t' read -r lp_cpu_load _ < /proc/loadavg } ;; 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_PERCENTS_ALWAYS )); then lp_load_color+="${lp_load}" fi lp_load_color+="$NO_COL" } ###################### # 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 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}" } ########## # 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() { _lp_container || return "$?" lp_container_color="«${LP_COLOR_CONTAINER}${lp_container}${NO_COL}»" } ################# # Default theme # ################# _lp_default_theme_activate() { # Default value for LP_PERM when LP_ENABLE_PERM is 0 LP_PERM=${LP_MARK_PERM} # without color _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() { # 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}" } _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_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_shell_level_color; then LP_SHLVL="$lp_shell_level_color" else LP_SHLVL= fi 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_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_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_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=liquid.ps1 source "$LP_PS1_FILE" fi if [[ -z "${LP_PS1-}" ]]; then # add title escape time, jobs, load and battery PS1="${LP_PS1_PREFIX}${LP_TIME}${LP_BATT}${LP_LOAD}${LP_TEMP}${LP_WIFI}${LP_JOBS}" # add user, host, permissions colon, working directory, and dirstack PS1+="${LP_BRACKET_OPEN}${LP_USER}${LP_HOST}${LP_PERM}${LP_PWD}${LP_DIRSTACK}${LP_BRACKET_CLOSE}${LP_SHLVL}" # add development environments PS1+="${LP_SCLS}${LP_AWS_PROFILE}${LP_CONTAINER}${LP_VENV}${LP_NODE_VENV}${LP_RUBY_VENV}${LP_TFSPACE}${LP_KUBECONTEXT}${LP_PROXY}" # Add VCS infos # If root, the info has not been collected unless LP_ENABLE_VCS_ROOT # is set. PS1+="${LP_VCS}" # add return code and prompt mark 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}" 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_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 # 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/nojhan/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_before_command() { # For debugging #printf 'XXX %s\n' "$BASH_COMMAND" # If this is the first time after the user submitted the command, # execute the hooks. if (( _LP_AT_PROMPT )); then _LP_AT_PROMPT=0 if (( LP_ENABLE_RUNTIME || LP_ENABLE_RUNTIME_BELL )); then __lp_runtime_before fi if (( LP_ENABLE_TITLE_COMMAND )); then __lp_print_title_command fi fi # If this is when the 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. if [[ "$BASH_COMMAND" == __lp_set_prompt ]]; then _LP_AT_PROMPT=1 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 PROMPT_COMMAND+=( "$set_prompt_command" ) 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_RUNTIME || LP_ENABLE_RUNTIME_BELL || LP_ENABLE_TITLE_COMMAND )); 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_RUNTIME || LP_ENABLE_RUNTIME_BELL )); 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_runtime_before ${preexec_functions[@]+"${preexec_functions[@]}"} ); then preexec_functions+=(__lp_runtime_before) fi fi if (( LP_ENABLE_TITLE_COMMAND )); then # It's less bad to have this be duped than __lp_set_prompt, but let's be sure if ! ( __lp_array_contains __lp_print_title_command ${preexec_functions[@]+"${preexec_functions[@]}"} ); then preexec_functions+=(__lp_print_title_command) 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_RUNTIME || LP_ENABLE_RUNTIME_BELL )); then _LP_RUNTIME_LAST_SECONDS=$SECONDS add-zsh-hook preexec __lp_runtime_before fi if (( LP_ENABLE_TITLE_COMMAND )); then add-zsh-hook preexec __lp_print_title_command 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_runtime_before" || $value == "__lp_print_title_command" ]]; 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 fi fi # Disable the DEBUG trap used by the RUNTIME or TITLE_COMMAND features if (( ${LP_ENABLE_RUNTIME-0} || ${LP_ENABLE_RUNTIME_BELL-0} || ${LP_ENABLE_TITLE_COMMAND-0} )); then trap - DEBUG fi fi else # zsh # Disable previous hooks as options that set them # may have changed { add-zsh-hook -d precmd __lp_set_prompt add-zsh-hook -d preexec __lp_runtime_before add-zsh-hook -d preexec __lp_print_title_command } >/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-}" 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" f_dir="_lp_${theme}_theme_directory" f_activate="_lp_${theme}_theme_activate" if [[ -z $theme ]]; then printf '%s\n%s\n' \ 'Must pass in the name of a theme. If you meant the default Liquidprompt theme, try "default".' \ 'Run "lp_theme --list" to see all loaded and available themes.' 2>&1 return 1 fi if ! __lp_is_function "$f_prompt"; then printf 'Loading theme "%s" failed: cannot find function "%s". Please source the theme file first.\n' \ "$theme" "$f_prompt" 2>&1 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 "$f_activate" prompt_on } # By default, sourcing liquidprompt will activate Liquid Prompt if [ "${1-}" != "--no-activate" ]; then lp_activate fi # vim: set et sts=4 sw=4 tw=120 ft=sh: liquidprompt-2.1.2/liquidprompt.plugin.zsh000066400000000000000000000000341425017241600210200ustar00rootroot00000000000000source ${0%/*}/liquidprompt liquidprompt-2.1.2/liquidpromptrc-dist000066400000000000000000000143351425017241600202170ustar00rootroot00000000000000 #################################### # LIQUID PROMPT CONFIGURATION FILE # #################################### # This example config file does not contain all possible config options, nor # does it have detailed option descriptions. See the documentation for that: # https://liquidprompt.readthedocs.io/en/stable/config.html # If you want to use different themes and features, # you can load the corresponding files here: #source ~/.config/liquidprompt/nojhan.theme #LP_PS1_FILE=~/.config/liquidprompt/nojhan.ps1 ############# # BEHAVIOUR # ############# # Display the battery level in more urgent color when the level is below this threshold. # Recommended value is 75 LP_BATTERY_THRESHOLD=75 # Display the load average over the past minute when above this threshold. # This value is scaled per CPU, so on a quad-core machine, the load average # would need to be 2.40 or greater to be displayed. # Recommended value is 0.60 LP_LOAD_THRESHOLD=0.60 # Display the temperature when the temperate is above this threshold (in # degrees Celsius). # Recommended value is 60 LP_TEMP_THRESHOLD=60 # Use the shorten path feature if the path is too long to fit in the prompt # line. # Recommended value is 1 LP_ENABLE_SHORTEN_PATH=1 # The maximum percentage of the screen width used to display the path before # removing the center portion of the path and replacing with '...'. # Recommended value is 35 LP_PATH_LENGTH=35 # The number of directories (including '/') to keep at the beginning of a # shortened path. # Recommended value is 2 LP_PATH_KEEP=2 # Determine if the hostname should always be displayed, even if not connecting # through network. # Defaults to 0 (do not display hostname when locally connected) # set to 1 if you want to always see the hostname # set to -1 if you want to never see the hostname LP_HOSTNAME_ALWAYS=0 # When to display the user name: # 1: always display the user name # 0: hide the logged user (always display different users) # -1: never display the user name # Default value is 1 LP_USER_ALWAYS=1 # Display the actual values of load/batteries along with their # corresponding marks. Set to 0 to only print the colored marks. # Defaults to 1 (display percentages) LP_PERCENTS_ALWAYS=1 # Use the permissions feature and display a red ':' before the prompt to show # when you don't have write permission to the current directory. # Recommended value is 1 LP_ENABLE_PERM=1 # Enable the proxy detection feature. # Recommended value is 1 LP_ENABLE_PROXY=1 # Enable the jobs feature. # Recommended value is 1 LP_ENABLE_JOBS=1 # Enable the detached sessions feature. # Default value is 1 LP_ENABLE_DETACHED_SESSIONS=1 # Enable the load feature. # Recommended value is 1 LP_ENABLE_LOAD=1 # Enable the battery feature. # Recommended value is 1 LP_ENABLE_BATT=1 # Enable the 'sudo credentials' feature. # Be warned that this may pollute the syslog if you don't have sudo # credentials, and the sysadmin might hate you. LP_ENABLE_SUDO=0 # Enable the directory stack support. LP_ENABLE_DIRSTACK=0 # Enable the VCS features with the root account. # Recommended value is 0 LP_ENABLE_VCS_ROOT=0 # Enable the Git special features. # Recommended value is 1 LP_ENABLE_GIT=1 # Enable the Subversion special features. # Recommended value is 1 LP_ENABLE_SVN=1 # Enable the Mercurial special features. # Recommended value is 1 LP_ENABLE_HG=1 # Enable the Fossil special features. # Recommended value is 1 LP_ENABLE_FOSSIL=1 # Enable the Bazaar special features. # Recommended value is 1 LP_ENABLE_BZR=1 # Show time of when the current prompt was displayed. LP_ENABLE_TIME=0 # Show runtime of the previous command if over LP_RUNTIME_THRESHOLD # Recommended value is 0 LP_ENABLE_RUNTIME=0 # Minimal runtime (in seconds) before the runtime will be displayed # Recommended value is 2 LP_RUNTIME_THRESHOLD=2 # Ring the terminal bell if the runtime of the previous command exceeded # LP_RUNTIME_BELL_THRESHOLD # Recommended value is 0 LP_ENABLE_RUNTIME_BELL=0 # Minimal runtime (in seconds) before the terminal bell will be rung. # Recommended value is 10 LP_RUNTIME_BELL_THRESHOLD=10 # Display the virtualenv that is currently activated, if any # Recommended value is 1 LP_ENABLE_VIRTUALENV=1 # Display the ruby virtual env that is currently activated, if any # Recommended value is 1 LP_ENABLE_RUBY_VENV=1 # If using RVM, personalize the rvm-prompt. # see http://rvm.io/workflow/prompt for details. # Warning, this variable must be a shell array. LP_RUBY_RVM_PROMPT_OPTIONS=(i v g s) # Display the terraform workspace that is currently activated, if any # Recommended value is 0 LP_ENABLE_TERRAFORM=0 # Display the enabled software collections, if any # Recommended value is 1 LP_ENABLE_SCLS=1 # Show current Kubernetes kubectl context LP_ENABLE_KUBECONTEXT=0 # Delimiter to shorten kubectl context by removing a suffix. # E.g. when your context names are dev-cluster and test-cluster, set to "-" # in order to output "dev" and "test" in prompt. LP_DELIMITER_KUBECONTEXT_SUFFIX= # Delimiter to shorten kubectl context by removing a prefix. # E.g. when your context names are like # arn:aws:eks:$REGION:$ACCOUNT_ID:cluster/$CLUSTER_NAME, set to "/" # in order to output "$CLUSTER_NAME" in prompt. LP_DELIMITER_KUBECONTEXT_PREFIX= # Display the current active AWS_PROFILE, if any # Recommended value is 1 LP_ENABLE_AWS_PROFILE=1 # Show highest system temperature LP_ENABLE_TEMP=1 # When showing the time, use an analog clock instead of numeric values. # Recommended value is 0 LP_TIME_ANALOG=0 # Use the prompt as the title of the terminal window # Recommended value is 0 LP_ENABLE_TITLE=0 # Enable Title for screen, byobu, and tmux LP_ENABLE_SCREEN_TITLE=0 # Use different colors for the different hosts you SSH to LP_ENABLE_SSH_COLORS=0 # Show the error code of the last command if it was not 0 LP_ENABLE_ERROR=1 # Specify an array of absolute paths in which all vcs will be disabled. # Ex: ("/root" "/home/me/large-remove-svn-repo") LP_DISABLED_VCS_PATHS=() # Use a local liquidpromptrc if it exists. # Can be helpful if you sync your primary config across machines, or if # there's a system-wide config at /etc/liquidpromptrc from which you'd # like to make only minor deviations. #LOCAL_RCFILE=$HOME/.liquidpromptrc.local #[ -f "$LOCAL_RCFILE" ] && source "$LOCAL_RCFILE" # vim: set et sts=4 sw=4 tw=120 ft=sh: liquidprompt-2.1.2/shellcheck.sh000077500000000000000000000004561425017241600167200ustar00rootroot00000000000000#!/bin/sh # shellcheck disable=SC2093 exec shellcheck \ --shell=bash \ --exclude=SC2155 \ --external-sources --check-sourced \ tools/* \ "$0" # Include this script to get the below imports . ./liquidprompt . ./themes/alternate_vcs/alternate_vcs.theme . ./themes/powerline/powerline.theme liquidprompt-2.1.2/tests.sh000077500000000000000000000013261425017241600157520ustar00rootroot00000000000000#!/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 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 done done exit "$fail" liquidprompt-2.1.2/tests/000077500000000000000000000000001425017241600154115ustar00rootroot00000000000000liquidprompt-2.1.2/tests/.gitignore000066400000000000000000000000301425017241600173720ustar00rootroot00000000000000shunit2 bash-preexec.sh liquidprompt-2.1.2/tests/test_acpi.sh000077500000000000000000000062311425017241600177250ustar00rootroot00000000000000 # Error on unset variables set -u # 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() { :; } local 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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_activate.sh000066400000000000000000000004731425017241600206100ustar00rootroot00000000000000 # Error on unset variables set -u . ../liquidprompt --no-activate # Liquidprompt depends on PS1 being set to detect if it has installed itself. PS1="$ " function test_activate { lp_activate --no-config } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_airport.sh000066400000000000000000000040061425017241600204640ustar00rootroot00000000000000 # Error on unset variables set -u # 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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_bash_preexec.sh000066400000000000000000000101601425017241600214320ustar00rootroot00000000000000#!/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_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 false # should get "1" in prompt $PROMPT_COMMAND assertContains $lp_error_color 1 ) } # Check it works with bash_preexec off function test_no_bash_preexec_with_LP_ERR { ( setup_liquidprompt false # should get "1" in prompt $PROMPT_COMMAND assertContains $lp_error_color 1 ) } 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.1.2/tests/test_connection.sh000066400000000000000000000026111425017241600211430ustar00rootroot00000000000000 # Error on unset variables set -u . ../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 { local 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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_cpu_sysctl.sh000066400000000000000000000023051425017241600211740ustar00rootroot00000000000000 # Error on unset variables set -u # 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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_detached_sessions.sh000066400000000000000000000051051425017241600224740ustar00rootroot00000000000000 # Error on unset variables set -u . ../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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_hostname_hash.sh000066400000000000000000000017161425017241600216320ustar00rootroot00000000000000 # Error on unset variables set -u . ../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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_net_wifi.sh000066400000000000000000000034601425017241600206130ustar00rootroot00000000000000 # Error on unset variables set -u # 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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_pmset.sh000066400000000000000000000054051425017241600201400ustar00rootroot00000000000000 # Error on unset variables set -u # 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/nojhan/liquidprompt/issues/315 outputs+=( "Now drawing from 'AC Power'" ) statuses+=(4) values+=('') # https://github.com/nojhan/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/nojhan/liquidprompt/issues/326 outputs+=( "Now drawing from 'AC Power' -InternalBattery-0 8%; charging; 2:46 remaining" ) statuses+=(2) values+=(8) # https://github.com/nojhan/liquidprompt/issues/326 outputs+=( "Now drawing from 'Battery Power' -InternalBattery-0 9%; discharging; (no estimate)" ) statuses+=(0) values+=(9) # https://github.com/nojhan/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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_ruby.sh000066400000000000000000000015351425017241600177710ustar00rootroot00000000000000 # Error on unset variables set -u . ../liquidprompt --no-activate # Liquidprompt depends on PS1 being set to detect if it has installed itself. PS1="$ " LP_ENABLE_RUBY_VENV=1 typeset -a rbenv_outputs rbenv_return_strings # Add test cases to these arrays like below # Example from rbenv documentation rbenv_outputs+=( "1.9.3-p327 (set by /Users/user/.rbenv/version)" ) rbenv_return_strings+=( "1.9.3-p327" ) 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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_sensors.sh000066400000000000000000000127071425017241600205070ustar00rootroot00000000000000 # Error on unset variables set -u . ../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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_shell.sh000066400000000000000000000410241425017241600201140ustar00rootroot00000000000000 # Error on unset variables set -u 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 "" ]]' } 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 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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit fi . ./shunit2 liquidprompt-2.1.2/tests/test_sysfs.sh000077500000000000000000000074301425017241600201620ustar00rootroot00000000000000# Error on unset variables set -u # 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 local 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" ) local -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-}" } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_terminal_device.sh000066400000000000000000000020571425017241600221420ustar00rootroot00000000000000 # Error on unset variables set -u . ../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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit ksh_arrays fi . ./shunit2 liquidprompt-2.1.2/tests/test_tools.sh000066400000000000000000000012251425017241600201440ustar00rootroot00000000000000 # Error on unset variables set -u LP_ROOT="${PWD%/tests}" 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 } function test_external_tool_tester { . ./tools/external-tool-tester.sh >/dev/null } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit fi . ./shunit2 liquidprompt-2.1.2/tests/test_utils.sh000066400000000000000000000565061425017241600201600ustar00rootroot00000000000000 # Error on unset variables set -u . ../liquidprompt --no-activate function test_strip_escape { local 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" } local 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_TEMPDIR 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_find_vcs() { return 1 } LP_ENABLE_SHORTEN_PATH=1 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_find_vcs() { return 1 } LP_ENABLE_SHORTEN_PATH=1 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_SHORTEN_PATH=1 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_SHORTEN_PATH=1 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_SHORTEN_PATH=1 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_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 } if [ -n "${ZSH_VERSION-}" ]; then SHUNIT_PARENT="$0" setopt shwordsplit fi . ./shunit2 liquidprompt-2.1.2/themes/000077500000000000000000000000001425017241600155345ustar00rootroot00000000000000liquidprompt-2.1.2/themes/alternate_vcs/000077500000000000000000000000001425017241600203665ustar00rootroot00000000000000liquidprompt-2.1.2/themes/alternate_vcs/alternate_vcs.theme000066400000000000000000000117601425017241600242510ustar00rootroot00000000000000 _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" } liquidprompt-2.1.2/themes/powerline/000077500000000000000000000000001425017241600175405ustar00rootroot00000000000000liquidprompt-2.1.2/themes/powerline/powerline.theme000066400000000000000000000426231425017241600225770ustar00rootroot00000000000000 _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_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_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 } liquidprompt-2.1.2/tools/000077500000000000000000000000001425017241600154075ustar00rootroot00000000000000liquidprompt-2.1.2/tools/external-tool-tester.sh000077500000000000000000000056041425017241600220540ustar00rootroot00000000000000#!/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 else # Bash shopt -s 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 > output.txt\nOr, to upload directly: %s | curl -F "sprunge=<-" "http://sprunge.us"\n' "$0" "$0" exit 1 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() { local stderr 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 uname 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 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 who am i 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/net/wireless 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 sensors -u test_tool acpi -t _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 ) for interface in ${_LP_LINUX_TEMPERATURE_FILES[@]+"${_LP_LINUX_TEMPERATURE_FILES[@]}"}; do test_tool cat "$interface" done test_tool date '+%I %M' test_tool tty test_tool basename -- /dev/pts/0 # shellcheck disable=SC2016 printf 'Tests complete.\nMake sure to upload the file directly, do not `cat` and copy paste!\n' >&2 liquidprompt-2.1.2/tools/theme-preview.sh000077500000000000000000000104361425017241600205330ustar00rootroot00000000000000#!/bin/bash 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 example prompts based on a standard set of input conditions. Designed to showcase Liquidprompt themes. 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 # Liquidprompt depends on PS1 being set to detect if it has installed itself. PS1="$ " # Since the shell is not evaluating PS1, we don't need these. _LP_OPEN_ESC="" _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_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 --no-config # Only needs to be done once lp_theme "$theme" || exit "$?" __lp_set_prompt 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 } _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 } _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 --no-config _config __lp_set_prompt printf 'Medium prompt:\n\n %s \n\n' "$PS1" ## Long # Configure options _long_config() { LP_ENABLE_SHORTEN_PATH=1 LP_PATH_LENGTH=29 COLUMNS=100 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_PERCENTS_ALWAYS=1 } _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 --no-config _long_config __lp_set_prompt printf 'Long prompt:\n\n %s \n\n' "$PS1"