You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

profile 3.7 KiB

5 years ago
6 years ago
6 years ago
10 years ago
6 years ago
5 years ago
3 years ago
3 years ago
1 year ago
10 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. #!/bin/sh
  2. # profile --- 10sr profile
  3. __safe_add_path_r(){
  4. # add path to right
  5. test -d "$1" && PATH="${PATH}:$1"
  6. }
  7. __safe_add_path_l(){
  8. # add path to left
  9. test -d "$1" && PATH="$1:${PATH}"
  10. }
  11. __safe_add_path_l "$HOME/.cabal/bin"
  12. __safe_add_path_l "$HOME/.cargo/bin"
  13. __safe_add_path_l "$HOME/.local/lib/gems/bin"
  14. __safe_add_path_l "$HOME/.gem/ruby/2.1.0/bin"
  15. __safe_add_path_l "$HOME/.local/bin"
  16. __safe_add_path_r "/c/mingw/bin"
  17. __safe_add_path_r "/c/mingw/msys/1.0/bin"
  18. export GEM_HOME="$HOME/.local/lib/gems"
  19. export RUBYLIB="$RUBYLIB:$HOME/.local/lib/gems/lib"
  20. # in my environment powerdown does not work
  21. test -z "$DISPLAY" && \
  22. test -z "$SSH_CONNECTION" && \
  23. ! (uname -r | grep Microsoft >/dev/null) &&\
  24. type setterm >/dev/null 2>&1 && \
  25. setterm -blank 30 -powersave on # -powerdown 10
  26. ##################################
  27. # EnvVal definitions
  28. test "$TERM" = linux && export LANG=C
  29. export LC_MESSAGES=C
  30. export LC_TIME=C
  31. export TERMCAP="${TERMCAP}:vb="
  32. # export ENV=~/.shrc
  33. export PAGER="less"
  34. export LESS="-iMRX"
  35. __batcommand=$(command -v bat || command -v batcat)
  36. if test -n "$__batcommand"
  37. then
  38. export LESSOPEN="| $__batcommand --color=always %s"
  39. # export LESSOPEN="| bat --color=always --decorations=never %s"
  40. fi
  41. if false which nvim >/dev/null
  42. then
  43. _VI_ALT=nvim
  44. elif which vim >/dev/null
  45. then
  46. _VI_ALT=vim
  47. elif which vi >/dev/null
  48. then
  49. _VI_ALT=vi
  50. fi
  51. if test -n "$_VI_ALT"
  52. then
  53. export EDITOR="$_VI_ALT"
  54. export GIT_EDITOR="$EDITOR"
  55. export VISUAL="$EDITOR"
  56. fi
  57. # export CDPATH=".:~"
  58. export GIT_PAGER="less -FRX"
  59. export GIT_MERGE_AUTOEDIT=no
  60. if test -n "$TMUX" && \
  61. expr "$TERM" : screen >/dev/null && \
  62. expr "`tmux display -p '#{client_termname}'`" : '.*-256color$' >/dev/null
  63. then
  64. TERM=screen-256color
  65. fi
  66. if test -z "$USER" -a -n "$USERNAME"
  67. then
  68. export USER=$USERNAME
  69. fi
  70. # set TMP, TEMP, TMPDIR
  71. if test -z "$TMP"
  72. then
  73. if test -n "$TMPDIR"
  74. then
  75. export TMP=$TMPDIR
  76. elif test -n "$TEMP"
  77. then
  78. export TMP="$TEMP"
  79. else
  80. export TMP=/tmp
  81. fi
  82. fi
  83. __user_md5=$(perl -e "use Digest::MD5 qw(md5_hex); print md5_hex('$USER$HOSTNAME')")
  84. expr "$TMP" : ".*${__user_md5}.*" >/dev/null || export TMP="${TMP}/${__user_md5}-tmp"
  85. test -d "$TMP" || mkdir -p "$TMP"
  86. TMP="$(cd "$TMP" && pwd)"/
  87. export TEMP=$TMP
  88. export TMPDIR=$TMP
  89. if test -d ~/dbx
  90. then
  91. export CHIT_PATH="$HOME/dbx/.chit"
  92. fi
  93. export JAVA_OPTS="$JAVA_OPTS -Duser.language=en"
  94. export GOPATH="$HOME/.golang"
  95. export PATH="$GOPATH/bin:$PATH"
  96. export PYTHONUSERBASE=$HOME/.pip
  97. export PATH="$PYTHONUSERBASE/bin:$PATH"
  98. # Enable --user by default when running pip install
  99. # export PIP_USER=1
  100. export PIP_USER=
  101. export PIPENV_VENV_IN_PROJECT=1
  102. export PIPENV_MAX_DEPTH=10 # Defaults to 3
  103. # Required when pipenv has been installed within pipx environment
  104. export PIPENV_IGNORE_VIRTUALENVS=1
  105. if test -f "$HOME"/.brew/bin/python3
  106. then
  107. export PIPX_DEFAULT_PYTHON="$HOME"/.brew/bin/python3
  108. fi
  109. if which brew >/dev/null
  110. then
  111. export STARDICT_DATA_DIR=`brew --prefix`/share/sdcv-dict-oxford
  112. fi
  113. export HOMEBREW_NO_AUTO_UPDATE=1
  114. ###########################################
  115. # Host colors
  116. export _HOSTCOLOR_1=
  117. export _HOSTCOLOR_2=
  118. # black red green yellow blue magenta cyan white
  119. # Yellow is hard to read strings...
  120. case "`hostname`" in
  121. arch-vb-win8-vaio11)
  122. _HOSTCOLOR_1=magenta
  123. _HOSTCOLOR_2=white
  124. ;;
  125. darwin-mba.local)
  126. _HOSTCOLOR_1=cyan
  127. _HOSTCOLOR_2=black
  128. ;;
  129. # newkiwi)
  130. # _HOSTCOLOR_1=magenta
  131. # _HOSTCOLOR_2=white
  132. # ;;
  133. win7-i7-opti)
  134. _HOSTCOLOR_1=red
  135. _HOSTCOLOR_2=white
  136. ;;
  137. *)
  138. _HOSTCOLOR_1=green
  139. _HOSTCOLOR_2=black
  140. ;;
  141. esac