mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-12-27 05:34:35 +00:00
Include custom theme without oh-my-zsh requrement
This commit is contained in:
parent
afcbe3e4d8
commit
60920444f0
35
home/.config/sh/theme
Executable file
35
home/.config/sh/theme
Executable file
|
@ -0,0 +1,35 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# Color definition
|
||||||
|
GRAY="%F{237}"
|
||||||
|
RED="%F{196}"
|
||||||
|
ORANGE="%F{214}"
|
||||||
|
BLUE="%F{032}"
|
||||||
|
LBLUE="%F{075}"
|
||||||
|
PURPLE="%F{105}"
|
||||||
|
RESET="%f"
|
||||||
|
|
||||||
|
git_prompt() {
|
||||||
|
branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/*\(.*\)/\1/')
|
||||||
|
|
||||||
|
if [ ! -z $branch ]; then
|
||||||
|
echo -n "$ORANGE$branch"
|
||||||
|
|
||||||
|
if [ ! -z "$(git status --short)" ]; then
|
||||||
|
echo "$RED+"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
setopt PROMPT_SUBST
|
||||||
|
|
||||||
|
# Primary Prompt
|
||||||
|
[ "$EUID" -eq 0 ] && PS1="$RED%n@%m$RESET" || PS1="$GRAY%n@%m$RESET" # user@machine
|
||||||
|
PS1+=" $BLUE%~" # Working directory
|
||||||
|
PS1+="\$(git_prompt)"
|
||||||
|
PS1+=" $PURPLE%(!.#.»)$RESET " # Final symbol (# or »)
|
||||||
|
|
||||||
|
# Next line prompt
|
||||||
|
PS2="$RED\ $RESET"
|
||||||
|
|
||||||
|
# Right side prompt (on error)
|
||||||
|
RPS1="%(?..$RED%? ↵$RESET)"
|
|
@ -46,6 +46,8 @@ autoload -U colors && colors # enable color support
|
||||||
[ -f ~/.config/sh/handlers ] && source ~/.config/sh/handlers
|
[ -f ~/.config/sh/handlers ] && source ~/.config/sh/handlers
|
||||||
# Load key bindings
|
# Load key bindings
|
||||||
[ -f ~/.config/sh/keybinds ] && source ~/.config/sh/keybinds
|
[ -f ~/.config/sh/keybinds ] && source ~/.config/sh/keybinds
|
||||||
|
# Load prompt
|
||||||
|
[ -f ~/.config/sh/theme ] && . ~/.config/sh/theme
|
||||||
|
|
||||||
|
|
||||||
# Load extensions (should be last)
|
# Load extensions (should be last)
|
||||||
|
|
Loading…
Reference in a new issue