Install zsh arch linux

Installing Zsh and Powerlevel10k on Arch Linux

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.

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

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.

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.

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.

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";

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.

Читайте также:  Linux java default keystore

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

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.

License

Copyright © 2021 David T. Sadler.

Источник

zsh on Arch Linux

Here is a brief guide to show you how to install zsh package:

2. Uninstall / Remove zsh package

Here is a brief guide to show you how to uninstall zsh package:

3. Details of zsh package

Repository : extra
Name : zsh
Version : 5.9-1
Description : A very advanced and programmable command interpreter (shell)
for UNIX
Architecture : x86_64
URL : https://www.zsh.org/
Licenses : custom
Groups : None
Provides : None
Depends On : pcre libcap gdbm
Optional Deps : None
Conflicts With : None
Replaces : None
Download Size : 2.22 MiB
Installed Size : 6.60 MiB
Packager : Pierre Schmitz

Build Date : Sun May 15 05:54:20 2022
Validated By : MD5 Sum SHA-256 Sum Signature

4. References on Arch Linux

5. The same packages on other Linux Distributions

zsh (5.4.2-3ubuntu3.2) Ubuntu 18.04 LTS (Bionic Beaver)

zsh (5.1.1-1ubuntu2.3) Ubuntu 16.04 LTS (Xenial Xerus)

zsh (5.8-5) Ubuntu 20.10 (Groovy Gorilla)

zsh (5.8-6build1) Ubuntu 21.10 (Impish Indri)

zsh (5.6-5.17) openSUSE Leap

zsh (5.8-7.7) openSuSE Tumbleweed

zsh (5.8.1-1) Ubuntu 22.04 LTS (Jammy Jellyfish)

zsh (5.7.1-1+deb10u1) Debian 10 (Buster)

Источник

Configuring Zsh

Configuring Zsh

This is a quick and easy guide for installing zsh, setting up a basic configuration, and enabling it as your default shell. I’ve used bash with bash-completion for as long as I can remember, and recently switched over to zsh for day-to-day usage. Lots of plugins, options, and customization. These instructions should work on just about anything running zsh.

Читайте также:  Bluetooth адаптер kali linux

Setup

Installing Zsh

The first step is simple: install zsh if you don’t have it. Zsh is the default shell on macOS Catalina. You’ll also need git installed.

# Ubuntu sudo apt-get update sudo apt-get install git sudo apt-get install zsh # Arch Linux sudo pacman -S git zsh # macOS Catalina # Just open Terminal, you already have zsh :).

Easy enough. We’ll now get a few items configured before we set it as our default shell. Depending on your terminal emulator, I’d highly recommend the MesloLGS NF font. It looks great and displays all the bells and whistles as expected.

Installing Oh-My-Zsh

Oh-My-Zsh is a must-have for zsh. It adds a ton of functionality and plugins. The installation is dead-simple too. Keep in mind we’re still in bash since we’ve installed zsh but haven’t switched shells yet.

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

It’ll ask you if you’d like to switch shells, which you can say Y to at this point. You’ll see output similar to this:

nlabadie@nathanlabadie:~$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" Cloning Oh My Zsh. Cloning into '/home/nlabadie/.oh-my-zsh'. remote: Enumerating objects: 1158, done. remote: Counting objects: 100% (1158/1158), done. remote: Compressing objects: 100% (1127/1127), done. remote: Total 1158 (delta 20), reused 1059 (delta 15), pack-reused 0 Receiving objects: 100% (1158/1158), 778.12 KiB | 15.56 MiB/s, done. Resolving deltas: 100% (20/20), done. Looking for an existing zsh config. Using the Oh My Zsh template file and adding it to ~/.zshrc. Time to change your default shell to zsh: Do you want to change your default shell to zsh? [Y/n] Y Changing the shell. Password: Shell successfully changed to '/usr/bin/zsh'. __ __ ____ / /_ ____ ___ __ __ ____ _____/ /_ / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ / /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / \____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ /____/ . is now installed! Before you scream Oh My Zsh! please look over the ~/.zshrc file to select plugins, themes, and options. • Follow us on Twitter: https://twitter.com/ohmyzsh • Join our Discord server: https://discord.gg/ohmyzsh • Get stickers, shirts, coffee mugs and other swag: https://shop.planetargon.com/collections/oh-my-zsh ➜ ~

Congrats, you’re now running zsh. Next we’ll install a few more plugins that add auto-completion and syntax highlighting features.

git clone https://github.com/zsh-users/zsh-autosuggestions $/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $/plugins/zsh-syntax-highlighting
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf ~/.fzf/install # Answer yes to everything followed by this command: source .zshrc

Installing Powerlevel10K

First you’ll want to install the MesloLGS NF font. This is particular to Arch Linux:

paru -S ttf-meslo-nerd-font-powerlevel10k

Next we’re going to install the Powerlevel10K theme. The install is simple:

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

We’re not going to enable it just yet though. First, we’ll back up the .zshrc file and then add a few lines to it.

cd ~ cp .zshrc .zshrc-`date "+%Y%m%d"` vi .zshrc # Comment out the following line and add this. #ZSH_THEME="robbyrussell" ZSH_THEME="powerlevel10k/powerlevel10k" # Also comment out this line and add the following. #plugins=(git) plugins=( ansible docker docker-compose git python sudo tmux zsh-autosuggestions zsh-syntax-highlighting )

Configuring Powerlevel10k

At this point we need to source the .zshrc file. It’ll also kick us into the Powerlevel10k setup screen. Remember that font I’d mentioned before? Powerlevel10K uses it, e.g. showing a lock when you’re in a directory where you don’t have write permissions.

Читайте также:  Linux intel atom n2800

It’ll ask you a bunch of questions. You’re free to choose whatever you’d like during setup, but I’m a fan of simplicity. Pay attention to the font questions at the beginning. However, it shouldn’t be an issue if you’re using the MesloLGS NF font since it’ll display the icons correctly.

Here’s the quick answers that I use:

y, y, y, y, 1, 1, 1, 1, 1, 1, 1, 1, y, 1, y

Conclusion

At this point you should have a fancy-yet-simple terminal using zsh:

List of Chrome Extensions

I’ve recently been switching between Chrome, Edge, and Firefox just because it’s…

Running NiFi in a Docker Container

I’ve written a few articles on Apache NiFi and how to install it on Ubuntu. I recently ran into a situation where it wasn’t possible to install NiFi directly, but it could be run via a docker container. Fortunately there are Apache NiFi docker images to accomplish this.…

Источник

Оцените статью
Adblock
detector