Just wanted to tweak my prompt a little bit and threw this together for anyone using bash that likes the zsh 2 line prompt but prefers bash. The text you type will be white, if you guys want one for lighter prompts i can adjust it or you can.
you just need to add this line to your .bashrc in your home directory
EDIT: version with kali linux style offsets PS1="\033[38;5;209m\]┌──[\033[38;5;141m\]\u\033[38;5;209m\]:\033[38;5;105m\]\h\033[38;5;231m\]\W\033[38;5;209m\]]\n\033[38;5;209m\]└─\\[\033[38;5;209m\]$\[\033[37m\] "
and that should be all you need (its all i did)
if you want to remove your username and host from the title bar you can add
As I used to often modify my prompt, I set up a couple of aliases to make it easier to get the colours as needed - so here is a section of my .bashrc setup that gives you the building blocks for your own choices:
Don’t do that, that’s very inelegant… Just modify the PS1 to suit your needs.
@freebird54 if your terminal emulator supports truecolor, you can use \e[38;2;${RED};${GREEN};${BLUE}m (for foreground) and \e[48;2;${RED};${GREEN};${BLUE}m (for background), where RED, GREEN, and BLUE are integers between 0 and 255.
Now you should make 16777216 named variables, one for each colour, just in case1.
1 If you think that’s crazy, I would point out that it’s only 1048576 times crazier than your 16 named variables.
Come on - I never claimed it was comprehensive! Just a way to avoid having to look codes up when making changes…
Also, I find it useful when swapping to terminals in ‘other’ builds, where I might have different backgrounds in the terminal - or for occasions (now rare) where I have the background colour on each terminal when it opens. Rare, because I now don’t often need more than one open at a time (drop-down is so handy).
Perhaps I could just say that expansion and modification is left as an exercise for the user?
I am not sure I understand you fully. I think you are saying based on use case, you change the prompt colors? If so, wouldn’t it be easier to write a txt file with the codes for your different use cases and then source those in to your .bashrc instead of changing the .bashrc based on use case?
Your machine - your ways! Actually, I have a .bashrc-personal file that gets sourced in (if present) that contains all of that, and a pile of other aliases that I have become ‘addicted’ to over the years. For instance, my update routine uses an alias chain like so:
alias suc='su-c_wrapper'
alias spacman='suc pacman --color auto'
so to run an update I just type ‘sp’ and UpEnter to get it going. Who said being terminal centric needs a lot of typing?
Of course, it wouldn’t be that hard to wedge it into the ‘main’ .bashrc - but the default .bashrc varies between different system builds so it’s easier (for me) to just point things at a copy of .bashrc-personal…