Reading time : 3 min
As for any Linux user, the command line is an essential tool for me. And as for or all my tools, I always feel the need to put some customization for visual comfort purposes.
One way I customize the terminal is by switching from the bash shell to zsh.
Zsh, also called Z shell, is an alternative to bash that offers a large variety of themes and plugins that enhance the usage of the command line.
It is usualy installed with a plugin framework called Oh My Zsh which is a community-based, online platform that features major plug-ins and themes for zsh.
I will share with you here how to install both ZSH and Oh My ZSH and how to configure them.
We can install ZSH using the following command:
sudo apt install zsh
After the installation, we need to make zsh our default shell.
chsh -s /usr/bin/zsh root
Now we have to reboot our computer.
After the reboot, open the terminal again.Let's install the Oh my zsh framework.
Install Oh My ZSH
The installation of Oh my zsh can be done with curl or wget. We will use wget.
First make sure you are on your home folder; use the following command for thatcd ~Now use the next command to install oh-my-zsh:
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O – | zshUse next command after installation and see the magic happening 😀
Copy the Oh-my-zsh template file and rename it .zshrc to replace the current one.
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
Oh-my-zsh comes with hundreds of themes. To use one of those themes we need to edit the .zshrc file.
First we can view the list of themes by checking the folder ~/.oh-my-zsh/themes/
Lets try the agnoster theme.
To change the theme, open the .zshrc file and change the value of the parameter ZSH_THEME.
Press the i key. Scrooll down the line 18 and change the value of ZSH_THEME from 'robbyrussell' to 'agnoster'.
Now press the Esc key then the : key then x key and press Enter.
Use following command to apply last modifications.
Next to the Oh my zsh themes, we can find online, other zsh themes. One I love to use on all my devices is Powerlevel10k theme. Let me take you through how to install it.
Install Powerlevel10kPowerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience.(I literally copy-past the description from there GitHub… I can't do better). It can be installed manually or with Oh-my-zsh. Since we have Oh-my-zsh installed, let's use it. But first, you need to install the recommended font police. Click on the link below to download the font MesloLGS NF Regular.ttf After download, double click on the file and click on install to install the font on your system. Now, right-click on your terminal, select Preferences and check Custom font under Text Appearance and select MesloLGS NF Regular. Now that you have the recommended font, you can clone the Powerlevel10k repository:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10kYou can then set it as the zsh theme in the .zshrc file, as we did earlier. vim .zshrcEdit the value of ZSH_THEME ZSH_THEME="powerlevel10k/powerlevel10k" Now press the Esc key then the: key then x key and press Enter. Enter the command source .zshrc That should start the Powerlevel10k configuration automatically. This configuration will help you set up the appearance of nearly every single part of your terminal. If the configuration is not launched you can launch with the following command: p10k configure Go through the configuration, and at the end, you should have a new brand terminal that makes you look like those badass hackers 🙂 If after configuration you are not happy with the result, you can still reload the configuration with the same command and go through the settings again.