For Ubuntu 22.04/24.04 users, the terminal is an indispensable tool for performing critical tasks. However, the default terminal interface can look a bit dull. In this article, we will explore how to customize the terminal appearance, including changing fonts, colors, and other features to make your terminal more appealing and personalized.
Method 1: Using Powerline to Customize terminal
Powerline is a text-based tool that provides useful information in a variety of contexts and enhances the appearance of your terminal, serving as a status line plugin for vim and providing status lines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome, i3, Qtile, and customize terminal Ubuntu/Linux.
Step 1. Install Powerline
The following demo shows Powerline displaying information about a Git repository, After customization, your terminal should look like this:
~ ▶ mkdir myrepo itsmeit ▶ ~ ▶ cd myrepo itsmeit ▶ ~ 〉 myrepo ▶ git init Initialized empty Git repository in /home/itsmeit/myrepo/.git/ itsmeit ▶ ⎇ master ▶ ~ 〉 myrepo ▶ touch myfile itsmeit ▶ ⎇ master ▶ ~ 〉 myrepo ▶ git add myfile itsmeit ▶ ⎇ master ▶ ~ 〉 myrepo ▶
To customize terminal ubuntu 22.04, 24.04, let’s get started to add the repository and install Powerline for Ubuntu Universe repository with the following command:
sudo add-apt-repository universe sudo apt install powerline -y
Next, To config Powerline for bash shell, add the following lines at the bottom of your “$HOME/.bashrc” file:
sudo nano ~/.bashrc
# Powerline configuration if [ -f /usr/share/powerline/bindings/bash/powerline.sh ]; then powerline-daemon -q POWERLINE_BASH_CONTINUATION=1 POWERLINE_BASH_SELECT=1 source /usr/share/powerline/bindings/bash/powerline.sh fi
Save the file and run the command below to apply the changes to the saved config:
source ~/.bashrc
Step 2. Configure Powerline font
To continue, you need to create a directory named “.font” located in /home/$USER. The “.font” folder will contain a custom font with Powerline for your terminal. The command below will create a .font directory inside /home/$USER.
mkdir -p ~/.fonts
Next, download the font for Powerline with wget to customize terminal Ubuntu 22.04, 24.04, or Linux
wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline.ttf -O ~/.fonts/Liberation\ Mono\ Powerline.ttf wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Bold.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Bold.ttf wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Italic.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Italic.ttf wget https://github.com/powerline/fonts/raw/master/LiberationMono/Literation%20Mono%20Powerline%20Bold%20Italic.ttf -O ~/.fonts/Liberation\ Mono\ Powerline\ Bold\ Italic.ttf
Finally, apply newly installed fonts, and Close reOpen terminal, you will see the difference.
fc-cache -vf ~/.fonts
Method 2: Customize terminal Ubuntu with Oh My Zsh
Oh My Zsh is an open source for ZSH config management and is community driven. It comes with a lot of useful function, plugins, helper, themes, and a few things that will help you to use the terminal better. There are more than 275 plugins and 150 themes supported now. And here is the 2nd way to customize terminal Ubuntu 22.04/24.04 Linux.
Step 1. Install Oh My Zsh
Install either curl, wget, or git if your device does not have it. Then, copy and run the commands in sequence on the terminal.
sudo apt install curl sudo apt install zsh sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
After the installation Oh My Zsh is done, it will automatically select the default display ZSH. You can use the following command to check the current defaults:
echo $SHELL
In case ZSH is not already defaulting, run the following command to set it as default:
chsh -s $(which zsh)
Or
usermod -s $(which zsh) [username]
After you install Oh My Zsh to customize your Ubuntu terminal, it will make a backup copy of your existing .zshrc file. Then a new .zshrc file will be created with the configuration. So whenever you decide to remove Oh My Zsh with the uninstaller, the old .zshrc file will automatically be restored.
Out of all the features in OH-MY-ZSH, I like the set of theme that come with the installation. It visually improves my terminal interface. Theme are install in /home/username/.oh-my-zsh/themes/
.
ls /home/itsmeit/.oh-my-zsh/themes/
Note: Change the itsmeit to the username you are using, On the terminal, type whoami
to get the username.
Step 2. Config Oh My Zsh theme
The default theme when installing Oh My Zsh is “robbyrussell”. To change the theme, modify the ZSH_THEME="theme-name"
parameter in the .zshrc
file. You can also set ZSH_THEME="random"
to load random custom themes for your Terminal.
Run the command below to edit the file ~/.zshrc
sudo nano ~/.zshrc
And you need to run the command source ~/.zshrc for the change to take effect.
source ~/.zshrc
Step 3. Install OH-MY-ZSH Plugins
Oh My Zsh comes bundled with plugins, which allow you to take advantage of the functionality of many sorts in your shell just by enabling them. They are each documented in the README file in their respective plugins/
folder.
There are many plugins that support beauty, customize terminal ubuntu 22.04, 24.04 powered by Oh My Zsh. Setting up and configuring the plugin is also quite easy. All you have to do is run the commands below and add its name in the plugin parameter of the .zshrc file.
2 plugins that support character suggestions, keywords, highlights, and syntax… are below so you can install them and configure them for the terminal. Come on, download it now
- Autosuggesions plugin
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
- Zsh-autocomplete plugin
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git $ZSH_CUSTOM/plugins/zsh-autocomplete
And after downloading the above plugins, edit the .zhsrc
file, add the plugin name (plugins=(git))
and replace it:
sudo nano ~/.zshrc
Run the command source ~/.zshrc
for the change to take effect
source ~/.zshrc
The aforementioned two methods offer a means to customize the Linux / Ubuntu terminal using Powerline and Oh My Zsh. There are numerous exciting features to explore. Should you have any questions, please feel free to leave a comment.