Installation and Usage of Powerlevel10k in Zsh ⋆ ALexHost SRL

Test your skills on our all Hosting services and get 15% off!

Use code at checkout:

Skills
08.10.2024

Installation and Usage of Powerlevel10k in Zsh

The terminal is a powerful tool, and customizing it can greatly enhance your productivity. One of the most popular ways to do this is by using Zsh (Z Shell) combined with the Powerlevel10k theme. Powerlevel10k offers a beautiful and highly customizable prompt that can display useful information, such as git status, Python hosting environment, and much more.

In this guide, we will walk you through the process of installing Zsh, setting up Powerlevel10k, and customizing it to create a beautiful and efficient terminal experience.

What is Powerlevel10k?

Powerlevel10k is a theme for the Zsh shell that focuses on speed, flexibility, and a visually appealing prompt. It provides features like:

  • Customizable prompts with various styles.
  • Support for displaying git status, user information, time, and more.
  • A fast and responsive user interface.
  • Easy configuration wizard for new users.

Installation and Usage of Powerlevel10k in Zsh

The terminal is a powerful tool, and customizing it can greatly enhance your productivity. One of the most popular ways to do this is by using Zsh (Z Shell) combined with the Powerlevel10k theme. Powerlevel10k offers a beautiful and highly customizable prompt that can display useful information, such as git status, Python environment, and much more.

In this guide, we will walk you through the process of installing Zsh, setting up Powerlevel10k, and customizing it to create a beautiful and efficient terminal experience.

What is Powerlevel10k?

Powerlevel10k is a theme for the Zsh shell that focuses on speed, flexibility, and a visually appealing prompt. It provides features like:

  • Customizable prompts with various styles.
  • Support for displaying git status, user information, time, and more.
  • A fast and responsive user interface.
  • Easy configuration wizard for new users.

Step 1: Installing Zsh

Before we install Powerlevel10k, we need to ensure that Zsh is installed on your system. Most modern Linux distributions come with Zsh available in their repositories. If Zsh is not already installed, you can install it using the following commands:

For Ubuntu/Debian:

sudo apt update
sudo apt install zsh -y

For Fedora:

sudo dnf install zsh -y

For Arch Linux:

sudo pacman -S zsh

After installation, you can check the Zsh version with:

zsh --version

Make Zsh the default shell by running:

chsh -s $(which zsh)

Log out and log back in for the changes to take effect.

Step 2: Installing Oh My Zsh

To simplify the management of Zsh plugins and themes, it’s recommended to use Oh My Zsh, a framework that makes it easy to work with Zsh. Install it with the following command:

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

After the installation, your default shell will be switched to Zsh, and you’ll have access to a variety of plugins and themes.

Step 3: Installing Powerlevel10k

With Zsh and Oh My Zsh installed, you can now install Powerlevel10k. Clone the Powerlevel10k repository into the custom themes directory of Oh My Zsh:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k

Next, set Powerlevel10k as your active theme by editing the .zshrc file:

nano ~/.zshrc

Find the line that sets the theme (it will look like ZSH_THEME=”robbyrussell”) and replace it with:

ZSH_THEME="powerlevel10k/powerlevel10k"

Save the file and exit the editor. Apply the changes by restarting your terminal or running:

source ~/.zshrc

Step 4: Configuring Powerlevel10k

The first time you restart your terminal with Powerlevel10k enabled, a configuration wizard will start. This wizard allows you to customize your prompt appearance based on your preferences.

You can choose from several styles:

  • Classic: A clean, minimalistic prompt.
  • Rainbow: A colorful prompt with various segments.
  • Lean: A simple and compact prompt.
  • Pure: A prompt similar to the Pure theme, with a focus on minimalism.

The wizard will also ask if you want to display information like time, user, and status icons. As you make each choice, you will see a live preview, allowing you to fine-tune your setup.

To re-run the configuration wizard at any time, simply execute:

p10k configure

Step 5: Installing Fonts for Powerlevel10k

Powerlevel10k uses special fonts to display icons and symbols correctly. To ensure everything looks as intended, you need to install a Nerd Font.

Download a Nerd Font of your choice from the Nerd Fonts repository or directly download the MesloLGS NF font, which is recommended by Powerlevel10k:

  1. Download MesloLGS NF fonts from this link.
  2. Install the fonts by double-clicking each .ttf file and selecting “Install.”

After installing the fonts, change your terminal emulator’s font to MesloLGS NF to ensure proper display of Powerlevel10k symbols.

Test your skills on our all Hosting services and get 15% off!

Use code at checkout:

Skills