From 1b29e40075dd700c45ec0760654cf79cb8b9c2f0 Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Thu, 24 Dec 2020 21:03:52 -0800 Subject: [PATCH] Adding time to prompt --- .zsh-prompt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.zsh-prompt b/.zsh-prompt index e88137e..00b1b42 100644 --- a/.zsh-prompt +++ b/.zsh-prompt @@ -2,11 +2,17 @@ setopt prompt_subst # Prompt (on left side) similar to default bash prompt, or redhat zsh prompt with colors -PROMPT="%(!.%{$fg[red]%}[%n@%m %1~]%{$reset_color%}# .%{$fg[green]%}[%n@%m %1~]%{$reset_color%}$ " +PROMPT="%(!.%{$fg[red]%}[%n@%m %1~] %{$reset_color%}# .%{$fg[green]%}[%n@%m %1~] %{$fg[cyan]%}%T%{$reset_color%} $ " # Maia prompt # PROMPT="%B%{$fg[cyan]%}%(4~|%-1~/.../%2~|%~)%u%b >%{$fg[cyan]%}>%B%(?.%{$fg[cyan]%}.%{$fg[red]%})>%{$reset_color%}%b " # Print some system information when the shell is first started # Print a greeting message when shell is started -echo $USER@$HOST $(uname -srm) $(lsb_release -rcs) +echo $USER@$HOST $(uname -srm) +if command -v COMMAND &> /dev/null +then + $(lsb_release -rcs) +fi + + ## Prompt on right side: # - shows status of git when in git repository (code adapted from https://techanic.net/2012/12/30/my_git_prompt_for_zsh.html) # - shows exit status of previous command (if previous command finished with an error) -- 2.34.1