📅 August 24, 2017
Have you opened a terminal, such as RetroPie for the Raspberry Pi, and admired the RetroPie ASCII art logo adjacent to a brief system information listing?
Wouldn’t it be fun to do the same in a desktop Linux installation?
With a program called neofetch, you can view the ASCII art logo for your current distribution complete with a synopsis of system information.
Neofetch is not available in the repositories. For Linux Mint 18.2 and other Ubuntu-based distributions, you can install the PPA.
sudo add-apt-repository ppa:dawidd0811/neofetch sudo apt-get update sudo apt-get install neofetch
However, I downloaded the .deb package directly from http://ppa.launchpad.net/dawidd0811/neofetch/ubuntu/pool/main/n/neofetch/ to avoid adding yet another PPA to the system.
It is a 65K file, so the download is quick. Next, install it by double-clicking the .deb file or using dpkg in a terminal.
sudo dpkg -i neofetch_3.2.0-3~ubuntu16.04.1_all.deb
After neofetch installs, open a terminal and run neofetch.
Depending upon the distribution, you should see a different logo. I ran neofetch in two different VirtualBox virtual machines: Xubuntu 16.04.03 and Linux Mint 18.2 XFCE.
There are a number of options available for neofetch, so check the man pages for details (man neofetch).
You can customize the output. For example, there are various Ubuntu variants, so to display the Xubuntu logo instead of the generic Ubuntu logo, use the –ascii_distro option.
neofetch --ascii_distro xubuntu
For fun, you can pipe the output of neofetch to lolcat, but the result will not be as neatly arranged.
neofetch | lolcat
Show neofetch Each Time a Terminal Opens
If you are familiar with earlier versions of Linux Mint, then you will probably remember how cowsay would show a fortune each time a new terminal was opened. We can do the same with neofetch so system information appears when we open a terminal
In your home directory, open the hidden file .bashrc in a text editor, such as gedit.
At the end of the file, add the line neofetch.
This assumes that neofetch is already installed. A more robust script would include a check to see if neofetch is installed as an executable, and, if not, ignore neofetch.
In a terminal, enter whereis neofetch to find the absolute path to its binary. We need this path.
This should return a list of paths something like this:
neofetch: /usr/bin/neofetch /etc/neofetch /usr/share/neofetch /usr/share/man/man1/neofetch.1.gz
The main executable is usually the first path listed (/usr/bin/neofetch), so let’s use that.
Open ~/.bashrc, and add the conditional Bash statement to the end of the file as shown:
if [ -x /usr/bin/neofetch ] then /usr/bin/neofetch fi
(Make sure to remove the previous neofetch we added earlier or else neofetch will display twice.)
We edited .bashrc located in the user’s home directory to avoid applying it system-wide. This way, only the user with the edited .bashrc will see the neofetch information. This approach is more user-friendly. Not everyone may want to see a forced neofetch upon opening a terminal.