Oct 25, 2023 6 min read

How to Customize the Linux Terminal Splash Screen

Customize Linux terminal splash screen with our step-by-step tutorial. Splash screen provides visual customization to Linux terminal.

Customize the Linux Terminal Splash Screen
Table of Contents

Introduction

Before we start talking about how to modify the Linux terminal splash screen, let's briefly understand - What is a Splash Screen ?

The splash screen in the Linux terminal provides visual customization and personalization. By modifying the terminal's splash screen, you can change the appearance of your terminal and enhance your overall Linux experience.

Since they spend the majority of their working hours typing commands in the terminal, many Linux users consider it to be a second home in a sense. If you don't want to become tired of staring at the drab, black command-line interface, you should customize the terminal to your liking.

With Linux, you can modify every aspect of the terminal, including the splash screen, color schemes, font, and how it appears and behaves.

This tutorial will walk you through the process of modifying the Linux terminal splash screen.  We will also address a few FAQs on how to modify the Linux terminal splash screen.

Step 1: Locating the Shell Configuration File

Your Linux computer's terminal emulator serves as a front end for the underlying shell. Bash is the standard shell that comes preloaded on the majority of Linux distributions. On Linux, you can always switch the shell using chsh if you don't like the default shell, which is typically Bash.

The user's home directory has a configuration file for each shell. The file is known as .bashrc for Bash. It will also be called .zshrc if you are using Zsh.

Find the configuration file for the shell you're currently using in your home directory. We will show you how to personalize Bash's splash screen for the sake of this article. But take note that the procedures apply to other shells as well.

To customize the splash screen of your terminal, first open the shell configuration file in your preferred text editor. In our case, Vim:

vim ~/.bashrc

Step 2: Including the Splash Screen Content

Try printing a straightforward string to see if the configuration file is correctly read by the shell before adding complex scripts to the file. To accomplish this, add the following line to the config file:

echo "Welcome to the Terminal!"

To examine the changes, save, quit Vim, and then restart the terminal.

Every time the shell is started, which often happens when you restart the terminal, the welcome text message will be shown.

It's time to add some exciting data and commands to the config file now that you understand how it functions.

1) Show System Data on the Splash Screen

You can liven things up by attractively displaying system information at the top of a new terminal instance. There are already a number of programs that can extract the system details and present them to you elegantly, so you don't have to worry about that. Neofetch and Screenfetch are two of the most popular ones.

Use your system's built-in package manager to install Neofetch (or Screenfetch) before adding the commands to the configuration file.

Next, based on the package you previously installed, add one of the following commands to the end of the shell configuration file:

neofetch
screenfetch

Restart the terminal after saving the modifications.

2) Display a Random Message

Whenever you launch the terminal, fortune can be used to display a random selection of (sometimes humorous) quotes. Install the fortune package on your machine first, then change the configuration file.

On Ubuntu/Debian:

sudo apt install fortune

On Arch Linux:

sudo pacman -S fortune-mod

On Fedora and CentOS:

sudo dnf install fortune-mod

After installation, include the next command at the end of the configuration file:

fortune

To make eye-catching splash screen prompts, use Pipe Fortune with other tools like Cowsay. Add the following line to your shell configuration file after installing the cowsay package on your computer:

fortune | cowsay

3) Display an ASCII Art at Launch

For some users, plain text might be a significant turn-off. Although the Linux terminal does not support images or videos, ASCII art can be used to give the screen a visual touch.

You may do this by converting regular text to ASCII graphics using the figlet tool. The package can be obtained using the built-in package manager and is accessible via official distribution repositories.

On Debian-based systems like Ubuntu:

sudo apt install figlet

To install figlet on Arch Linux:

vsudo pacman -S figlet

On Fedora/CentOS and other RPM-based distros:

sudo dnf install figlet

After installation, add the next line to the shell configuration file:

figlet -cl "This is a string"

…where the text you wish to display as ASCII art is "This is a string."

4) Insert Weather and Date Information

You can set up the terminal to prompt you with the date and weather as it launches if you're crazy about Linux and frequently forget such information while working on the command line.

If you don't already have curl installed on your computer, do so now. Then, add the subsequent line to the config file to receive weather information each time you launch the terminal:

curl wttr.in/paris?0

Make sure to substitute your location for "paris" in the aforementioned command. Instead of printing the standard three-day prediction, the ?0 instructs the software to only print the present weather.

Using the date utility, you can print the current date and day as well. Simply insert the following line into the shell configuration:

date

When both commands have been added to the file, the splash screen will resemble the following:

Step 3: Saving and Updating the Changes

Once you've finished modifying and adjusting the configuration file, save it and then close it to make the changes permanent. To see the splash screen, simply restart the terminal from the Applications menu or use the shortcut Ctrl + Alt + T.

Additionally, you can write unique scripts that print the information you want to appear on your terminal's splash screen. After that, all you have to do is include the command to run the script in the shell configuration file.

Don't Accept the Terminal's Default Appearance

Users can completely customize the look and behavior of their Linux system, unlike Windows and macOS. Since the majority of the operating system's code is open-source and editable, you can essentially change any aspect of it.

But if you are not familiar with the programming language, it may be challenging to understand the code. Therefore, Linux users who are interested in kernel development and customization should have a solid understanding of the C programming language and its ideas.

FAQs to Customize Linux Terminal Screen

Where is the MOTD located? 

In most Linux distributions, the MOTD is stored in the /etc directory. Specifically, the file /etc/motd controls the content of the splash screen.

Can I modify the MOTD without root access? 

No, modifying the MOTD usually requires root access, as it involves editing files located in system directories.

What is the recommended way to modify the MOTD?

The MOTD is typically a static text file, so modifying it directly with a text editor is the simplest way. Use the command sudo nano /etc/motd (replace nano with your preferred text editor) to open and modify the file.

Can I include dynamic information in the MOTD? 

Yes, you can include dynamic information in the MOTD by using command substitution. For example, you can include the output of commands like date or uptime to display real-time information.

How can I display ASCII art or a custom banner in the MOTD? 

To display ASCII art or a custom banner in the MOTD, you can copy the art to the /etc/motd file or create a separate file and include it in the MOTD using the cat command.

Can I use colors in the MOTD? 

Yes, you can use color codes to add colors to the MOTD. Enclose the desired text with color codes in the form of \e[<color_code>m. For example, \e[31m sets the text color to red.

How can I restore the default MOTD? 

To restore the default MOTD, you can delete everything in the /etc/motd file and replace it with a simple message or leave it empty. Alternatively, you can copy the original /etc/motd file if you have a backup.

Conclusion

Modifying the Linux terminal splash screen (MOTD) allows you to personalize and display relevant information when opening a terminal. Whether you want to include a custom message, ASCII art, dynamic system information, or colorful text, customizing the MOTD can enhance your command-line experience.

By following the steps outlined in this tutorial, you can easily modify the Linux terminal splash screen and tailor it to your preferences or system needs.

If you have any queries, please mention it in the comments below.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to DevOps Tutorials - VegaStack.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.