Guest User

bashrc

a guest
May 10th, 2024
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. # .bashrc
  2.  
  3. # Source global definitions
  4. if [ -f /etc/bashrc ]; then
  5. . /etc/bashrc
  6. fi
  7.  
  8. # User specific environment
  9. if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
  10. PATH="$HOME/.local/bin:$HOME/bin:$PATH"
  11. fi
  12. export PATH
  13.  
  14. # Uncomment the following line if you don't like systemctl's auto-paging feature:
  15. # export SYSTEMD_PAGER=
  16.  
  17. # User specific aliases and functions
  18. if [ -d ~/.bashrc.d ]; then
  19. for rc in ~/.bashrc.d/*; do
  20. if [ -f "$rc" ]; then
  21. . "$rc"
  22. fi
  23. done
  24. fi
  25. unset rc
  26.  
  27. # Automatically added by the Guix install script.
  28. if [ -n "$GUIX_ENVIRONMENT" ]; then
  29. if [[ $PS1 =~ (.*)"\\$" ]]; then
  30. PS1="${BASH_REMATCH[1]} [env]\\\$ "
  31. fi
  32. fi
  33.  
  34. # vterm
  35. vterm_printf() {
  36. if [ -n "$TMUX" ] && ([ "${TERM%%-*}" = "tmux" ] || [ "${TERM%%-*}" = "screen" ]); then
  37. # Tell tmux to pass the escape sequences through
  38. printf "\ePtmux;\e\e]%s\007\e\\" "$1"
  39. elif [ "${TERM%%-*}" = "screen" ]; then
  40. # GNU screen (screen, screen-256color, screen-256color-bce)
  41. printf "\eP\e]%s\007\e\\" "$1"
  42. else
  43. printf "\e]%s\e\\" "$1"
  44. fi
  45. }
  46.  
  47. # clear vterm screen
  48. if [[ "$INSIDE_EMACS" = 'vterm' ]]; then
  49. function clear() {
  50. vterm_printf "51;Evterm-clear-scrollback";
  51. tput clear;
  52. }
  53. fi
  54.  
  55. # prompt tracking
  56. vterm_prompt_end(){
  57. vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"
  58. }
  59. PS1=$PS1'\[$(vterm_prompt_end)\]'
  60.  
  61.  
  62.  
  63.  
Advertisement
Add Comment
Please, Sign In to add comment