Advertisement
Guest User

Untitled

a guest
Sep 7th, 2019
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.87 KB | None | 0 0
  1. # ~/.bashrc: executed by bash(1) for non-login shells.
  2. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  3. # for examples
  4.  
  5. # If not running interactively, don't do anything
  6. case $- in
  7. *i*) ;;
  8. *) return;;
  9. esac
  10.  
  11. # don't put duplicate lines or lines starting with space in the history.
  12. # See bash(1) for more options
  13. HISTCONTROL=ignoreboth
  14.  
  15. # append to the history file, don't overwrite it
  16. shopt -s histappend
  17.  
  18. # don't allow > for non-empty files
  19. set -o noclobber
  20.  
  21. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  22. HISTSIZE=1000
  23. HISTFILESIZE=2000
  24.  
  25. # check the window size after each command and, if necessary,
  26. # update the values of LINES and COLUMNS.
  27. shopt -s checkwinsize
  28.  
  29. # If set, the pattern "**" used in a pathname expansion context will
  30. # match all files and zero or more directories and subdirectories.
  31. shopt -s globstar
  32.  
  33. # make less more friendly for non-text input files, see lesspipe(1)
  34. [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  35.  
  36. # set variable identifying the chroot you work in (used in the prompt below)
  37. if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
  38. debian_chroot=$(cat /etc/debian_chroot)
  39. fi
  40.  
  41. # set a fancy prompt (non-color, unless we know we "want" color)
  42. case "$TERM" in
  43. xterm-color|*-256color) color_prompt=yes;;
  44. esac
  45.  
  46. # uncomment for a colored prompt, if the terminal has the capability; turned
  47. # off by default to not distract the user: the focus in a terminal window
  48. # should be on the output of commands, not on the prompt
  49. #force_color_prompt=yes
  50.  
  51. if [ -n "$force_color_prompt" ]; then
  52. if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  53. # We have color support; assume it's compliant with Ecma-48
  54. # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  55. # a case would tend to support setf rather than setaf.)
  56. color_prompt=yes
  57. else
  58. color_prompt=
  59. fi
  60. fi
  61.  
  62. if [ "$color_prompt" = yes ]; then
  63. PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
  64. else
  65. PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  66. fi
  67. unset color_prompt force_color_prompt
  68.  
  69. # If this is an xterm set the title to user@host:dir
  70. case "$TERM" in
  71. xterm*|rxvt*)
  72. PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
  73. ;;
  74. *)
  75. ;;
  76. esac
  77.  
  78. # enable color support of ls and also add handy aliases
  79. if [ -x /usr/bin/dircolors ]; then
  80. test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  81. alias ls='ls --color=auto'
  82. #alias dir='dir --color=auto'
  83. #alias vdir='vdir --color=auto'
  84.  
  85. alias grep='grep --color=auto'
  86. alias fgrep='fgrep --color=auto'
  87. alias egrep='egrep --color=auto'
  88. alias copy='cp'
  89. alias move='mv'
  90. fi
  91.  
  92. # colored GCC warnings and errors
  93. export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
  94.  
  95. # Add an "alert" alias for long running commands. Use like so:
  96. # sleep 10; alert
  97. 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$//'\'')"'
  98.  
  99. # enable programmable completion features (you don't need to enable
  100. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  101. # sources /etc/bash.bashrc).
  102. if ! shopt -oq posix; then
  103. if [ -f /usr/share/bash-completion/bash_completion ]; then
  104. . /usr/share/bash-completion/bash_completion
  105. elif [ -f /etc/bash_completion ]; then
  106. . /etc/bash_completion
  107. fi
  108. fi
  109.  
  110. # Rbenv requires this to work
  111. export PATH="$HOME/bin:$HOME/.rbenv/bin:$PATH"
  112. eval "$(rbenv init -)"
  113.  
  114. # NNN env vars
  115. export NNN_TMPFILE="/tmp/nnn"
  116. export NNN_SCRIPT="$HOME/bin/compile-latex"
  117. export NNN_USE_EDITOR=1
  118. export DISABLE_FILE_OPEN_ON_NAV=1
  119. export NNN_COPIER="~/bin/nnncp.sh"
  120.  
  121. # `n` is nnn with ^G support
  122. n()
  123. {
  124. nnn "$@"
  125.  
  126. if [ -f $NNN_TMPFILE ]; then
  127. . $NNN_TMPFILE
  128. rm -f $NNN_TMPFILE > /dev/null
  129. fi
  130. }
  131.  
  132. # Pretty colours uwu
  133. if [ "$TERM" = "linux" ]; then
  134. echo -en "\e]P00C020F" #black
  135. echo -en "\e]P8808080" #darkgrey
  136. echo -en "\e]P1E44D2E" #darkred
  137. echo -en "\e]P9FF0800" #red
  138. echo -en "\e]P2228B22" #darkgreen
  139. echo -en "\e]PA50C878" #green
  140. echo -en "\e]P3CD853F" #brown
  141. echo -en "\e]PBDE935F" #yellow
  142. echo -en "\e]P42A6592" #darkblue
  143. echo -en "\e]PC8EC3EB" #blue
  144. echo -en "\e]P58B008B" #darkmagenta
  145. echo -en "\e]PD85678F" #magenta
  146. echo -en "\e]P6008B8B" #darkcyan
  147. echo -en "\e]PE5E8D87" #cyan
  148. echo -en "\e]P7D3D3D3" #lightgrey
  149. echo -en "\e]PFFFFFF0" #white
  150. clear #for background artifacting
  151. fi
  152.  
  153. export WALLPAPER="$HOME/pictures/wallpapers/butterflies.png"
  154. export SCREENSAVER="$HOME/pictures/wallpapers/butterflies.png"
  155.  
  156. echo ".bashrc was sourced" >> /tmp/bashrc.log 2>&1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement