LINUX: "zsh" Theme I use

A Tech Lead by profession, a Data Enthusiast and a forever learner. Experienced in DevOps, Cloud, FullStack Development, Data Science, Machine Learning and AI.
Search for a command to run...

A Tech Lead by profession, a Data Enthusiast and a forever learner. Experienced in DevOps, Cloud, FullStack Development, Data Science, Machine Learning and AI.
No comments yet. Be the first to comment.
Hashnode introduced 'headless' and while having a look at it, It really seemed interesting. It's nice to have a way to play with our publications and posts from Hashnode, outside of Hashnode without tedious data scraping. While reading another blog, ...

While trying to get Red Hat (RHEL9) installed in my WSL (Windows Subsystem for Linux) within my Windows 11 laptop, I stumbled upon the same hurdle I did for installing the older RHEL8. The list of available distros published by Microsoft still does n...

When it comes to collaborative software development, efficiency in communication and planning are critical. GitHub offers a feature called "Code owners" to improve project management and facilitate cooperation. Let's see how this can improve your dev...

PowerShell is a powerful tool, allowing to perform a myriad of tasks with just a few commands. However, there are times when elevated privileges are required to execute certain commands. This is as easy as right-clicking PowerShell and "Run As Admini...

While trying to setup RHEL with WSL 2, I stumbled upon this very helpful blog https://wsl.dev/mobyrhel8/
While doing the setup, I found this zsh theme very nice, and I have been using it since then. The above mentioned blog already has the steps, but it has a lot of other info about setting up RHEL in WSL2 as well. So here is the extract of setting up the zsh theme (steps are for RHEL8, might differ for other Linux dists).
If the zsh is not already installed, then install zsh.
dnf install -y sudo zsh cracklib-dicts

Oh My Zsh is the configuration manager being used for this
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Find the location of zsh installation
cat /etc/shells

Use vi editor to update the default shell of the user to zsh by replacing the path (example: ec2-user is the user we are working with)
sudo vi /etc/passwd

As written in the installation message, we can now change the zsh config file. For now, we will only change the theme to Fino Theme.
vi $HOME/.zshrc
In the opened vi editor, look for the key ZSH_THEME and update it as below:
ZSH_THEME="fino-time"
Check if the config file got updated, and then load the new config file.
# [Optional] Check if the theme value has been correctly saved
grep ZSH_THEME $HOME/.zshrc
# Reload the zsh configuration file
source $HOME/.zshrc

Open the theme settings in vi editor
vi $HOME/.oh-my-zsh/themes/fino-time.zsh-theme
Look for the PROMPT variable and modify it to add the variables
PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name) (WSL: $WSL_DISTRO_NAME | kernel: $(uname -r))%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}%~%{$reset_color%}\$(git_prompt_info)\$(ruby_prompt_info)
╰─ %* \$(virtualenv_info)\$(prompt_char) "
Reload the zsh configuration file, it will also reload the oh my zsh theme
source $HOME/.zshrc

That's it, now we have a nice-looking theme that gives a lot more information without being too overwhelming. It has a nice clock in the prompt too.