I am trying to get a triangular background for bash PS1 prompt.
I have tried the existing library called powerline
but it seems to be heavy for my ageing laptop. I have managed to get the background colour, but have no idea of getting the shape. Currently what I have is:
.
Is there any straight-forward way of having those shape?
I am using:
$ echo $TERM
xterm-256color
$ echo $SHELL
/bin/bash
$ bash --version
GNU bash, version 4.3.42(1)-release (x86_64-redhat-linux-gnu)
You need to have powerline patched fonts installed. Get them here
And you need to configure your terminal to use them. (this ofc depends on your terminal but probably something like settings -> appearance -> fonts)
I've done something similar if you want a startingpoint: sbp
You can try it out by running . prompt.bash
.
Basically all you need if the fonts are installed and enabled is this $'\uE0B0'
somewhere in your PS1. It's the utf8 code for the fancy triangle. Assuming you're on a recent version of bash with some utf8 as locale, that should do it. Try echo -e $'\uE0B0'
in your terminal to test it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With