bashrc-all 2.0 KB

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