Install and Use Powerlevel10k in Zsh

The Powerlevel10k is one of the most popular zsh themes as unlike many options, it does not restrict you to stick to the developer's offering but lets you choose elements manually and put it all together.

Once you install powerlevel10k in zsh, your terminal will look like this:

How to install Powerlevel10k in Zsh

To install Powerlevel10k, you need to have Git and awesome fonts installed, and if you haven't, then here's how you can install Git on Ubuntu including awesome fonts:

sudo apt install git fonts-font-awesome

Once done, this section is divided into two parts:

  • Installing Powerlevel10k for Oh My Zsh users
  • Installing Powerlevel10k manually
For Oh My Zsh users:

If you already have installed Oh My Zsh, then use the following command to clone the Powerlevel10k git repo to the respective directory:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Next, open the zshrc config file:

nano ~/.zshrc

There will be a theme named robbyrussell and the line would look like this:

ZSH_THEME="robbyrussell"

In this case, you have to change robbyrussell with powerlevel10k/powerlevel10k as shown here:

Once done, save the changes and exit the nano editor.

Source the file to take effect from the changes you've made.

For those who don't use Oh My Zsh

If you don't like the idea of using Oh My Zsh, then you'd have to execute two commands and they'll take care of the download and configuration part.

Here's a command to download the Powerlevel10k theme:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k

Once done, execute the following command to add the Powerlevel10k to the configuration file:

echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc

Finally, source the file using the following:

source ~/.zshrc

Some users may not see a prompt to configure the Powerlevel10k which is bland and not intuitive:

In that case, you'd need to start the theme configurator manually using the following:

p10k configure

Once you execute the above command, it will start the Powerlevel10k prompt.

How to configure Powerlevel10k

You could have installed the Powerlevel10k any of the shown way but the configurator for this theme remains the same where you have to answer simple questions.

The first question is if the shown icon looks like a diamond or not:

In my case, it does not look anything close to a diamond so I'll press n key.

Secondly, it will ask if the shown icon looks like a lock or not:

To me, it does not look like a lock so I'll press the n key again.

As I pressed n previously, it will again ask me the same question showing a different symbol to identify if that looks like a diamond to me or not:

Again, it does not look like a lock so I'll press the n key again.

Next, it will ask me for another symbol but this time I'll have to answer if that looks similar but taller and fatter:

This time, it does so I will press the y key.

From here on it will ask you questions regarding how you want to style your prompt and you can choose what your heart desires the most:

Now, choose the styling options for yourself and make your terminal look how you always wanted to!

Messed while configuring?

If you choose the wrong option while configuring the theme and want to start again then you can start the Powerlevel10k configurator using the following command:

p10k configure

We are on the journey of giving you the easiest solutions for the zsh so if you have a doubt in mind or a suggestion then please leave a comment.