Displays a logo with your username in rainbow colours every time you open a new terminal window.
Should work with Bash and Zsh on MacOS / Linux.
-
Download and install Lolcat, which will be handling the colouring of the logo.
-
Download the
.asciilogo
file and place it in your home directory.
Press
Command
+Shift
+.
(MacOS) orControl
+Shift
+h
(Ubuntu) to display hidden dot files on your system.
- Open your existing shell configuration
~/.zshrc
,~/.bashrc
(Linux) or~/.bash_profile
(MacOS) in a code/text editor and place the following functions somewhere before the end of your configuration:
function displayLine () {
echo $1 | sed -e "s+{{username}}+@$USER+g"
}
function printLogo () {
local logo=$1
if [ -e "$logo" ]; then
echo ""
while IFS= read -r line; do
displayLine $line
done < $logo
echo ""
fi
}
- Place the following line at the end of your shell configuration where you want the logo to be printed:
printLogo ~/.asciilogo | lolcat
If you decided to put the logo somewhere else, replace the
~/.asciilogo
with the location and name of your logo.
- Save and restart your terminal
You should now see a colourful 🌈 logo with your username printed on the side every time you start a new session.
For further customisations such as animations and colour spreads, see the Lolcat repository on GitHub.
If you want the logo to display other dynamic content, you can expand the displayLine
function by piping more SEDs in a row and adding more {{stuff}}
to your logo:
echo $1 | sed -e "s+{{username}}+@$USER+g" | sed -e "s+{{something}}+@$REPLACEMENT+g"
Note that $USER
is a global variable and prints out your current username. The $REPLACEMENT
in this example would contain whatever you want the {{something}}
to be replaced with:
$REPLACEMENT=Content you want to display
These extra variables should be placed somewhere at the beginning of your configuration file.