Bash Prompts

Date: 2017-11-10
smiley () { echo -e ":\\$(($??50:51))"; } 
export PS1="\h\$(smiley) \e[30;1m\w\e[0m\n\$ "

More advanced bash prompts:

Powerline (Source: https://wiki.archlinux.org/index.php/Powerline)

sudo pacman -Sy powerline powerline-fonts

Add the following to your ~/.bashrc:

powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/share/powerline/bindings/bash/powerline.sh

Show git branch  (Source: https://github.com/powerline/powerline/issues/186#issuecomment-247810572)

mkdir -p ~/.config/powerline
cat <<-'EOF' > ~/.config/powerline/config.json
{
    "ext": {
        "shell": {
            "theme": "default_leftonly"
        }
    }
}
EOF
powerline-daemon --replace

Windows fonts (https://github.com/powerline/fonts)

eg. https://github.com/powerline/fonts/raw/master/DejaVuSansMono/DejaVu%20Sans%20Mono%20for%20Powerline.ttf

9310cookie-checkBash Prompts