From 5c7e72c07eb63daa5d92a5c498a4bb16ad370ca0 Mon Sep 17 00:00:00 2001 From: Nicole O'Connor Date: Sun, 19 Apr 2020 12:16:56 -0700 Subject: [PATCH] zshrc-stub self updates --- zshrc-stub | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/zshrc-stub b/zshrc-stub index 783b061..0aa6087 100644 --- a/zshrc-stub +++ b/zshrc-stub @@ -1,4 +1,18 @@ # vim: ft=zsh : -PROMPT="%{$fg[cyan]%}%n%{$fg[white]%}@%{$fg[magenta]%}%m %{$fg[white]%}%~ \# " +autoload -U colors && colors + +PROMPT="%{$fg[cyan]%}%n%{$fg[white]%}@%{$fg[magenta]%}%m %{$fg[white]%}%~ %# " RPROMPT="%{$fg_bold[black]%}%T%{$reset_color%}" + +_zshrc_updates_pending=0 + +if type md5sum &> /dev/null; then + current_stub_sum="$(md5sum ~/.zshrc | awk '{ print $1 }')" + new_stub_sum="$(md5sum ~/.local/share/zeesh/zshrc-stub | awk '{ print $1 }')" + + if [[ ! current_stub_sum == new_stub_sum ]]; then + cp ~/.local/share/zshrc-stub ~/.zshrc + _zshrc_updates_pending=1 + fi +fi