Linux - zsh显示实时时钟

zsh显示实时时钟

安装并配置zsh

# 安装zsh与ohmyzsh
apt-get install -y zsh \
&& sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# 修改.oh-my-zsh/themes/fino-time.zsh-theme里的PROMPT变量(手动修改)
#PROMPT="╭─%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(box_name)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[033]%}%~%{$reset_color%}\$(git_prompt_info)\$(ruby_prompt_info) %{$FG[040]%}%D{%Y/%m/%d} - %*%{$reset_color%}
#╰─\$(virtualenv_info)\$(prompt_char) "

# 将.zshrc中的主题更改为fino-time
sed -i -r 's#^ZSH_THEME=".*"#ZSH_THEME="fino-time"#g' .zshrc

# 每秒更新prompt
tee -a ~/.zshrc << END
TMOUT=1
TRAPALRM() {
    zle reset-prompt
}
END

# source
source .zshrc

效果

你可能感兴趣的:(Linux)