diff --git a/README.md b/README.md index 71e9c06..85bb881 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Bash Git Prompt for Ubuntu 24.04 +# Bash Git Prompt for Linux [![OS](https://img.shields.io/badge/ubuntu-24.04-E95420)](#) [![Shell](https://img.shields.io/badge/shell-bash-121011)](#) [![Feature](https://img.shields.io/badge/feature-git_prompt-0078D7)](#) @@ -98,6 +98,28 @@ This updates the theme instantly for your current session. --- +### Changing PS1 + +The script has been structured so modifying your PS1 is now simple and centralized. + +To change the PS1 **inside a Git repository**, modify: +``` +# +# PS1 custom for all themes inside a git repository +# +local PS1_CUSTOM='\[\e[0;32m\]\u@\h\[\e[0m\]' +``` + +To change the PS1 **outside a Git repository**, modify: +``` +# +# PS1 custom for all themes outside a git repository +# +PS1='\[\e[0;32m\]\u@\h\[\e[0m\]:\[\e[38;5;178m\]\w\[\e[0m\] '"${PROMPT_CHAR} " +``` + +--- + ### Available Themes Preview of all five themes (clean and dirty shown together for comparison): @@ -147,11 +169,6 @@ fi **Q:** Does this replace my default prompt entirely? **A:** No — the Git-aware segment only appears when your current directory is inside a **Git repository**. -Outside Git repos, your prompt remains normal (aside from minimal styling applied by the script). -To modify the non-Git prompt, edit this line in the script: -``` -PS1='\u@\h:\[\e[38;5;178m\]\w\[\e[0m\] '"${PROMPT_CHAR} " -``` **Q:** Can I create my own theme? **A:** Absolutely. Each theme is defined in the script under `set_git_prompt_theme_icons()`.