Trueline: Bash Powerline Style Prompt with True Color Support
Trueline is an advanced command prompt customization tool for Bash users who enjoy having a sleek and colorful terminal. It provides a "Powerline" style appearance and supports true color, enhancing the visual aesthetics of the terminal environment. Trueline takes inspiration from other popular tools like Pureline and Powerlevel9k and implements additional features like RGB color support and expanded icon usage to make your prompt visually appealing and efficient.
Installation
Installing Trueline is straightforward. Users need to download the trueline.sh
script from the official repository and add a source command to their .bashrc
file. This ensures the prompt is activated each time a new terminal session begins.
$> git clone https://github.com/petobens/trueline ~/trueline
$> echo 'source ~/trueline/trueline.sh' >> ~/.bashrc
Alternatively, users can directly download the script file using wget:
$> wget https://raw.githubusercontent.com/petobens/trueline/master/trueline.sh -P ~/
$> echo 'source ~/trueline.sh' >> ~/.bashrc
Once installed, if your terminal uses fonts that support "Powerline" glyphs such as Nerd Fonts, the appearance should immediately improve without any additional configuration.
Customization
Customization is a breeze with Trueline, as it offers multiple options to personalize the prompt display. Users must define these settings in their .bashrc
file before sourcing Trueline to change from the default configuration.
Colors
Colors are specified using RGB values through an associative array called TRUELINE_COLORS
. You can redefine default colors or add new ones by modifying this array. However, one special color key, default_bg
, should not be changed, as it reflects the terminal's default background color.
declare -A TRUELINE_COLORS=(
[light_blue]='75;161;207'
[grey]='99;99;100'
[pink]='199;88;157'
)
Segments
The command prompt is divided into segments, which are customizable blocks of information. Defined in the TRUELINE_SEGMENTS
array, each segment specifies what info to display (e.g., working directory, Git status), its text color, background color, and font style (like bold or italic). Users can rearrange or disable segments to tailor their prompt.
declare -a TRUELINE_SEGMENTS=(
'working_dir,light_blue,black,normal'
'git,grey,black,normal'
'time,white,black,normal'
'newline,pink,black,bold'
)
Symbols
Trueline allows the use of icons and symbols to add visual cues to the prompt. Defined in TRUELINE_SYMBOLS
, these can be changed to suit user preferences.
declare -A TRUELINE_SYMBOLS=(
[git_modified]='*'
[newline]='❯'
[clock]='🕒'
)
Options
Trueline also provides various options to further refine the prompt's behavior and appearance. These include segment-specific settings and general adjustments like showing Vim mode, which can be configured via boolean variables or color settings.
Extensions
The flexibility of Trueline means users can add custom segments by writing new functions and including them in the TRUELINE_SEGMENTS
array. This makes the tool highly extensible for developers who need more than the default features.
Trueline combines functionality and style, offering a powerful way to enhance your terminal experience. With its easy installation and wide customization options, it's a great choice for Linux and macOS users who want their Bash prompt to be as informative and appealing as possible.