How To Rice Your Linux-Terminal
In this article we describe how you can customize and rice your Linux-Terminal.
Requirements:
- Difficulty: Easy
- Needs:
- screenfetch, archey, screenfo, neofetch or similar
- bash basics
- that's it, you are good to go :)
Introduction
On launch of my terminal, I don't want a blank window. So I installed screenfetch, which is one of those nifty terminal theme information + ASCII distribution logos you see in everyone's screenshots nowadays.
And I put a call to it in my .bashrc.
But there is still the problem that it looks the same on every start. Same logo. Same colors.
So you are using a script for GNU Linux that displays system information like Screenfetch or Archey, Screenfo or Neofetch.
If you get bored too this article, will show you a way to change displayed distribution logo & colors on every use.
Content
Programs like screenfetch automatically detect your distro to display the logo and multiple system info's. That's the reason, you are always getting the same logo and with that the same text color.
While going randomly through the man page of screenfetch, I noticed the -A Flag.
-A 'DISTRO' Here you can specify the distribution art that you want displayed. This is for when you want your distro detected but want to display a different logo.
So it's possible to show the logo of another distro by giving the according name.
Because I don't know all distributions supported by screenfetch, I opened the source code and looked through it.
I tried all I found and wrote them into an array.
Afterwards I noticed, that the man page names them all. I don't know how I could oversee this. But you still couldn't just copy the list. But I tried all 70 of them and came up with this usable list.
distro=("Alpine Linux" "Antergos" "Arch Linux" "Arch Linux - Old" "BLAG" "BunsenLabs" "CentOS" "Chakra" "Chapeau" "Chrome OS" "CrunchBang" "CRUX" "Debian" "Deepin" "LinuxDeepin" "Devuan" "elementary OS" "Exherbo" "Fedora" "Frugalware" "Fuduntu" "Funtoo" "Fux" "Gentoo" "gNewSense" "Jiyuu Linux" "Kali Linux" "KaOS" "KDE neon" "Kogaion" "Korora" "Mint" "LMDE" "Logos" "Mageia" "Mandriva" "Manjaro" "Netrunner" "NixOS" "openSUSE" "Parabola GNU/Linux-libre" "Pardus" "Parrot Security" "PCLinuxOS" "Peppermint" "Qubes OS" "Raspbian" "Red Hat Enterprise Linux" "ROSA" "Sabayon" "SailfishOS" "Scientific Linux" "Slackware" "Solus" "SparkyLinux" "SteamOS" "SwagArch" "Trisquel" "Ubuntu" "Viperr" "Void" "DragonFlyBSD" "FreeBSD" "NetBSD" "OpenBSD" "FreeBSD - Old" "Unknown" "Haiku" "Mac OS X" "Cygwin")
And now we simply add a random index, to make things fun and different every time we call it. Then we can feed screenfetch with one item of our array at the random index.
RAND=$[ $RANDOM % 70] distro=("Alpine Linux" "Antergos" "Arch Linux" "Arch Linux - Old" "BLAG" "BunsenLabs" "CentOS" "Chakra" "Chapeau" "Chrome OS" "CrunchBang" "CRUX" "Debian" "Deepin" "LinuxDeepin" "Devuan" "elementary OS" "Exherbo" "Fedora" "Frugalware" "Fuduntu" "Funtoo" "Fux" "Gentoo" "gNewSense" "Jiyuu Linux" "Kali Linux" "KaOS" "KDE neon" "Kogaion" "Korora" "Mint" "LMDE" "Logos" "Mageia" "Mandriva" "Manjaro" "Netrunner" "NixOS" "openSUSE" "Parabola GNU/Linux-libre" "Pardus" "Parrot Security" "PCLinuxOS" "Peppermint" "Qubes OS" "Raspbian" "Red Hat Enterprise Linux" "ROSA" "Sabayon" "SailfishOS" "Scientific Linux" "Slackware" "Solus" "SparkyLinux" "SteamOS" "SwagArch" "Trisquel" "Ubuntu" "Viperr" "Void" "DragonFlyBSD" "FreeBSD" "NetBSD" "OpenBSD" "FreeBSD - Old" "Unknown" "Haiku" "Mac OS X" "Cygwin") screenfetch -A ${distro[$RAND]} -w
Note: The -w Flag ( -w Wrap long lines. ) is just there to fit all information on a normal terminal window.
Conclusion
And that's all you have to do. Now you can enjoy all the beautiful logos available. And everytime a different one (or at least one of the 70).
And mentioned, you just have to put this code into your .bashrc (or equivalent). So when you launch a new instance, this code will be executed.
But you could also make an alias which calls an bash script file with this code inside. Just remember to give the absolute path of screenfetch so you don't create and infinite loop.