Installing Zsh and Powerlevel10k on Arch Linux

Mon 7th September 2020 By David T. Sadler.

I have been a bash user ever since I started using Linux. But after installing Arch Linux I wanted to give another shell a try and so decided on Zsh. Below is how I went about replacing bash with Zsh.

Installing Zsh

Zsh is installed via pacman.

$ sudo pacman -S zsh

Check that Zsh has been installed by running it from the terminal.

$ zsh

Since this is the first time that Zsh has been run you should now see zsh-newuser-install which will allow you to setup some basic configuration. If you wish to skip this just press the q key. You can always manually run this with the below commands at a later date.

$ autoload -Uz zsh-newuser-install
$ zsh-newuser-install -f

Changing The Default Shell

Installing Zsh does not automatically make it the system's default shell. The next time you log back in you will find that your current shell is still in use. You can check which shell is been used by looking at the SHELL environment variable.

$ echo $SHELL

/bin/bash

To see a list of shells that have been installed use the chsh command.

$ chsh -l

/bin/sh
/bin/bash
/usr/bin/git-shell
/bin/zsh
/usr/bin/zsh

The same command can be used to change the default shell by providing it with the full path to the shell.

$ chsh -s /bin/zsh

Note that this change is not instant and you will need to log out and log in again for it to take affect. Once you have done that check the SHELL environment variable again to confirm the change.

$ echo $SHELL

/bin/ksh

Installing Powerlevel10k

Powerlevel10k is a theme for Zsh and in order to make the most of it you should install the Meslo Nerd Font that has been patched for Powerlevel10k.

$ yay -Sy --noconfirm ttf-meslo-nerd-font-powerlevel10k

You need to configure your terminal to use this font. How this is done is dependant upon what terminal you are using. Since I use st from suckless I need to edit the file config.h and specify MesloLGS NF in the font settings.

static char *font = "MesloLGS NF:pixelsize=14:antialias=true:autohint=true";

Before rebuilding st.

$ sudo make install

Now that the dependences have been meet Powerlevel10k can be installed.

$ yay -Sy --noconfirm zsh-theme-powerlevel10k-git

Once it has been installed ensure that Zsh loads Powerlevel10k.

$ echo 'source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc

You can now open a new terminal which will start the Powerlevel10k configuration wizard. This will ask you a few questions and configure your prompt. If it doesn't trigger automatically, type p10k configure.

Once the configuration wizard has finished open a new terminal and you should see the Powerlevel10k theme been used.

Links

Installing Arch Linux on a Thinkpad X220.Zsh.Powerlevel10k.Simple Terminal.Arch - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage.