bashrc-all 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. if [ -f ~/.wal_alias ]; then
  2. . ~/.wal_alias
  3. fi
  4. [ -f ~/.fzf.bash ] && source ~/.fzf.bash
  5. # Cargo config
  6. [ -f ~/.cargo ] && source "$HOME/.cargo/env"
  7. if [ -f ~/.cache/wal/sequences ]; then
  8. cat ~/.cache/wal/sequences
  9. fi
  10. export EDITOR=$(which vim)
  11. EXA_PATH=$(which exa)
  12. if [ ! -z "$EXA_PATH" ]; then
  13. alias ls="$EXA_PATH"
  14. alias ll="$EXA_PATH -lah"
  15. alias lg="$EXA_PATH -lah --git"
  16. fi
  17. BAT_PATH=$(which bat)
  18. if [ ! -z "$BAT_PATH" ]; then
  19. export MANPAGER="$BAT_PATH"
  20. alias cat="$BAT_PATH"
  21. fi
  22. # Platform agnostic aliases
  23. export TMUX_PATH=$(which tmux --skip-alias)
  24. alias tmuxn="$TMUX_PATH new -s $1"
  25. alias tmuxa="$TMUX_PATH attach -t $1"
  26. alias tmuxl="$TMUX_PATH ls"
  27. alias tmuxq="echo $TMUX"
  28. alias httpserver="python -m SimpleHTTPServer"
  29. if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
  30. then
  31. PATH="$HOME/.local/bin:$HOME/bin:$PATH"
  32. fi
  33. export PATH
  34. # Case defines platform specific configs
  35. # Platform agnostic configs above
  36. case $(hostname) in
  37. Simons-MBP)
  38. export PS1="\w λ > \[$(tput sgr0)\]"
  39. # Mac aliases
  40. alias shorten-ps1="PS1='λ > '"
  41. alias default-ps1='PS1="\w λ > \[$(tput sgr0)\]"'
  42. alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs"
  43. # PATH setups
  44. PATH='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/swatson/.fzf/bin:/Users/swatson/Library/Python/3.8/bin'
  45. default-ps1
  46. clear
  47. echo "Loaded MacM1 config"
  48. ;;
  49. watsonsi-fedora)
  50. export PS1="[\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]]\$ "
  51. alias start_od="rclone --vfs-cache-mode writes mount ipconedrive: /home/watonsi/OneDrive/"
  52. alias tmuxn="systemd-run --scope --user tmux new -s $1"
  53. alias scrot="maim"
  54. # function to set terminal title
  55. function set-title() {
  56. if [[ -z "$ORIG" ]]; then
  57. ORIG=$PS1
  58. fi
  59. TITLE="\[\e]2;$*\a\]"
  60. PS1=${ORIG}${TITLE}
  61. }
  62. echo "Loaded Work Fedora config"
  63. ;;
  64. void)
  65. export PS1="\[\033[36m\]\w\[\033[m\] λ "
  66. alias shorten-ps1="PS1='λ > '"
  67. echo "Loaded Void config"
  68. esac