Ok, so I had some downtime at work. By this I meant an evening shift where absolutely nothing was going on. So I decided to play with one of my Virtual Machines. My Setup at work consists of my Laptop, a USB Monitor, and a standard VGA Monitor, so 3 screen in total. On one screen I usually have a full screen instance of Kali Linux going via VirtualBox.
I found two really cool sites called Bashrcgenerator.com and Ezprompt.net. I used both of them to create my new user bash prompts:
The reason for the two sites is they encode each part differently. For instance Bashrcgenerator.com wasn’t bolding my text, in fact bold text only seems to work on the base 16 colours so aspects like the Username and Date I configured over at EZprompt.com.
In order to not get everything mixed up, seeing as I was using two sites to create my bash prompt, I divided it up into sections first. Start 1 and Start 2, as the first character is different, then user, hostname, directory, Middle section, Date and Time, ending and prompt. (see Diagram below).
Once I had all my sections created individually in notepad, I then pasted them together in the order I needed. I then took the final string and pasted it as my last line in my /home/username/.bashrc file (in case of root its /root/.bashrc). The reason why I do not overwright the original PS1 entry is that if later on I get bored, I can just remove the last line and it brings back the original prompt.
Here are my two prompts for anyone wishing to have the same:
1 2 |
# Root Prompt PS1="\[\033[38;5;52m\]┌\[$(tput sgr0)\]\[\033[38;5;124m\]─\[$(tput sgr0)\]\[\033[38;5;196m\]─{\[$(tput sgr0)\]\[\e[01;37m\]\u\[\e[m\]\[\e[31m\]@\h\[\e[m\]:\[\033[38;5;220m\]\w\[$(tput sgr0)\]\[\033[38;5;196m\]}─\[$(tput sgr0)\]\[\033[38;5;124m\]─\[$(tput sgr0)\]\[\033[38;5;52m\]─\[$(tput sgr0)\]\[\033[38;5;124m\]─\[$(tput sgr0)\]\[\033[38;5;196m\]─{\[$(tput sgr0)\]\[\e[01;37m\]\d \t\[\e[m\]\[\033[38;5;196m\]}─\[$(tput sgr0)\]\[\033[38;5;124m\]─\[$(tput sgr0)\]\[\033[38;5;52m\]─\[$(tput sgr0)\]\n\[\033[38;5;52m\]└\[$(tput sgr0)\]\[\033[38;5;124m\]─\[$(tput sgr0)\]\[\033[38;5;196m\]─{\[$(tput sgr0)\]\\$ " |
1 2 |
# Regular User PS1="\[\033[38;5;27m\]┌\[$(tput sgr0)\]\[\033[38;5;39m\]─\[$(tput sgr0)\]\[\033[38;5;51m\]─{\[$(tput sgr0)\]\[\e[01;37m\]\u\[\e[m\]\[\033[38;5;38m\]@\h\[$(tput sgr0)\]:\[\033[38;5;87m\]\w\[$(tput sgr0)\]\[\033[38;5;87m\]}\[$(tput sgr0)\]\[\033[38;5;51m\]─\[$(tput sgr0)\]\[\033[38;5;39m\]─\[$(tput sgr0)\]\[\033[38;5;27m\]─\[$(tput sgr0)\]\[\033[38;5;39m\]─\[$(tput sgr0)\]\[\033[38;5;51m\]─{\[$(tput sgr0)\]\[\e[01;37m\]\d \t\[\e[m\]\[\033[38;5;51m\]}─\[$(tput sgr0)\]\[\033[38;5;39m\]─\[$(tput sgr0)\]\[\033[38;5;27m\]─\[$(tput sgr0)\]\n\[\033[38;5;27m\]└\[$(tput sgr0)\]\[\033[38;5;39m\]─\[$(tput sgr0)\]\[\033[38;5;51m\]─{\[$(tput sgr0)\]\\$ " |