mirror of
https://github.com/arcan1s/dotfiles.git
synced 2025-04-25 08:27:18 +00:00
Edited promt
This commit is contained in:
parent
eed6da1621
commit
4ec0b34351
38
zshrc
38
zshrc
@ -59,12 +59,19 @@ bindkey '\e[5~' up-line-or-history # page-up
|
|||||||
bindkey '\e[6~' down-line-or-history # page-down
|
bindkey '\e[6~' down-line-or-history # page-down
|
||||||
|
|
||||||
# autocomplit
|
# autocomplit
|
||||||
autoload -U compinit promptinit
|
autoload -U compinit
|
||||||
compinit
|
compinit
|
||||||
promptinit
|
|
||||||
zstyle ':completion:*' insert-tab false # Автокомплит для первого символа
|
zstyle ':completion:*' insert-tab false # Автокомплит для первого символа
|
||||||
zstyle ':completion:*' max-errors 2
|
zstyle ':completion:*' max-errors 2
|
||||||
|
|
||||||
|
# prompt
|
||||||
|
autoload -U promptinit
|
||||||
|
promptinit
|
||||||
|
|
||||||
|
# colors
|
||||||
|
autoload -U colors
|
||||||
|
colors
|
||||||
|
|
||||||
# autocd
|
# autocd
|
||||||
setopt autocd
|
setopt autocd
|
||||||
|
|
||||||
@ -96,10 +103,20 @@ autoload zcalc
|
|||||||
# PROMPT && RPROMPT
|
# PROMPT && RPROMPT
|
||||||
if [[ $EUID == 0 ]]; then
|
if [[ $EUID == 0 ]]; then
|
||||||
# [root@host dir]#
|
# [root@host dir]#
|
||||||
PROMPT=$'%{\e[1;37m%}[%{\e[1;31m%}%n%{\e[1;37m%}@%{\e[0;31m%}%m %{\e[1;33m%}%1/%{\e[1;37m%}]#%{\e[0m%} '
|
PROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
||||||
|
%{$fg_bold[red]%}%n%{$reset_color%}\
|
||||||
|
%{$fg_bold[white]%}@%{$reset_color%}\
|
||||||
|
%{$fg_no_bold[red]%}%m %{$reset_color%}\
|
||||||
|
%{$fg_bold[yellow]%}%1/%{$reset_color%}\
|
||||||
|
%{$fg_bold[white]%}]# %{$reset_color%}"
|
||||||
else
|
else
|
||||||
# [user@host dir]$
|
# [user@host dir]$
|
||||||
PROMPT=$'%{\e[1;37m%}[%{\e[1;32m%}%n%{\e[1;37m%}@%{\e[0;32m%}%m %{\e[1;33m%}%1/%{\e[1;37m%}]$%{\e[0m%} '
|
PROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
||||||
|
%{$fg_bold[green]%}%n%{$reset_color%}\
|
||||||
|
%{$fg_bold[white]%}@%{$reset_color%}\
|
||||||
|
%{$fg_no_bold[green]%}%m %{$reset_color%}\
|
||||||
|
%{$fg_bold[yellow]%}%1/%{$reset_color%}\
|
||||||
|
%{$fg_bold[white]%}]$ %{$reset_color%}"
|
||||||
fi
|
fi
|
||||||
precmd () {
|
precmd () {
|
||||||
# Battery charge
|
# Battery charge
|
||||||
@ -107,16 +124,19 @@ precmd () {
|
|||||||
bat_perc=`acpi | awk {'print $4;'} | sed -e "s/\s//" -e "s/%.*//"`
|
bat_perc=`acpi | awk {'print $4;'} | sed -e "s/\s//" -e "s/%.*//"`
|
||||||
|
|
||||||
if [[ $bat_perc < 15 ]]; then
|
if [[ $bat_perc < 15 ]]; then
|
||||||
col='%{\e[1;31m%}'
|
col="%{$fg_bold[red]%}"
|
||||||
elif [[ $bat_perc < 50 ]]; then
|
elif [[ $bat_perc < 50 ]]; then
|
||||||
col='%{\e[1;33m%}'
|
col="%{$fg_bold[yellow]%}"
|
||||||
else
|
else
|
||||||
col='%{\e[1;32m%}'
|
col="%{$fg_bold[green]%}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo '%{\e[1;37m%}['$col$bat_perc'%{\e[1;37m%}%%]%{\e[0m%}'
|
echo "%{$fg_bold[white]%}["$col$bat_perc"%{$fg_bold[white]%}%%]%{$reset_color%}"
|
||||||
}
|
}
|
||||||
RPROMPT=$'%{\e[1;37m%}[%{\e[1;36m%}%T%{\e[1;37m%}]%{\e[0m%} '$(batcharge)
|
RPROMPT="%{$fg_bold[white]%}[%{$reset_color%}\
|
||||||
|
%{$fg_bold[cyan]%}%T%{$reset_color%}\
|
||||||
|
%{$fg_bold[white]%}] %{$reset_color%}"\
|
||||||
|
$(batcharge)
|
||||||
# if [[ $EUID == 0 ]]
|
# if [[ $EUID == 0 ]]
|
||||||
# then
|
# then
|
||||||
# PROMPT=$'%{\e[1;37m%}# %{\e[1;31m%}%n %{\e[1;37m%}at %{\e[0;31m%}%m %{\e[1;37m%}in %{\e[1;33m%}%~ %{\e[1;37m%}[%D] [%*] '$(batcharge)$'%{\e[1;37m%} [%?]\n%{\e[1;31m%}# %{\e[0m%}'
|
# PROMPT=$'%{\e[1;37m%}# %{\e[1;31m%}%n %{\e[1;37m%}at %{\e[0;31m%}%m %{\e[1;37m%}in %{\e[1;33m%}%~ %{\e[1;37m%}[%D] [%*] '$(batcharge)$'%{\e[1;37m%} [%?]\n%{\e[1;31m%}# %{\e[0m%}'
|
||||||
|
Loading…
Reference in New Issue
Block a user