Blog

Happy Birthday Gentoo Linux

Gentoo LogoGentoo became 10 years old on the 4th of October. Happy Birthday!!! This means that I have tried Gentoo about 10 years ago... what a long time. I am steady lucky with this distribution and I hope I will be it in the future. Thank you to all developers who had contributed to the Gentoo project in the past 10 years! You're have done a great work!

Permalink: https://hanez.org/2009/10/16/happy-birthday-gentoo-linux/

I love the Zsh prompt used in Gentoo! Here it is...

Since I am using the Zsh as default Shell on my Linux machines but not all of them are Gentoo based, I put the Gentoo prompt here.

Screenshot:
Zsh Gentoo prompt Screenshot

Just put the following lines to your .zshrc and you will be able to use this prompt on all distributions, not only Gentoo. Shure, I could copy the prompt file to the default directory in /usr/share/zsh/... but it is easier to just copy the .zshrc file from system to system...:

prompt_gentoo_setup () {
prompt_gentoo_prompt=${1:-'blue'}
prompt_gentoo_user=${2:-'green'}
prompt_gentoo_root=${3:-'red'}

if [ "$USER" = 'root' ]
then
base_prompt="%B%F{$prompt_gentoo_root}%m%k "
else
base_prompt="%B%F{$prompt_gentoo_user}%n@%m%k "
fi
post_prompt="%b%f%k"

#setopt noxtrace localoptions

path_prompt="%B%F{$prompt_gentoo_prompt}%1~"
PS1="$base_prompt$path_prompt %# $post_prompt"
PS2="$base_prompt$path_prompt %_> $post_prompt"
PS3="$base_prompt$path_prompt ?# $post_prompt"
}

prompt_gentoo_setup "$@"

Permalink: https://hanez.org/2009/09/16/i-love-the-zsh-prompt-used-in-gentoo-here-it-is/

Pages

Page generated at: Apr 16, 2024 (CEST) using Jekyll & xw3 on GNU/Linux
NULL
Powered by: NULL