Thedro's Dotfiles https://www.thedroneely.com
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.

.bash_profile 2.8KB

4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/bash
  2. # shellcheck disable=SC2016
  3. prefixPath() {
  4. case ":$PATH:" in
  5. *":$1:"*) true ;;
  6. *) PATH="$1:$PATH" ;;
  7. esac
  8. export PATH;
  9. }
  10. # set xauthority path
  11. export XAUTHORITY=$HOME/.config/X11/Xauthority;
  12. # auto login
  13. [ "$EUID" != 0 ] && [ -z "$DISPLAY" ] && [ "$(tty)" = '/dev/tty1' ] \
  14. && command -v nix && "$HOME"/.local/bin/scripts/nix-xorg-conf > "$HOME"/.config/X11/xorg.conf.d/00-modules.conf \
  15. && exec xinit "$HOME/.config/X11/xinitrc" -- :0 \
  16. -configdir "$HOME/.config/X11/xorg.conf.d" \
  17. -logfile "$HOME/.cache/xorg.log" vt1 -keeptty -auth "$XAUTHORITY";
  18. # set prompt
  19. PS1_USER='$(E=$? && [ "$E" = 0 ] || echo "$E ")\[\e[0;34m\]\W\[\e[0m\] \[\e[0;34m\]\$\[\e[0m\] '
  20. PS1_ROOT='$(E=$? && [ "$E" = 0 ] || echo "$E ")\[\e[0;31m\]\W\[\e[0m\] \[\e[0;31m\]\$\[\e[0m\] '
  21. PS1_SSHD='$(E=$? && [ "$E" = 0 ] || echo "$E ")\[\e[0;32m\]\W\[\e[0m\] \[\e[0;32m\]\$\[\e[0m\] '
  22. # export prompt
  23. [ "$EUID" != 0 ] && export PS1="$PS1_USER";
  24. [ "$EUID" = 0 ] && export PS1="$PS1_ROOT";
  25. # ssh set prompt
  26. [ -n "$SSH_CLIENT" ] && [ "$EUID" != 0 ] && export PS1="$PS1_SSHD";
  27. # path exports
  28. prefixPath "$HOME/.local/bin";
  29. # general exports
  30. export CARGO_HOME="$XDG_CACHE_HOME/cargo"
  31. export EDITOR=vim
  32. export FZF_DIRECTORY_MARKS=$HOME/Documents/.fzf-marks
  33. export FZF_FILE_MARKS=$HOME/Documents/.fzf-fmarks
  34. export HISTCONTROL=ignoreboth:erasedups
  35. export HISTFILESIZE=
  36. export HISTSIZE=
  37. export HISTTIMEFORMAT="%d/%m/%y %T "
  38. export ICEAUTHORITY="$XDG_CACHE_HOME/ICEauthority"
  39. export INPUTRC="$XDG_CONFIG_HOME/inputrc"
  40. export LESSHISTFILE="$XDG_CACHE_HOME/less.history"
  41. export MANPAGER="vim -M +MANPAGER -"
  42. export MPLAYER_HOME="$XDG_CONFIG_HOME/mplayer"
  43. export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npmrc"
  44. export PROMPT_COMMAND='cd .; history -a; history -n;'
  45. export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc"
  46. export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
  47. export SUDO_ASKPASS="$HOME/.local/bin/rofi-askpass"
  48. export TERMINAL=urxvt
  49. export WEECHAT_HOME="$XDG_CONFIG_HOME/weechat"
  50. export XDG_CACHE_HOME="$HOME/.cache"
  51. export XDG_CONFIG_HOME="$HOME/.config"
  52. export XDG_DATA_HOME="$HOME/.local/share"
  53. command -v groff > /dev/null 2>&1 && \
  54. GROFF_FONT_PATH="$HOME/.nix-profile/share/groff/$(groff -v | head -n1 | awk '{ print $4 }')/font" && \
  55. export GROFF_FONT_PATH
  56. # themes
  57. export DESKTOP_SESSION=gnome
  58. export XDG_CURRENT_DESKTOP=gnome
  59. export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
  60. export QT_STYLE_OVERRIDE=adwaita
  61. # specific themes
  62. [ "$(cat /etc/hostname)" = "tiger" ] && export QT_STYLE_OVERRIDE=adwaita-dark
  63. [ "$(cat /etc/hostname)" = "talon" ] && export QT_STYLE_OVERRIDE=adwaita-dark
  64. # fzf settings
  65. export FZF_DEFAULT_OPTS="--color=fg:255,hl:203 \
  66. --color=fg+:81,bg+:237,hl+:203 \
  67. --color=info:188,prompt:69,pointer:199 \
  68. --color=marker:109,spinner:236,header:255"
  69. # source bashrc
  70. [ -z "$BASH_PROFILE" ] && . "$HOME/.bashrc"