summaryrefslogtreecommitdiff
path: root/www/posts/arch/2020-09-07/installing-zsh-and-powerlevel10k-on-arch-linux/index.html
blob: 2f4af110d2e19a7f6f89807cd3e745c83c9c23ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Installing Zsh and Powerlevel10k on Arch Linux</title>
        <link rel="shortcut icon" href="/images/favicon.png">
        <link rel="stylesheet" href="/css/site.css">
        <link href="/posts/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts"/>
        <link href="/posts/arch/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Arch"/>
        <link href="/posts/gemini/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Gemini"/>
        <link href="/posts/jigsaw/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Jigsaw"/>
        <link href="/posts/laravel/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Laravel"/>
        <link href="/posts/linux/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Linux"/>
        <link href="/posts/markdown/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Markdown"/>
        <link href="/posts/netlify/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Netlify"/>
        <link href="/posts/nextcloud/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Nextcloud"/>
        <link href="/posts/php/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About PHP"/>
    </head>
    <body>
        <section><h1>Installing Zsh and Powerlevel10k on Arch Linux</h1><blockquote>Mon 7th September 2020 By David T. Sadler.</blockquote><p>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.</p><h2>Installing Zsh</h2><p>Zsh is installed via pacman.</p><pre><code class="shell">$ sudo pacman -S zsh</code></pre><p>Check that Zsh has been installed by running it from the terminal.</p><pre><code class="shell">$ zsh</code></pre><p>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.</p><pre><code class="shell">$ autoload -Uz zsh-newuser-install
$ zsh-newuser-install -f</code></pre><h2>Changing The Default Shell</h2><p>Installing Zsh does not automatically make it the system&#039;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.</p><pre><code class="shell">$ echo $SHELL

/bin/bash</code></pre><p>To see a list of shells that have been installed use the chsh command.</p><pre><code class="shell">$ chsh -l

/bin/sh
/bin/bash
/usr/bin/git-shell
/bin/zsh
/usr/bin/zsh</code></pre><p>The same command can be used to change the default shell by providing it with the full path to the shell.</p><pre><code class="shell">$ chsh -s /bin/zsh</code></pre><p>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.</p><pre><code class="shell">$ echo $SHELL

/bin/ksh</code></pre><h2>Installing Powerlevel10k</h2><p>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.</p><pre><code class="shell">$ yay -Sy --noconfirm ttf-meslo-nerd-font-powerlevel10k</code></pre><p>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.</p><pre><code class="shell">static char *font = &quot;MesloLGS NF:pixelsize=14:antialias=true:autohint=true&quot;;</code></pre><p>Before rebuilding st.</p><pre><code class="shell">$ sudo make install</code></pre><p>Now that the dependences have been meet Powerlevel10k can be installed.</p><pre><code class="shell">$ yay -Sy --noconfirm zsh-theme-powerlevel10k-git</code></pre><p>Once it has been installed ensure that Zsh loads Powerlevel10k.</p><pre><code class="shell">$ echo &#039;source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme&#039; &gt;&gt;! ~/.zshrc</code></pre><p>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&#039;t trigger automatically, type p10k configure.</p><p>Once the configuration wizard has finished open a new terminal and you should see the Powerlevel10k theme been used.</p><h3>Links</h3><a href="/posts/arch/2020-05-25/installing-arch-linux-on-a-x220-thinkpad/">Installing Arch Linux on a Thinkpad X220.</a><a href="https://www.zsh.org/">Zsh.</a><a href="https://github.com/romkatv/powerlevel10k/">Powerlevel10k.</a><a href="https://st.suckless.org/">Simple Terminal.</a><a href="/posts/arch/">Arch - Read More Posts.</a><p>I don&#039;t have comments as I don&#039;t want to manage them. You can however contact me at the below address if you want to.</p><a href="mailto:david@davidtsadler.com">Email david@davidtsadler.com</a><h3>License</h3><a href="https://creativecommons.org/licenses/by-sa/4.0/">The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</a><p>Copyright © 2021 David T. Sadler.</p><a href="/">Return to Homepage.</a></section>
        <script defer src="/js/highlight.min.js"></script>
        <script defer src="/js/site.js"></script>
    </body>
</html>