From 78411555bc770015cc7ce95e5c6ad6497f83e137 Mon Sep 17 00:00:00 2001 From: goodhumored Date: Sun, 28 Jul 2024 10:09:48 +0300 Subject: [PATCH] oh my zsh amuse theme timer added --- .oh-my-zsh/themes/amuse.zsh-theme | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.oh-my-zsh/themes/amuse.zsh-theme b/.oh-my-zsh/themes/amuse.zsh-theme index cddbcd4..eaa3adc 100644 --- a/.oh-my-zsh/themes/amuse.zsh-theme +++ b/.oh-my-zsh/themes/amuse.zsh-theme @@ -10,11 +10,24 @@ ZSH_THEME_GIT_PROMPT_CLEAN="" ZSH_THEME_RUBY_PROMPT_PREFIX="%{$fg_bold[red]%}‹" ZSH_THEME_RUBY_PROMPT_SUFFIX="›%{$reset_color%}" +# timer +function preexec() { + timer=${timer:-$SECONDS} +} + +function precmd() { + if [ $timer ]; then + timer_show=$(($SECONDS - $timer)) + export RPROMPT="%F{cyan}${timer_show}s %{$reset_color%}" + unset timer + fi +} + PROMPT=' %{$fg_bold[green]%}%~%{$reset_color%}$(git_prompt_info)$(virtualenv_prompt_info) ⌚ %{$fg_bold[red]%}%*%{$reset_color%} $ ' -RPROMPT='$(ruby_prompt_info)' +# RPROMPT='$(ruby_prompt_info)' VIRTUAL_ENV_DISABLE_PROMPT=0 ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX=" %{$fg[green]%}🐍 "