-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 286c1ae
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "vendor/bash-git-prompt"] | ||
path = vendor/bash-git-prompt | ||
url = git@github.com:koffeinfrei/bash-git-prompt.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
source "${BASH_SOURCE%/*}/vendor/bash-git-prompt/bash-git-prompt" | ||
|
||
# parameters: | ||
# $1: chroot | ||
set_bash_prompt() { | ||
local chroot=$1 | ||
|
||
local color_path="\[\033[0;37m\033[01;2m\]" | ||
local color_git="\[\033[01;22m\033[34m\]" | ||
local color_space="\[\033[37m\]" | ||
local color_icon="\[\033[1m\033[01;32m\]" | ||
local color_reset="\[\033[00m\]" | ||
|
||
case "$TERM" in | ||
xterm-color|xterm|screen-256color) color_prompt=yes;; | ||
esac | ||
|
||
if [ "$color_prompt" = yes ] || [ "$COLORTERM" = truecolor ]; then | ||
PS1="${chroot:+($chroot)}$color_path \w $color_git$(__git_ps1_improved)$color_space $color_icon➜$color_reset " | ||
else | ||
PS1="${chroot:+($chroot)} \w $(__git_ps1_improved) ➜ " | ||
fi | ||
|
||
unset color_prompt | ||
|
||
# If this is an xterm set the title to user@host:dir | ||
case "$TERM" in | ||
xterm*|rxvt*) | ||
PS1="\[\e]0;${chroot:+($chroot)}\u@\h: \w\a\]$PS1" | ||
;; | ||
*) | ||
;; | ||
esac | ||
} |
Submodule bash-git-prompt
added at
45e449