Last active
March 28, 2022 20:05
-
-
Save irizwaririz/ad64b4aabead1f6f66915bd8ef3d6bd2 to your computer and use it in GitHub Desktop.
.bashrc setup for: conda, ssh-agent, Xserver, fzf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# >>> conda initialize >>> | |
# !! Contents within this block are managed by 'conda init' !! | |
__conda_setup="$('/home/jcroberto/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" | |
if [ $? -eq 0 ]; then | |
eval "$__conda_setup" | |
else | |
if [ -f "/home/jcroberto/miniconda3/etc/profile.d/conda.sh" ]; then | |
. "/home/jcroberto/miniconda3/etc/profile.d/conda.sh" | |
else | |
export PATH="/home/jcroberto/miniconda3/bin:$PATH" | |
fi | |
fi | |
unset __conda_setup | |
# <<< conda initialize <<< | |
# >>> ssh-agent initialize >>> | |
SSH_ENV="$HOME/.ssh/agent-environment" | |
function start_agent { | |
echo "Initialising new SSH agent..." | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
echo succeeded | |
chmod 600 "${SSH_ENV}" | |
. "${SSH_ENV}" > /dev/null | |
/usr/bin/ssh-add; | |
} | |
# Source SSH settings, if applicable | |
if [ -f "${SSH_ENV}" ]; then | |
. "${SSH_ENV}" > /dev/null | |
#ps ${SSH_AGENT_PID} doesn't work under cywgin | |
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { | |
start_agent; | |
} | |
else | |
start_agent; | |
fi | |
# <<< ssh-agent initialize <<< | |
# Xserver | |
export DISPLAY=localhost:0.0 | |
# Better fuzzy searching with fzf | |
# export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe we can use
echo
to append this at the end of the current system's.bashrc
. Like so: