X-Git-Url: https://git.donarmstrong.com/?p=home-base.git;a=blobdiff_plain;f=.bashrc;h=eebab56bf4cef9bcd79f6512548d6ce02dcd16d6;hp=fc875dd4279c88c4aebd5c551d5e8e07b33c2085;hb=56c474f4bb506ca630136cc349f7f47f9b733375;hpb=382dcf28f1cf6b52391340dfac094cfe7a40528c diff --git a/.bashrc b/.bashrc index fc875dd..eebab56 100644 --- a/.bashrc +++ b/.bashrc @@ -46,6 +46,20 @@ if [ "$PS1" ]; then if [ -f /etc/bash_completion ]; then . /etc/bash_completion; fi; + + # set up ssh-agent + if which ssh-agent >/dev/null && [ -d ~/.ssh ]; then + if [ -e ~/.ssh/ssh_agent_info ] && \ + kill -0 "$(awk -F '[=;]' '/^SSH_AGENT_PID/{print $2}' ~/.ssh/ssh_agent_info)"; then + . ~/.ssh/ssh_agent_info > /dev/null + elif [ -e ~/.ssh/ssh_agent_info_$(hostname) ] && \ + kill -0 "$(awk -F '[=;]' '/^SSH_AGENT_PID/{print $2}' ~/.ssh/ssh_agent_info_$(hostname))"; then + . ~/.ssh/ssh_agent_info_$(hostname) > /dev/null + else + ssh-agent -s > ~/.ssh/ssh_agent_info_$(hostname) + . ~/.ssh/ssh_agent_info_$(hostname) > /dev/null + fi; + fi; alias aumix2='aumix -d /dev/mixer1 -I' if locale -a |grep -qi en_US.utf8; then @@ -60,28 +74,29 @@ if [ "$PS1" ]; then fi; export TMPDIR="$(echo ~/tmp)"; - for a in tda tdd tde; do - alias "s${a}"="STODO_NO_COMMIT=1 $a" - done; - - TODO_OPTIONS="--timeout --summary" + if [ -n "$(which devtodo)" ]; then + for a in tda tdd tde; do + alias "s${a}"="STODO_NO_COMMIT=1 $a" + done; - cd () - { - builtin cd "$@" && [ -r .todo ] && devtodo ${TODO_OPTIONS} - } + TODO_OPTIONS="--timeout --summary" - pushd () - { - builtin pushd "$@" && [ -r .todo ] && devtodo ${TODO_OPTIONS} - } - - popd () - { - builtin popd "$@" && [ -r .todo ] && devtodo ${TODO_OPTIONS} - } - - # Run todo initially upon login - devtodo ${TODO_OPTIONS} + cd () + { + builtin cd "$@" && [ -r .todo ] && devtodo ${TODO_OPTIONS} + } + pushd () + { + builtin pushd "$@" && [ -r .todo ] && devtodo ${TODO_OPTIONS} + } + + popd () + { + builtin popd "$@" && [ -r .todo ] && devtodo ${TODO_OPTIONS} + } + + # Run todo initially upon login + devtodo ${TODO_OPTIONS} + fi; fi