Home

Awesome

synth-shell-prompt

This script is part of synth-shell

synth-shell-prompt formats your terminal's prompt as shown in the figure below. However, it's not all eye-candy but also useful information:

screenshot

<br/><br/>

<!--------------------------------------+-------------------------------------->

Setup

<!--------------------------------------+-------------------------------------->

Arch Linux

You may install synth-shell-prompt from AUR: https://aur.archlinux.org/packages/synth-shell-prompt-git/ Once installed, test it with:

. /usr/bin/synth-shell-prompt

And if you like it, add it permanently to your terminal with:

echo ". /usr/bin/synth-shell-prompt" >> ~/.bashrc

Manual setup

The included setup script will guide you step by step through the installatioj process. Just clone this repository and run it:

git clone --recursive https://github.com/andresgongora/synth-shell-prompt.git
synth-shell-prompt/setup.sh

Then install the required fonts packages to display the triangle separators properly:

You can then test your script by sourcing it from wherever you installed it. Usually this is to your user's .config folder, so you should run the following command. Notice the ., this is meant to source the script to your terminal session (i.e. include it into your session).

. ~/.config/synth-shell/synth-shell-prompt.sh

If you want it to appear everytime you open a new terminal, run either

echo ". ~/.config/synth-shell/synth-shell-prompt.sh" >> ~/.bashrc

Configuration/customization

You can configure your scripts by modifying the corresponding configuration files. You can find them, along example configuration files, in the following folders depending on how you installed synth-shell:

Command in new line

In addition to having the command-line right after the prompt, it is possible to set-up synth-shell to instead display the command on the next line, which looks like this:

next_line_command

This can be achieved by changing the option enable_command_on_new_line=false to enable_command_on_new_line=true on the MAIN FORMAT section of the synth-shell-prompt.config file.

<br/><br/>

<!--------------------------------------+-------------------------------------->

Overview

<!--------------------------------------+-------------------------------------->

fancy-bash-prompt.sh Adds colors and triangular separators to your bash prompt, and if the current working directory is part of a git repository, also git statuses and branches. For best results, consider installing (and telling your terminal to use) the hack-ttf font alongside the powerline-fonts (the later is required for the separators).

As for the git status info, fancy-bash-prompt.sh prints an additional, fourth separator with the name of the current branch and one of the following icons to indicate the state of the repository (can be changed in the config file):

Local-UpstreamLocal branch has no changesLocal branch is dirty
Up to date
Ahead (you have to push)
Behind (you have to pull)
Diverged (you have to pull-push)

<br/><br/>

<!--------------------------------------+-------------------------------------->

Contribute

<!--------------------------------------+-------------------------------------->

This project is only possible thanks to the effort and passion of many, including developers, testers, and of course, our beloved coffee machine. You can find a detailed list of everyone involved in the development in AUTHORS.md. Thanks to all of you!

If you like this project and want to contribute, you are most welcome to do so.

Help us improve

<br/><br/>

<!--------------------------------------+-------------------------------------->

About

<!--------------------------------------+-------------------------------------->

synth-shell-prompt is part of synth-shell

<br/><br/>

<!--------------------------------------+-------------------------------------->

License

<!--------------------------------------+-------------------------------------->

Copyright (c) 2014-2023, Andres Gongora - www.andresgongora.com