You've already forked bash-git-prompt
added PS1 info
This commit is contained in:
29
README.md
29
README.md
@@ -1,4 +1,4 @@
|
||||
# Bash Git Prompt for Ubuntu 24.04
|
||||
# Bash Git Prompt for Linux
|
||||
[](#)
|
||||
[](#)
|
||||
[](#)
|
||||
@@ -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()`.
|
||||
|
||||
Reference in New Issue
Block a user