Paz-1's avatar
That's already in my favs :D I would like to ask a noob question if I may. how the bashrc line should be to have the command prompt look like that? thanks!
kexolino's avatar
:)

In your bashrc, search for the line "PS1", that is where you change the prompt. To change the second line, you change PS2.

Before those lines somewhere, paste this in:

# ANSI color codes
RS="\[\033[0m\]" # reset
HC="\[\033[1m\]" # hicolor
UL="\[\033[4m\]" # underline
INV="\[\033[7m\]" # inverse background and foreground
FBLK="\[\033[30m\]" # foreground black
FRED="\[\033[31m\]" # foreground red
FGRN="\[\033[32m\]" # foreground green
FYEL="\[\033[33m\]" # foreground yellow
FBLE="\[\033[34m\]" # foreground blue
FMAG="\[\033[35m\]" # foreground magenta
FCYN="\[\033[36m\]" # foreground cyan
FWHT="\[\033[37m\]" # foreground white
BBLK="\[\033[40m\]" # background black
BRED="\[\033[41m\]" # background red
BGRN="\[\033[42m\]" # background green
BYEL="\[\033[43m\]" # background yellow
BBLE="\[\033[44m\]" # background blue
BMAG="\[\033[45m\]" # background magenta
BCYN="\[\033[46m\]" # background cyan
BWHT="\[\033[47m\]" # background white

This way, if you want to change something's background to white, you don't need to type in \[\033[47m\], just BWHT

Check out this link to see what the prompt escapes are (and for much more detailed info of bash prompts), and lastly here's mine:

PS1="$HC$FBLE┌─ $HC$FYEL\u: $RS\w\n$HC$FBLE└─ $RS"
PS2="$FRED> $RS$HC$FMAG"

If you have more questions, just ask, and I'll answer if I can :P
Thank you so much, you're awesome, I was looking for this trick like forever, great theme btw.
kexolino's avatar
Thanks :)
Thought the PS2 line I posted is totally unnecessary, and I wasn't even using it, but I totally forgot. So it's enough to just use the PS1 line.
Also, I just changed it up yesterday,
PS1="$HC$FWHT┌─╼[$HC$FBLE\u$HC$FWHT]╾─╼[$HC$FGRN\w$HC$FWHT]\n└─╼ "
Paz-1's avatar
Thank you so much! the question I have for now is, how to reverse to the previous state if something went wrong?
kexolino's avatar
Also, here is Ubuntu's default .bashrc: [link]
Paz-1's avatar
Thank you so much! here is my first attempt :blush: [link]
kexolino's avatar
hm, what went wrong?
If you didn't back up your bashrc (I forgot to tell you..), I guess you could edit your PS1 line to be this:
PS1="\u@\H: \w $"
This is what the default in Ubuntu is like. If you still have problems, check if the directory /etc/skel has a bashrc in it (I don't use Ubuntu, so I can't), and if it has, copy it over to your home directory, overwriting the old one.
If it doesn't, then I'll send you my own (stolen from the CrunchBang forums lol), and you can go from there.
Paz-1's avatar
Nothing went wrong yet..lol..I play safe and asking before I'll mess up the all thing :lol: there is bashrc in /etc/skel. Thanks!
kexolino's avatar
the line that starts with "PS1" lol
Paz-1's avatar
I'm not sure you saw my answer..^^ all is well lol..just a bit confused with the colours now .. as you can see here [link]
kexolino's avatar
Yeah I saw it. I recommend using a font like terminus to get even colors (try it, you'll see what I mean)
Paz-1's avatar
I do use terminus most of the time, anyway it's not changing the colors. strange..