My dotfiles. Period.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/bash
  2. ### .... ###
  3. ### BASH ###
  4. ### '''' ###
  5. make_ps1h() {
  6. echo "$red\h$normal";
  7. }
  8. # my tools as aliases
  9. alias winpdb="$HOME/local/winpdb/winpdb"
  10. alias node="$HOME/local/node/bin/node"
  11. alias npm="$HOME/local/node/bin/npm"
  12. alias tap="./node_modules/tap/bin/tap.js"
  13. alias tap-reader="./node_modules/tap/bin/tap-reader.js"
  14. alias diff="colordiff -u"
  15. ### ...... ###
  16. ### OTHERS ###
  17. ### '''''' ###
  18. # tame minions
  19. export PERL5LIB="$PERL5LIB:$HOME/lib/minions/lib"
  20. export PERL5LIB="$PERL5LIB:$HOME/local/gnucash-importer/lib"
  21. export EDITOR='vim'
  22. ### ................ ###
  23. ### SET UP SSH-AGENT ###
  24. ### '''''''''''''''' ###
  25. # http://mah.everybody.org/docs/ssh#run-ssh-agent
  26. SSH_ENV="$HOME/.ssh/environment"
  27. function start_agent {
  28. echo "Initialising new SSH agent..."
  29. /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
  30. echo succeeded
  31. chmod 600 "${SSH_ENV}"
  32. . "${SSH_ENV}" > /dev/null
  33. /usr/bin/ssh-add;
  34. }
  35. # Source SSH settings, if applicable
  36. if [ -f "${SSH_ENV}" ]; then
  37. . "${SSH_ENV}" > /dev/null
  38. #ps ${SSH_AGENT_PID} doesn't work under cywgin
  39. ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
  40. start_agent;
  41. }
  42. else
  43. start_agent;
  44. fi
  45. ### .................. ###
  46. ### RUN BYOBU IF SSH'D ###
  47. ### '''''''''''''''''' ###
  48. # (but only it this is a login shell)
  49. if shopt -q login_shell
  50. then
  51. if [ -n "$SSH_CONNECTION" ]
  52. then
  53. byobu
  54. exit
  55. fi
  56. fi