]> git.quilime.com - cfg.git/commitdiff
Adding time to prompt
authorGabriel Dunne <gdunne@quilime.com>
Fri, 25 Dec 2020 05:03:52 +0000 (21:03 -0800)
committerGabriel Dunne <gdunne@quilime.com>
Sat, 2 Jan 2021 20:47:28 +0000 (12:47 -0800)
.zsh-prompt

index e88137e6360d00a54ed07cf590abc0363bd0dc2c..00b1b42ed65fb58d1ef5f034408f284097b23ed0 100644 (file)
@@ -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)