bashrc-all 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. alias ssh-old="ssh -oKexAlgorithms=+diffie-hellman-group1-sha1"
  64. echo "Loaded Work Fedora config"
  65. ;;
  66. void)
  67. export PS1="\[\033[36m\]\w\[\033[m\] λ "
  68. alias shorten-ps1="PS1='λ > '"
  69. echo "Loaded Void config"
  70. esac