The terminal emulator plays an integral part in a Linux system, and many users like to change its theme for a customized presentation. Users prefer a quick makeover within their Linux distribution. With a few tweaks, you can change the entire appearance of the terminal window.
Since you spend most of your time within the terminal, why not make it look like what you prefer. The graphical user interface (GUI) does not need any special commands for customization, so a quick reference guide like this should serve you well.
Check out the following tips for a quick, seamless transition from your old dull and drab terminal to a customized, rustic look.
1. Create a New Terminal Profile
Before you make any changes to the terminal, creating a new profile is advisable. This way, the changes won’t affect the main terminal profile. It is highly recommended to create a new profile and revert to your previous settings if you are unable to reinstate the default values or if the changes are not as per your liking.
You can switch between the terminal profiles whenever you want and the system will open another terminal with the new profile settings.
2. Use a Dark/Light Terminal Theme
If you are not looking to change your system’s theme, you can oscillate between light and dark terminal themes instead. You can view the theme settings under General in the Preferences box and change the setting as per your choice.
You'll find the Preferences option on your terminal. In the top right corner of your terminal, you can access the hamburger menu; from there, select the Preferences option, followed by the General option.
3. Change the Font Type and Size
Select the profile you want to customize before changing the font type and size. After selecting the profile, you can review the various options to change the appearance of the text, cursor shape, spacing, font type, and size.
You can also change the font for the terminal by choosing another font from the options available. In case you need some other font, you will need to download and install it on your system.
Note: Users should choose monospaced fonts only. Otherwise, all characters will overlap, making the text difficult to read.
4. Change the Color Scheme and Transparency
You already know how to change the font type, size, and spacing. How about adding some zest to the terminal? That's right; you can also choose a custom colorful pallet for your terminal. The Colors tab in the menu will help you change the text color and the terminal background color.
If you want to make it more stylish, you can adjust the transparency on the terminal. The color palette in the options menu lets you play with unique coloring too.
5. Tweak the Bash Prompt Variables
Usually, the username you set while installing your Linux OS appears along with the hostname as the bash prompt. For example, if your username is user1 and you're using Ubuntu, the default bash prompt will be user1@ubuntu.
If you want to change your machine's hostname, you can type:
hostname customname
...where customname is the new hostname that you want to set for your machine.
Unfortunately, this change is restricted to the current session only. In order to permanently change the hostname, you need to restart the system and then type:
sudo hostnamectl set-hostname customname
Similarly, you can change your username, but this requires some extra levels of configuration, so it is best to steer clear away from this modification if you're a beginner.
6. Change the Appearance of the Bash Prompt
This tweak is recommended for advanced users only, especially those well-versed with the terminal and bash scripting. To tweak the font and color of the bash prompt, you can use commands to do your bidding.
Before you embark on making any changes, you have to utilize the PS1 environment variable that helps in controlling the display via a prompt.
For example, when you type in:
echo $PS1
The output will be something like this:
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
Let's focus on the initial part of the output:
\[\e]0;\u@\h: \w\a\]$
Let's break down the aforementioned string:
- \e is a special character denoting the start of a color sequence
- \u indicates the name of the user, followed by the '@' symbol
- \h showcases the system's hostname
- \w indicates base directory
- \a represents an active directory
- $ represents a non-root user
However, the output can differ for different users. Here, to change the bash prompt, you'll have to play with the commands, depending on what you want as the output.
Keep the following things in mind:
- Code for formatting the text: 0 for standard text, 1 for bold, 3 for italic, and 4 for underlined text.
- The color range for background pallets is 40-47.
- The color range for text colors is 30-37.
To change the color and font of the bash prompt, type the following:
PS1="\e[41;3;32m[\u@\h:\w\a\$]"
Do remember, this code will only register changes temporarily. If you want permanent changes, you need to add the above expression to the .bashrc file. To access the file, type:
nano ~/.bashrc
7. Change the Color Palette According to the Wallpaper
Pywal, a Python-based tool, helps you change the terminal background and font color, especially if you are not sure about the color scheme to use. This tool automatically changes the color of your terminal screen, based on the background wallpaper or an image. Pywal continues to be a nifty command-line tool, and anyone can install it with ease.
Arch/Manjaro users can find the python-pywal package in the official Arch repositories, which makes the whole installation process easier.
To use pywal on Ubuntu and other Debian-based distros, you'll need to install Python first:
sudo apt install python3-pip
Now, use the pip3 command to install pywal on your system:
sudo pip3 install pywal
To change the colors, type in the wal command with the location of your wallpaper file as the input:
wal -i path_to_wallpaper_file
Customizing the Terminal Window in Linux
Customizing the Linux graphical user interface is a simple choice. For this very reason, it is important to experiment with some interesting changes and implement them in the terminal, to add a personal touch to your screen's layout.
These changes are especially significant if you start using WSL or plan to access a remote server using SSH. If Linux customization is not something you are looking for, you can also use other terminals for a simpler experience.
Comments
Post a Comment