In this guide, we explain how to install, use and configure several themes in Zsh.
I bet, all true Linux fans love Terminal. A Terminal is a way of executing commands from a user for Linux Kernel. And a way for Linux Kernel to interact with user as well. Hence, it is always much faster way of doing several activities via terminal.
If you are a system administrator managing multiple Linux desktop systems in a local network, or, organization network, then definitely you spent your most of your time in terminal. If you use a desktop environment for those work, then you might want to change the look of your terminal for a change. Getting away from the mundane default terminals of Ubuntu and other Linux systems.
By default, almost of all Linux distributions uses Bash shell. The bash shell is a solid program and an old one too. But it lacks certain customization options. For example, if you want some nice colors, execution time for commands, etc. – it is difficult to customize.
So, for those customizations, you can use the Zsh shell, which is in a way an extended Bash Shell with additional improvements.
And in this guide, we explain how to install, use and configure several themes in Zsh. This applies to all Linux distributions.
Installing Zsh is easy. Following command does the trick.
Ubuntu, Debian, Linux Mint and all related distro
sudo apt install zsh
sudo dnf install zsh
pacman -S zsh
Configure and use zsh
After installation, you need to configure the Zsh and replace your bash shell. To do that, open the terminal and run the below command. Change the username as per your system (root in below example).
- First, find out the executable path of Zsh.
- Then change the Shell using
chsh -s /usr/bin/zsh root
- Then logoff and login again and open the terminal. You should see a first time setup screen. Choose 0. This should create an empty .zshrc file.
And now it’s time to colorize Zsh.
Install and Configure Oh My Zsh
Oh My Zsh is a collection of script and themes which gives the actual look and feel of your terminal. It is present in GitHub which you need to download and install. Follow the steps below.
- If Git is not installed, install it via
sudo apt install gitOr,
sudo dnf install git.
- Then run the following command.
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
Or, you can use any of the below method for install.
- Above command will install the Oh My Zsh and create a configuration folder in your home named .zshrc.
- Copy the templates.
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
- Compile the Zsh again.
- And, you should see a nice looking terminal prompt.
See the above screen prompt. That is the default prompt. Now, Oh My Zsh preloaded with many themes. They are located in
~/.oh-my-zsh/themes. See below.
How they look, you can find it here. Its good idea to browse through first, before making a change.
Now, to change a theme, note down the name from above and update it in ~/.zshrc file via any text editor. For this tutorial, I will change to
In the file, change the name of ZSH_THEME property with the theme name. Save and close the file.
Compile the .zshrc file again.
Close and open the terminal again. And you should be seeing the new theme in action.
I hope this guide helps you to transform your otherwise mundane Terminal. You can play around with various themes and settle with what you like. You can also learn more configuration options in detail in the official GitHub page or in Arch Wiki.
Let me know whether you are able to change your terminal. Also share your terminal screenshot in the comment box below. Cheers.