The very personal dotfiles of Levi Olson.
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.

45 lines
1.2 KiB

6 years ago
  1. #!/bin/bash
  2. # If not running interactively, don't do anything
  3. case $- in
  4. *i*) ;;
  5. *) return;;
  6. esac
  7. # restore last saved path
  8. if [ -f ~/.last_dir ]; then
  9. cd `cat ~/.last_dir`
  10. fi
  11. # check the window size after each command and, if necessary,
  12. # update the values of LINES and COLUMNS.
  13. shopt -s checkwinsize
  14. # Add an "alert" alias for long running commands. Use like so:
  15. # sleep 10; alert
  16. alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
  17. # enable programmable completion features (you don't need to enable
  18. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  19. # sources /etc/bash.bashrc).
  20. if ! shopt -oq posix; then
  21. if [[ -f /usr/share/bash-completion/bash_completion ]]; then
  22. # shellcheck source=/dev/null
  23. . /usr/share/bash-completion/bash_completion
  24. elif [[ -f /etc/bash_completion ]]; then
  25. # shellcheck source=/dev/null
  26. . /etc/bash_completion
  27. fi
  28. fi
  29. for file in /etc/bash_completion.d/* ; do
  30. # shellcheck source=/dev/null
  31. source "$file"
  32. done
  33. if [[ -f "${HOME}/.bash_profile" ]]; then
  34. # shellcheck source=/dev/null
  35. source "${HOME}/.bash_profile"
  36. fi
  37. sleep 0.2
  38. clear