mirror of
https://github.com/ivabus/ivabus-zsh-theme
synced 2024-12-04 14:05:06 +03:00
Update theme to be independent of oh-my-zsh.
This commit is contained in:
parent
6af1c38a3f
commit
e4bbb17f03
4 changed files with 12 additions and 72 deletions
16
README.md
16
README.md
|
@ -1,25 +1,19 @@
|
|||
# ivabus-zsh-theme
|
||||
|
||||
Clean zsh prompt theme.
|
||||
Clean zsh prompt theme. Does not require oh-my-zsh anymore.
|
||||
|
||||
## Inside
|
||||
## Features
|
||||
|
||||
- root indication
|
||||
- exit codes
|
||||
- git info
|
||||
- oh-my-zsh independence
|
||||
|
||||
![Screenshot](/screenshot.png)
|
||||
|
||||
## How to install
|
||||
|
||||
Install ivabus-zsh-theme via curl
|
||||
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/install.sh)"
|
||||
|
||||
Install ivabus-zsh-theme via wget
|
||||
|
||||
sh -c "$(wget https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/install.sh -O -)"
|
||||
Copy ivabus.zsh-theme file to any location and `source` it in your `.zshrc` or just enable it each time you need it in your shell.
|
||||
|
||||
## License
|
||||
|
||||
[WTFPL](http://www.wtfpl.net)
|
||||
This zsh theme is distributed under Unlicense.
|
45
install.sh
45
install.sh
|
@ -1,45 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ ! -f /bin/zsh ]
|
||||
then
|
||||
echo "You need to install zsh."
|
||||
exit 255
|
||||
fi
|
||||
|
||||
if [ ! -d $ZSH ]
|
||||
then
|
||||
echo "You need to install oh-my-zsh first."
|
||||
read -p "Install (y/N)?: " INSTALL_OHMYZSH
|
||||
if [[ $INSTALL_OHMYZSH == "n" || $INSTALL_OHMYZSH == "N" || $INSTALL_OHMYZSH == "" ]]
|
||||
then
|
||||
echo "Exiting"
|
||||
exit 255
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f $(which curl) ]
|
||||
then
|
||||
if [[ $INSTALL_OHMYZSH = "y" || $INSTALL_OHMYZSH = "Y" ]]
|
||||
then
|
||||
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
fi
|
||||
curl -fsSL https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/ivabus.zsh-theme > ~/.oh-my-zsh/custom/themes/ivabus.zsh-theme
|
||||
/usr/bin/env zsh -c "source $ZSH/oh-my-zsh.sh && omz theme set ivabus"
|
||||
echo "Theme set"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -f $(which wget) ]
|
||||
then
|
||||
if [[ $INSTALL_OHMYZSH = "y" || $INSTALL_OHMYZSH = "Y" ]]
|
||||
then
|
||||
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
|
||||
fi
|
||||
wget https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/ivabus.zsh-theme -O ~/.oh-my-zsh/custom/themes/ivabus.zsh-theme
|
||||
/usr/bin/env zsh -c "source $ZSH/oh-my-zsh.sh && omz theme set ivabus"
|
||||
echo "Theme set"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Could not find a curl or wget. Install one of them, and then restart this script."
|
||||
exit 255
|
|
@ -2,29 +2,20 @@
|
|||
__zsh_prompt() {
|
||||
# set basic prompt with "USERNAME@HOSTNAME "
|
||||
if [[ $UID == 0 || $EUID == 0 ]]; then
|
||||
PROMPT="%{$fg[red]%}%n%{$reset_color%}@%{$fg[red]%}%m "
|
||||
PROMPT="%F{red}%n%f@%F{red}%m "
|
||||
else
|
||||
PROMPT="%{$fg[green]%}%n%{$reset_color%}@%{$fg[cyan]%}%m "
|
||||
PROMPT="%F{green}%n%f@%F{cyan}%m "
|
||||
fi
|
||||
# add to current prompt arrow or [exitcode] if non 0
|
||||
PROMPT+='%(?:%{$reset_color%}➜ :%{$fg_bold[red]%}%(?..[%?]) )'
|
||||
PROMPT+='%(?:%f➜ :%B%F{red}%(?..[%?]) )%b'
|
||||
# add current working directory
|
||||
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} '
|
||||
# and git status
|
||||
PROMPT+='$(git_prompt_info)'
|
||||
PROMPT+='%B%F{blue}%(5~|%-1~/…/%3~|%4~)%f%b '
|
||||
# add $ or #
|
||||
if [[ $UID == 0 || $EUID == 0 ]]; then
|
||||
PROMPT+='%{$fg[red]%}# %{$reset_color%}'
|
||||
PROMPT+='%F{red}# %f'
|
||||
else
|
||||
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
|
||||
PROMPT+='%F{white}$ %f'
|
||||
fi
|
||||
unset -f __zsh_prompt
|
||||
}
|
||||
|
||||
# setup git status
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}(%{$fg_bold[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%} "
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg_bold[yellow]%}✗%{$fg_bold[cyan]%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[cyan]%}"
|
||||
__zsh_prompt
|
||||
|
||||
__zsh_prompt
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 26 KiB |
Loading…
Reference in a new issue