
# ----- SSH ------

SSH_ENV="$HOME/.ssh/agent-environment"

function start_agent {
  /usr/bin/ssh-agent | sed 's/^echo/#echo/' >"$SSH_ENV"
  chmod 600 "$SSH_ENV"
  . "$SSH_ENV" >/dev/null
  /usr/bin/ssh-add
}

if [ -f "$SSH_ENV" ]; then
  . "$SSH_ENV" >/dev/null
  #ps $SSH_AGENT_PID doesn't work under Cygwin
  ps -ef | grep $SSH_AGENT_PID | grep ssh-agent$ >/dev/null || {
    start_agent
  }
else
  start_agent
fi

# ----- SSH ------

# ----- ALIASES ------

alias vi="vim"
alias ll="ls -lah"

if [[ $- == *i* ]]; then
	alias ls='ls --color=auto'
	alias grep='grep --color=auto'
	PS1='[\u@\h \W]\$ '
fi

# ----- ALIASES ------

# ----- PATH extensions ------

export PATH="$PATH:/usr/local/bin/"

export PATH="$PATH:$HOME/.local/kitty.app/bin/"
export PATH="$PATH:$HOME/.local/ayugram.app/bin/"
export PATH="$PATH:$HOME/.local/bin"
export PATH="$PATH:$HOME/opt/weylus"

# ----- PATH extensions ------

# Source Rust Env

if command -v cargo >/dev/null 2>&1; then
	. "$HOME/.cargo/env"
fi


hash wsl2-ssh-agent 2>/dev/null && {
	eval $(wsl2-ssh-agent)
}

fastfetch

