How to Install Powerlevel10k with Oh My Zsh on Linux

If you’re a Linux enthusiast like me, you know that the terminal is where the magic happens. But why settle for a plain, boring command line when you can jazz it up with a sleek, modern theme? Enter Powerlevel10k (p10k), a fast and highly customizable theme for your Zsh shell. Paired with Oh My Zsh, it makes your terminal not just functional, but also beautiful.

In this blog post, I’ll guide you step-by-step on how to install Powerlevel10k with Oh My Zsh on your Linux machine. Let’s get started!

What is Zsh and Oh My Zsh?

Before we dive in, let’s cover the basics:

  • Zsh: Zsh (Z Shell) is a powerful shell that offers more features than the standard Bash shell, such as improved tab completion, spelling correction, and better scripting capabilities.
  • Oh My Zsh: Oh My Zsh is an open-source framework for managing your Zsh configuration. It comes with hundreds of plugins and themes that can make your Zsh experience much more enjoyable.

What is Powerlevel10k?

Powerlevel10k is a theme for Zsh that gives your terminal a modern, sleek look with a lot of customization options. It shows useful information like Git status, battery level, and more, all in a stylish prompt. Plus, it’s super fast!

Step-by-Step Guide to Installing Powerlevel10k with Oh My Zsh

Step 1: Install Zsh

First, check if you already have Zsh installed. Open your terminal and type:

zsh --version

If you see a version number, you’re good to go! If not, you’ll need to install it. Here’s how:

  • On Ubuntu/Debian:
  sudo apt update
  sudo apt install zsh
  • On Fedora:
  sudo dnf install zsh
  • On Arch Linux:
  sudo pacman -S zsh

Step 2: Make Zsh Your Default Shell

Once Zsh is installed, make it your default shell:

chsh -s $(which zsh)

You’ll need to log out and log back in for the change to take effect.

Step 3: Install Oh My Zsh

Now that you have Zsh set up, it’s time to install Oh My Zsh. Run the following command:

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

This script will install Oh My Zsh and set up your Zsh configuration.

Step 4: Install Powerlevel10k

With Oh My Zsh installed, you can now install the Powerlevel10k theme. Run these commands:

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

Then, set Powerlevel10k as your theme by editing your .zshrc file:

vim ~/.zshrc

Find the line that starts with ZSH_THEME= and change it to:

ZSH_THEME="powerlevel10k/powerlevel10k"

Save and exit the file (press CTRL + X, then Y, and ENTER).

Step 5: Configure Powerlevel10k

Now, apply the changes:

source ~/.zshrc

The first time you load Powerlevel10k, it will automatically start a configuration wizard that helps you customize your prompt. Just follow the prompts to configure it to your liking.

Step 6: Install Recommended Fonts

To make the most of Powerlevel10k, you’ll need a font that supports all the icons and symbols it uses. The recommended font is MesloLGS NF.

You can download and install it manually, or you can let Powerlevel10k do it for you during the setup wizard. If you missed that step, you can download the font from Nerd Fonts and install it:

  1. Download the font files (MesloLGS NF Regular, Bold, Italic, Bold Italic).
  2. Open the font files and click “Install” for each one.
  3. Set your terminal to use the MesloLGS NF font.

Step 7: Enjoy Your New Terminal

Install Powerlevel10k

Congratulations! You’ve successfully installed Powerlevel10k with Oh My Zsh on Linux. Your terminal should now look awesome, with a highly informative and customizable prompt.

Troubleshooting

  • Fonts Not Displaying Correctly: If the icons in your prompt look weird, make sure you have installed and selected the correct font in your terminal settings.
  • Changes Not Taking Effect: If your terminal doesn’t seem to apply the changes, try restarting it or running source ~/.zshrc again.

Conclusion

Setting up Powerlevel10k with Oh My Zsh on Linux is a simple way to transform your terminal into a powerful, visually appealing tool. With this guide, you’ve got all the steps you need to get started. Enjoy your new terminal experience, and don’t hesitate to explore further customizations to make it truly your own!

Happy coding! 🎉

You Might Also Like

Leave a Reply