From d33ced3f6eb0db00857ae448efdc1c0a328fe044 Mon Sep 17 00:00:00 2001 From: phansible Date: Fri, 1 Mar 2024 14:55:29 -0500 Subject: [PATCH] NOTES_DIR default .zshrc will attempt to set the NOTES_DIR environment variable First check to see if the environment variable is set. If not, if `$HOME/Sync/MarkdownNotes` exits, then use that. If that directory doesn't exist, try `$HOME/Documents`. If they both fail, then don't set the var. --- .zshrc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index f65c637..4852cd6 100644 --- a/.zshrc +++ b/.zshrc @@ -1,7 +1,16 @@ # Exports export PATH=$HOME/bin:/usr/local/bin:$HOME/.local/bin/:$PATH export ZSH="$HOME/.oh-my-zsh" - +# Export notes directory +if [[ -z $NOTES_DIR ]]; then + if [[ -d $HOME/Sync/MarkdownNotes ]]; then + export NOTES_DIR=$HOME/Sync/MarkdownNotes + else + if [[ -d $HOME/Documents ]]; then + export NOTES_DIR=$HOME/Documents + fi + fi +fi ZSH_THEME="powerlevel10k/powerlevel10k" POWERLEVEL9K_MODE="nerdfont-complete" plugins=(git zsh-autosuggestions zsh-syntax-highlighting)