README.md

April 10, 2025 ยท View on GitHub

Bar theme

Features:

  • It looks not like Christmas tree. Most of themes (omz examples) look like Christmas garland and frustrate attention ๐ŸŽ„ ๐Ÿ’ˆ. But terminal is most for write commands and get output, not for color juggling ๐Ÿ–ฅ

  • It has three attention aspects by priority: first - command and path, second - output, third - pills/sections ๐Ÿ‘“

  • It has a bar along all space and it is a great separator โฌ›๏ธ

  • The command beginning has fixed position and command has color with intensity. It's great for reading and typing ๐Ÿ’š

  • The pills/sections placed to right but not in RPROMPT and it allows you to secure copy the command and output without environmental disclosure ๐Ÿ”’

  • The pills/sections can have additional background or color accent if you need ๐Ÿ’Š

Appearance

zsh bar theme

Screeshot from Hyper with Fira Code or something like this.

xonsh

Use xontrib-prompt-bar

Starship

https://github.com/anki-code/starship-prompt-mono/

prompt-toolkit

fancy-zsh-prompt.py

Oh-my-zsh

git clone https://github.com/anki-code/zsh-bar-theme ~/.oh-my-zsh/custom/themes/zsh-bar-theme
ln -s ~/.oh-my-zsh/custom/themes/zsh-bar-theme/bar.zsh-theme ~/.oh-my-zsh/custom/themes/bar.zsh-theme
sed -i  's/^ZSH_THEME=/ZSH_THEME="bar"\n#ZSH_THEME=/g' ~/.zshrc
zsh

Powerlevel10k

  1. .zshrc settings:
POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION=
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(user host dir newline prompt_char)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(vcs command_execution_time background_jobs virtualenv anaconda pyenv nodenv nvm nodeenv rbenv rvm kubecontext terraform nordvpn ranger time newline)
POWERLEVEL9K_TIME_FORMAT='%D{%y-%m-%d %H:%M:%S%z}'
POWERLEVEL9K_BACKGROUND=234
POWERLEVEL9K_PROMPT_CHAR_BACKGROUND=
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND=234
POWERLEVEL9K_USER_FOREGROUND=244
POWERLEVEL9K_HOST_FOREGROUND=244
POWERLEVEL9K_ANACONDA_FOREGROUND=244
POWERLEVEL9K_VCS_FOREGROUND=244
POWERLEVEL9K_TIME_FOREGROUND=244
zle_highlight=( default:fg=green,bold )
  1. Also you can try the proof of concept config p10k-bar.zsh. It work but not recommended because it disable many p10k features.

bash PoC

trap 'echo -ne "\e[0m"' DEBUG
function prompt_command {
        local l="`hostname` `whoami` `pwd`"
        local r="`date --rfc-3339=sec`"
        local ls=${#l}
        local rs=${#r}
        let ss=$COLUMNS-$ls-$rs-2
        local sp="`printf %${ss}s | tr ' ' ' '`"
        echo -e "\n\e[48;5;234m$l $sp $r\e[0m"
}

export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ;} prompt_command"
export PS1='\$ \[\033[01;32m\]'