https://github.com/anki-code/shell-prompt-theme-bar
The shell prompt appearance conception called Bar.
https://github.com/anki-code/shell-prompt-theme-bar
bash fish ohmyzsh omz-plugin prompt shell shell-pro zsh
Last synced: about 2 months ago
JSON representation
The shell prompt appearance conception called Bar.
- Host: GitHub
- URL: https://github.com/anki-code/shell-prompt-theme-bar
- Owner: anki-code
- License: mit
- Created: 2019-09-23T10:29:58.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-17T14:21:34.000Z (2 months ago)
- Last Synced: 2025-03-02T07:44:40.880Z (about 2 months ago)
- Topics: bash, fish, ohmyzsh, omz-plugin, prompt, shell, shell-pro, zsh
- Language: Shell
- Homepage:
- Size: 103 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- trackawesomelist - bar (anki-code) (⭐2) - Minimalist settings for [p10k (⭐48k)](https://github.com/romkatv/powerlevel10k). (Recently Updated / [Mar 21, 2025](/content/2025/03/21/README.md))
README
## Bar theme
Features:
* It looks not like Christmas tree. Most of themes ([omz examples](https://github.com/robbyrussell/oh-my-zsh/wiki/Themes)) 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

Screeshot from [Hyper](https://hyper.is) with [Fira Code](https://github.com/tonsky/FiraCode) or something like this.
## [xonsh](https://github.com/xonsh/xonsh)
Use [xontrib-prompt-bar](https://github.com/anki-code/xontrib-prompt-bar)
## [Starship](https://github.com/starship/starship)
Take a look https://github.com/starship/starship/issues/5059#issuecomment-2663192011
## [Oh-my-zsh](https://github.com/robbyrussell/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](https://github.com/romkatv/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 )
```
2. Also you can try the proof of concept config [p10k-bar.zsh](https://gist.github.com/romkatv/7f48d0deae7a3449f34a4870feaba0f5). 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\]'
```