env 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # vim: ft=sh:
  2. # shellcheck shell=sh
  3. # shellcheck disable=3043,1090
  4. __prependpath() {
  5. local __p
  6. for __p; do
  7. case ":${PATH}:" in
  8. *:"${__p}":*) continue ;;
  9. esac
  10. PATH="${__p}${PATH:+:${PATH}}"
  11. done
  12. export PATH
  13. }
  14. __appendpath() {
  15. local __p
  16. for __p; do
  17. case ":${PATH}:" in
  18. *:"${__p}":*) continue ;;
  19. esac
  20. PATH="${PATH:+${PATH}:}${__p}"
  21. done
  22. export PATH
  23. }
  24. __prependpath "${HOME}/.local/bin/override/nixGL"
  25. __appendpath "${HOME}/.local/bin"
  26. __appendpath "${HOME}/.local/bin/chromium-apps"
  27. umask 0027
  28. export USE_EMOJI=no
  29. # def #
  30. export EDITOR=vim
  31. export PAGER=less
  32. export TERMINAL=st
  33. export TMPDIR="${TMPDIR:-/tmp}"
  34. # XDG #
  35. ### xdg-user-dir(1) ###
  36. export XDG_DESKTOP_DIR="${TMPDIR}"
  37. export XDG_DOWNLOAD_DIR="${HOME}/Downloads"
  38. export XDG_DOCUMENTS_DIR="${HOME}/Documents"
  39. export XDG_MUSIC_DIR="${XDG_DOCUMENTS_DIR}/music"
  40. export XDG_CACHE_HOME="${HOME}/.cache"
  41. export XDG_CONFIG_HOME="${HOME}/.config"
  42. export XDG_DATA_HOME="${HOME}/.local/share"
  43. : "${XDG_RUNTIME_DIR:=${TMPDIR}/runtime-${USER:-$(id -un)}}"
  44. export XDG_RUNTIME_DIR
  45. # gtk #
  46. export GTK_THEME=Adwaita:dark
  47. # ~/ clean-up #
  48. export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
  49. export GNUPGHOME="${XDG_DATA_HOME}/gnupg"
  50. export GOPATH="${XDG_CACHE_HOME}/golang"
  51. export CARGO_HOME="${XDG_CACHE_HOME}/cargo"
  52. export PYLINTHOME="${XDG_CACHE_HOME}/pylint"
  53. export RUSTUP_HOME="${XDG_CACHE_HOME}/rustup"
  54. export IPYTHONDIR="${XDG_CACHE_HOME}/ipython"
  55. export RLWRAP_HOME="${XDG_CACHE_HOME}/rlwrap"
  56. export DOCKER_CONFIG="${XDG_CONFIG_HOME}/docker"
  57. export PYLINTRC="${XDG_CONFIG_HOME}/pylint/pylintrc"
  58. export PASSWORD_STORE_DIR="${XDG_DATA_HOME}/password-store"
  59. export PYTHONSTARTUP="${XDG_CONFIG_HOME}/python/startup.py"
  60. export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent"
  61. ## tex ##
  62. export TEXMFHOME="${XDG_DATA_HOME}/texmf"
  63. export TEXMFVAR="${XDG_CACHE_HOME}/texlive/texmf-var"
  64. export TEXMFCONFIG="${XDG_CONFIG_HOME}/texlive/texmf-config"
  65. ## haskell ##
  66. export CABAL_DIR="${XDG_CACHE_HOME}/cabal"
  67. export CABAL_CONFIG="${XDG_CONFIG_HOME}/cabal/cabal.hs"
  68. # less #
  69. export LESS=-iRS
  70. export LESSHISTFILE=-
  71. __033="$(printf %b '\033')" && {
  72. export LESS_TERMCAP_mb="${__033}[1;31m"
  73. export LESS_TERMCAP_md="${__033}[1;36m"
  74. export LESS_TERMCAP_me="${__033}[0m"
  75. export LESS_TERMCAP_so="${__033}[01;44;33m"
  76. export LESS_TERMCAP_se="${__033}[0m"
  77. export LESS_TERMCAP_us="${__033}[1;32m"
  78. export LESS_TERMCAP_ue="${__033}[0m"
  79. }
  80. unset __033
  81. # tmux #
  82. export TMUX_TMPDIR="${TMPDIR}"
  83. # rust #
  84. export RUSTFLAGS='-C target-feature=-crt-static'
  85. __prependpath "${CARGO_HOME}/bin"
  86. __export_list() {
  87. local _i __eval
  88. # shellcheck disable=2016
  89. for _i; do
  90. [ -f "${XDG_CONFIG_HOME}/${_i}" ] || continue
  91. __eval='sed -z "s/\n\s*\n/\n/g;s/\n/:/g"'
  92. __eval="${_i}="'$('"${__eval}"' < "${XDG_CONFIG_HOME}/${_i}")'
  93. __eval="${__eval} && export ${_i}"
  94. eval "${__eval}"
  95. done
  96. }
  97. __export_list LF_ICONS LS_COLORS EXA_COLORS
  98. unset -f __export_list
  99. # pfetch #
  100. export PF_INFO='ascii title os kernel uptime wm shell editor palette'
  101. # skim #
  102. export SKIM_DEFAULT_OPTIONS='--color fg:#d0d0d0,hl:#5f87af,fg+:#d0d0d0,'\
  103. 'hl+:#5fd7ff,info:#435961,prompt:#EFA6A2,pointer:#af5fff,marker:#80C990,'\
  104. 'spinner:#af5fff,header:#b4d8d8'
  105. [ -r ~/.config/private-env ] && . ~/.config/private-env
  106. __prependpath "${HOME}/.local/bin/override"
  107. unset -f __appendpath
  108. unset -f __prependpath