$ show liquidprompt/liquidprompt
Liquid Prompt is a feature-rich, adaptive shell prompt for Bash and Zsh. It dynamically displays contextual information such as VCS status (Git, Mercurial, Subversion, Fossil, Bazaar), system load, battery level, temperature, Wi-Fi signal, and more. The prompt is highly configurable via environment variables, config files, themes, and presets. The architecture is a monolithic shell script (~5000 lines) with a theme engine that allows custom prompt layouts. It includes a comprehensive test suite using shunit2, CI across 20+ shell versions, and extensive documentation. The codebase is actively maintained with regular releases and deprecation paths for older features.
The LLM identified 4 files worth highlighting for reuse:
Implements the Powerline theme for Liquid Prompt. Demonstrates the theme contract: _lp_powerline_theme_activate, _lp_powerline_theme_directory, _lp_powerline_theme_prompt. This file is a self-contained example of how to create a custom theme by implementing three required functions. It can be reused as a template for new themes with minimal adaptation.
A configuration preset that enables Nerd Font icons for the prompt. It sets LP_MARK_* variables to Unicode glyphs from Nerd Fonts. This file is a clean example of how to create a reusable config preset that can be sourced to change prompt appearance. It is isolated and can be applied to any Liquid Prompt installation.
A test file for Git integration using shunit2. It demonstrates a robust pattern for testing shell functions: stubbing external commands (git), setting up and tearing down test environments, and asserting on both stdout and return codes. This pattern is reusable for testing any shell-based tool that interacts with external commands.
The main script (~5000 lines) that implements all prompt logic. While not reusable as a standalone component due to tight coupling, it demonstrates advanced shell scripting techniques: dynamic backend selection (sysfs, acpi, sensors), caching, cross-shell compatibility (Bash/Zsh), and a functional API with return codes. It is the core of the project and a reference for building complex shell applications.