From 9d9917a7cdd39002272b6ddafecc5032602c61b0 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Mon, 18 Oct 2021 14:49:37 +0200 Subject: [PATCH] Adds time to prompt --- zsh/ohmyzsh/themes/laptop.zsh-theme | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zsh/ohmyzsh/themes/laptop.zsh-theme b/zsh/ohmyzsh/themes/laptop.zsh-theme index ffbede0..8db641e 100644 --- a/zsh/ohmyzsh/themes/laptop.zsh-theme +++ b/zsh/ohmyzsh/themes/laptop.zsh-theme @@ -83,11 +83,13 @@ local PR_TEMP="" command -v vcgencmd > /dev/null && PR_TEMP=' ${PR_GREEN}‹$(vcgencmd measure_temp | cut -d = -f 2)›${PR_NO_COLOR}' +local PR_DATE='${PR_BOLD}${PR_MAGENTA}[%D{%H:%M:%S}]${PR_NO_COLOR}' + #PROMPT="${user_host} ${current_dir} ${rvm_ruby}${git_branch}$PR_PROMPT " separator='${PR_YELLOW}::${PR_NO_COLOR}' tty | read tty_value if [[ $tty_value == *pts* ]]; then # if in a tty - PROMPT="$PR_ARROW_UP${user_host}${separator}${PR_NO_COLOR}${current_dir} ${rvm_ruby}${git_branch}${PR_TEMP} + PROMPT="$PR_ARROW_UP${PR_DATE} ${user_host}${separator}${PR_NO_COLOR}${current_dir} ${rvm_ruby}${git_branch}${PR_TEMP} $PR_ARROW_DOWN$PR_PROMPT ${PR_NO_COLOR}" return_code="%(?.%{$PR_GREEN%}%? ↵%{$PR_NO_COLOR%}.%{$PR_RED%}%? ↵%{$PR_NO_COLOR%})" else @@ -98,3 +100,8 @@ fi RPS1=" ${return_code}" ZSH_THEME_GIT_PROMPT_PREFIX="%{$PR_YELLOW%}‹" ZSH_THEME_GIT_PROMPT_SUFFIX="›%{$PR_NO_COLOR%}" + +TMOUT=1 +TRAPALRM() { + zle reset-prompt +}