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.

74 lines
2.6KB

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