Skip to content

Commit

Permalink
Move some stuff to zprofile
Browse files Browse the repository at this point in the history
  • Loading branch information
b-ggs committed Jan 7, 2024
1 parent 3d1e996 commit 476779c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 47 deletions.
57 changes: 55 additions & 2 deletions zsh/.zprofile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ __pill_text() {
echo -e "${pill_start}${background_color_start}${black_text_color}${text}${reset_color}${pill_end}"
}

# shell stuff

# darwin

if [[ "$(uname)" = "Darwin" ]]; then
# Homebrew
Expand All @@ -30,6 +31,7 @@ if [[ "$(uname)" = "Darwin" ]]; then
echo "$(__pill_text WARN 3) On Darwin but Homebrew not found"
fi


# OrbStack
if [[ -d "$HOME/.orbstack" ]]; then
source ~/.orbstack/shell/init.zsh 2>/dev/null || :
Expand All @@ -39,6 +41,9 @@ if [[ "$(uname)" = "Darwin" ]]; then
fi
fi


# pyenv

if [[ -d "$HOME/.pyenv" ]]; then
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
Expand All @@ -48,9 +53,57 @@ else
echo "$(__pill_text WARN 3) pyenv not found"
fi


# fnm

if [[ -f /opt/homebrew/bin/fnm ]]; then
eval "$(fnm env --use-on-cd)"
echo "$(__pill_text OK 2) fnm"
else
echo "$(__pill_text WARN 3) fnm not found"
fi


# keychain

if [[ -d "$HOME/.keychain" ]]; then
local default_keyfile=$HOME/.ssh/id_ed25519
local default_keychain_shellenv=$HOME/.keychain/$(hostname)-sh

if [[ ! -f "$default_keyfile" ]]; then
echo "$(__pill_text WARN 3) default keyfile not found"
return
fi

if [[ -f "$default_keychain_shellenv" ]]; then
source "$default_keychain_shellenv"
fi

if [[ $(keychain -l | grep $default_keyfile) ]] 2> /dev/null ; then
echo "$(__pill_text OK 2) default SSH key loaded in keychain"
else
echo "$(__pill_text WARN 3) default SSH key not loaded in keychain"
fi
else
echo "$(__pill_text WARN 3) keychain not found"
fi


# cargo

if [[ -d "$HOME/.cargo" ]]; then
. "$HOME/.cargo/env"
. "$HOME/.cargo/env"
echo "$(__pill_text OK 2) cargo"
else
echo "$(__pill_text WARN 3) cargo not found"
fi


# private zshrc

if [ -f "$HOME/.private.zshrc" ]; then
source "$HOME/.private.zshrc"
echo "$(__pill_text OK 2) private zshrc"
else
echo "$(__pill_text WARN 3) private zshrc not found"
fi
45 changes: 0 additions & 45 deletions zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -80,51 +80,6 @@ export FZF_DEFAULT_COMMAND='rg --files --hidden'
export FZF_DEFAULT_OPTS="--color 16"


# fnm

if [[ -f /opt/homebrew/bin/fnm ]]; then
eval "$(fnm env --use-on-cd)"
echo "$(__pill_text OK 2) fnm"
else
echo "$(__pill_text WARN 3) fnm not found"
fi


# keychain

if [[ -d "$HOME/.keychain" ]]; then
local default_keyfile=$HOME/.ssh/id_ed25519
local default_keychain_shellenv=$HOME/.keychain/$(hostname)-sh

if [[ ! -f "$default_keyfile" ]]; then
echo "$(__pill_text WARN 3) default keyfile not found"
return
fi

if [[ -f "$default_keychain_shellenv" ]]; then
source "$default_keychain_shellenv"
fi

if [[ $(keychain -l | grep $default_keyfile) ]] 2> /dev/null ; then
echo "$(__pill_text OK 2) default SSH key loaded in keychain"
else
echo "$(__pill_text WARN 3) default SSH key not loaded in keychain"
fi
else
echo "$(__pill_text WARN 3) keychain not found"
fi


# private zshrc

if [ -f "$HOME/.private.zshrc" ]; then
source "$HOME/.private.zshrc"
echo "$(__pill_text OK 2) private zshrc"
else
echo "$(__pill_text WARN 3) private zshrc not found"
fi


# omz

export ZSH="$HOME/.oh-my-zsh"
Expand Down

0 comments on commit 476779c

Please sign in to comment.