mirror of
https://github.com/danbee/dotfiles-local
synced 2025-03-04 08:49:07 +00:00
Add distro to prompt
This commit is contained in:
parent
8cadda8bd1
commit
3181b3828c
@ -23,6 +23,23 @@ update_git_prompt() {
|
|||||||
GIT_PROMPT+="%{$fg[blue]%}]%{$reset_color%} "
|
GIT_PROMPT+="%{$fg[blue]%}]%{$reset_color%} "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
os_icon() {
|
||||||
|
case `uname` in
|
||||||
|
Darwin)
|
||||||
|
echo "%{$fg[white]%} macOS%{$reset_color%}"
|
||||||
|
;;
|
||||||
|
Linux)
|
||||||
|
echo "%{$fg[yellow]%} Linux%{$reset_color%}"
|
||||||
|
;;
|
||||||
|
FreeBSD)
|
||||||
|
echo "%{$fg[red]%} FreeBSD%{$reset_color%}"
|
||||||
|
;;
|
||||||
|
OpenBSD)
|
||||||
|
echo "%{$fg[yellow]%}OpenBSD%{$reset_color%}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
autoload -Uz add-zsh-hook
|
autoload -Uz add-zsh-hook
|
||||||
|
|
||||||
add-zsh-hook precmd update_git_prompt
|
add-zsh-hook precmd update_git_prompt
|
||||||
@ -38,7 +55,7 @@ export CLICOLOR=1
|
|||||||
setopt promptsubst
|
setopt promptsubst
|
||||||
|
|
||||||
# prompt
|
# prompt
|
||||||
export PROMPT='${SSH_CONNECTION+"%{$fg[yellow]%}%n@%m%{$reset_color%}:"}%{$fg_bold[green]%}%2c%{$reset_color%} ${GIT_PROMPT}%{$fg_bold[cyan]%}❯%{$reset_color%} '
|
export PROMPT='$(os_icon) ${SSH_CONNECTION+"%{$fg[yellow]%}%n@%m%{$reset_color%}:"}%{$fg_bold[green]%}%2c%{$reset_color%} ${GIT_PROMPT}%{$fg_bold[cyan]%}❯%{$reset_color%} '
|
||||||
export RPROMPT='%D{%K:%M:%S}'
|
export RPROMPT='%D{%K:%M:%S}'
|
||||||
|
|
||||||
# update the prompt on carriage return
|
# update the prompt on carriage return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user