From af2a79910b91efa9a9ce869c73baa37e14d53918 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Fri, 28 Aug 2020 15:43:27 +0100 Subject: Add Installing Zsh and Powerlevel10k on Arch Linux --- ...talling_zsh_and_powerlevel_10k_on_arch_linux.md | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 source/_posts/installing_zsh_and_powerlevel_10k_on_arch_linux.md (limited to 'source') diff --git a/source/_posts/installing_zsh_and_powerlevel_10k_on_arch_linux.md b/source/_posts/installing_zsh_and_powerlevel_10k_on_arch_linux.md new file mode 100644 index 0000000..3197d35 --- /dev/null +++ b/source/_posts/installing_zsh_and_powerlevel_10k_on_arch_linux.md @@ -0,0 +1,103 @@ +--- +extends: layouts.post +section: content +title: Installing Zsh and Powerlevel10k on Arch Linux +date: 2020-09-07 +description: A guide for replacing your current shell with Zsh and Powerlevel10k. +tags: [Arch] +--- + +I have been a *bash* user ever since I started using Linux. But after [installing Arch Linux](/posts/installing-arch-linux-on-a-x220-thinkpad/) I wanted to give another shell a try and so decided on [Zsh](https://www.zsh.org/). Below is how I went about replacing *bash* with *Zsh*. + +## Installing Zsh + +*Zsh* is installed via *pacman*. + +```shell +$ sudo pacman -S zsh +``` + +Check that *Zsh* has been installed by running it from the terminal. + +```shell +$ 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. + +```shell +$ 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. + +```shell +$ echo $SHELL + +/bin/bash +``` + +To see a list of shells that have been installed use the *chsh* command. + +```shell +$ 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. + +```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. + +```shell +$ echo $SHELL + +/bin/ksh +``` + +## Installing Powerlevel10k + +[Powerlevel10k](https://github.com/romkatv/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. + +```shell +$ 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](https://st.suckless.org/) from suckless I need to edit the file *config.h* and specify *MesloLGS NF* in the font settings. + +```shell +static char *font = "MesloLGS NF:pixelsize=14:antialias=true:autohint=true"; +``` + +Before rebuilding *st*. + +```shell +$ sudo make install +``` + +Now that the dependences have been meet Powerlevel10k can be installed. + +```shell +$ yay -Sy --noconfirm zsh-theme-powerlevel10k-git +``` + +Once it has been installed ensure that Zsh loads Powerlevel10k. + +```shell +$ 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. -- cgit v1.2.3-13-gbd6f