Raspberry Pi

Prettify Raspberry Pi Shell with Oh My Zsh

Raspberry Pi is a Linux-based system where most tasks are performed through the shell. Working with the same, basic terminal might get uninteresting or boring for some people. If you want to change the look of the shell for your Raspberry Pi terminal, you must install Oh My Zsh utility, which helps you prettify the Raspberry Pi shell.

Prettify Raspberry Pi Shell with Oh My Zsh

To make your terminal look pretty using the Oh My Zsh, follow the below-mentioned steps:

Step 1: Update and Upgrade the System

First, we will update the Raspberry Pi repository to check for the package updates. To update, use the below-mentioned command:

$ sudo apt update

Then upgrade the packages to the latest versions using the following command:

$ sudo apt upgrade

Step 2: Installing and Switching to Z shell

Now, you have to install the Z shell using the following command, as we will use this shell to replace it with the default Raspberry Pi terminal and customize it accordingly:

$ sudo apt install zsh

Once it’s installed, immediately switch the default terminal to Z shell from the following command:

$ chsh -s /bin/zsh

Enter the password to switch to Z shell.

Step 3: Installing Oh My Zsh

Next, you should install Oh My Zsh from the following command to prettify the terminal:

$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

When prompted for the permission to continue press “Y” key:

A message will display on the terminal to confirm that the shell has changed and Oh My Zsh is installed:

Step 4: Installing Fonts

You should also install the fonts powerline for the themes using the below-mentioned command:

~ sudo apt-get install fonts-powerline

There are two themes in zsh that come preinstalled; those are robbyrussell and agnoster. If the user wants to opt for robbyrussell there is no need to perform this step.

Step 5: Setting up the Required Theme

Now finally, the theme can be set up by accessing the .zhrc file using the nano editor from the following command:

~ nano ~/.zshrc

Within the file, search the keyword “ZSH_THEME” and change it to the desired theme. Here I have used the agnoster. The random variables for this theme are robbyrussell and agnoster and users can opt according to their choice.

Then press Ctrl+X, then Y to save the required theme setting, and finally press Enter to get back to the terminal.

Step 6: Reboot

Reboot the system to give it a fresh start with a new theme:

~ reboot

After the reboot, the terminal will look like this as shown in the below image:

And that’s all your terminal has been prettified by using Oh My Zsh.

Conclusion

To prettify the Raspberry Pi terminal with Oh My Zsh, first, you must install zsh on Raspberry Pi. Then switch to Z shell and modify the “.zsh file” to change the zsh theme to the required theme which includes the agnoster and robbyrussell. After the configuration, the device must be rebooted to apply changes to the shell theme using Oh My Zsh.

About the author

Zahra Zamir

An Electronics graduate who loves to learn and share the knowledge, my passion for my field has helped me grasp complex electronics concepts and now I am here to share them with others.