Blog de programación, errores, soluciones

Chose Language:
comments
Author: Admin/Publisher |finished | checked

Adding style to Linux Console

Although it not seems helpful to personalize Linux console, it helps a lot when you are working in a VPS(Virtual Private Server) server over putty or other type of connection.

ubuntu predefined bash console

Generally ubuntu comes with a personalized console that is bash(shell), but not all time happens this. Working with a console only white and black could be a mess and get loss of what whe are doing.

Lets use another shell in this case Z shell that’s is really customizable with oh-my-zsh framework, this framework permit use a bast quantity of themes.

In some cases this themes gives us a really helpful information like what hour is it or if we are inside a folder that is using GIT, if the comand could run correctly etc.

So ¿How can I customize my console?

First we have to install zsh in our linux. You can do this with the following comand.

apt install zsh

You can check for more installation methods in the oh-my-zsh github but this is the simplest one.

Before start using Z shell lets check if it was installed with zsh –version

Now lets do z shell our default.

chsh -s $(which zsh)

Well done, now we have zsh installed. You could check it before continue with this commands

echo $SHELL

Must give us something like this /bin/zsh.

$SHELL --version

Must give something like Zsh X.X.X , the x refer to numbers of version you are using.

Install oh-my-zsh

Oh-myzsh could be installed with curl or wget. Before start installing oh my zsh check if you have installed curl cause its really helpful.

Checking the curl version:

curl -V

Just in case you have not installed curl:

sudo apt-get install curl

To install via curl:

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

With wget:

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

In case these commands don’t work check oh my zsh page

https://github.com/ohmyzsh/ohmyzsh

Let’s configure zsh

You can configure zsh modifing .zshrc file that is in your ~/ path, in my case I will use vim as my editor, use your preferred one.

cd --
vim .zshrc

By Default Oh-my-zsh comes with some themes but you have to allow one to be used, you may set one of these with ZSH_THEME command.

Lets do that open your .zshrc and set up bira as your theme and save it.

ZSH_THEME=”bira”

In case you not see any changes in your console try reloading the source with:

source .zshrc

Finally, we can install external themes.

An Example could be https://gist.github.com/philFernandez/56f8953722285834cc9000ffcfe103f4

Here you can see that themes folder is located at ~/.oh-my-zsh/themes to install this theme you can copy it here.

Some themes need fonts to be installed, in this case a nerdfont.

I just downloaded 3270 font you can find it here

https://github.com/ryanoasis/nerd-fonts/releases/tag/v2.1.0

One Time downloaded we unzip, open it and install it clicking over install button.

Finally, set 3270 or your downloaded font as console font and modify the .zshrc file but this time with ZSH_THEME=”philty” .

Again if you not see any change at your console run source .zshrc in it.

Category: en-others
Something wrong? If you found an error or mistake in the content you can contact me on Twitter | @luisg2249_luis.
Last 4 post in same category

Comments