mirror of
https://github.com/sbrl/bin.git
synced 2018-01-10 21:33:46 +00:00
Change dollar sign / hash depending on jobs currently running
This commit is contained in:
parent
2a3b98607d
commit
fb6bf89469
1 changed files with 14 additions and 3 deletions
17
.bashrc
17
.bashrc
|
@ -73,12 +73,23 @@ set_bash_prompt()
|
||||||
{
|
{
|
||||||
# Update the history file after every command
|
# Update the history file after every command
|
||||||
# This prevents a loss of history in the case of an unclean exit
|
# This prevents a loss of history in the case of an unclean exit
|
||||||
history -a
|
history -a;
|
||||||
|
|
||||||
|
# Make the dollar sign bold if there are background jobs, and
|
||||||
|
# underlined if there are stopped jobs
|
||||||
|
local dollar_colour="";
|
||||||
|
if [ $(jobs -r | wc -l) -gt "0" ]; then
|
||||||
|
dollar_colour="${HC}";
|
||||||
|
fi
|
||||||
|
if [ $(jobs -s | wc -l) -gt "0" ]; then
|
||||||
|
dollar_colour="${dollar_colour}${UL}";
|
||||||
|
fi
|
||||||
|
|
||||||
PS1="${debian_chroot:+($debian_chroot)}${HOST_COLOUR}\u@\H\[\033[00m\]$(prompt_colon)\[\033[01;34m\]\w\[\033[00m\]"
|
PS1="${debian_chroot:+($debian_chroot)}${HOST_COLOUR}\u@\H\[\033[00m\]$(prompt_colon)\[\033[01;34m\]\w\[\033[00m\]"
|
||||||
if [[ "$UID" = 0 ]]; then
|
if [[ "$UID" = 0 ]]; then
|
||||||
PS1="${PS1}# "
|
PS1="${PS1}${dollar_colour}#${RS} "
|
||||||
else
|
else
|
||||||
PS1="${PS1}\$ "
|
PS1="${PS1}${dollar_colour}\$${RS} "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue