NoPaste

.bashrc

von ren22
Beschreibung:
meine .bashrc
Snippet erstellt:
06.04.2019 22:39:23
Snippet wird automatisch gelöscht:
Niemals

Dein Code:
  1. # set variable identifying the chroot you work in (used in the prompt below)
  2. if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
  3.     debian_chroot=$(cat /etc/debian_chroot)
  4. fi
  5.  
  6. # set a fancy prompt (non-color, unless we know we "want" color)
  7. case "$TERM" in
  8.     xterm-color) color_prompt=yes;;
  9. esac
  10.  
  11. # uncomment for a colored prompt, if the terminal has the capability; turned
  12. # off by default to not distract the user: the focus in a terminal window
  13. # should be on the output of commands, not on the prompt
  14. force_color_prompt=yes
  15.  
  16. if [ -n "$force_color_prompt" ]; then
  17.     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  18.         # We have color support; assume it's compliant with Ecma-48
  19.         # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  20.         # a case would tend to support setf rather than setaf.)
  21.         color_prompt=yes
  22.     else
  23.         color_prompt=
  24.     fi
  25. fi
  26.  
  27. function pre_prompt {
  28. newPWD="${PWD}"
  29. user="whoami"
  30. host=$(echo -n "$HOSTNAME" | sed -e "s/[\.].*//")
  31. datenow=$(date "+%a, %d %b %y")
  32. let promptsize=$(echo -n "┌($user@$host ddd., DD mmm YY)(${PWD})┐" \
  33.                  | wc -c | tr -d " ")
  34. let fillsize=${COLUMNS}-${promptsize}
  35. fill=""
  36. while [ "$fillsize" -gt "0" ]
  37. do
  38.     fill="${fill}─"
  39.     let fillsize=${fillsize}-1
  40. done
  41. if [ "$fillsize" -lt "0" ]
  42. then
  43.     let cutt=3-${fillsize}
  44.     newPWD="   $(echo -n "$PWD" | sed -e "s/\(^.\{$cutt\}\)\(.*\)/\2/")"
  45. fi
  46.  
  47. }
  48. PROMPT_COMMAND=pre_prompt
  49.  
  50. #export black="\[\033[0;38;5;0m\]"
  51. #export red="\[\033[0;38;5;1m\]"
  52. #export orange="\[\033[0;38;5;130m\]"
  53. export green="\[\033[0;38;5;2m\]"
  54. #export yellow="\[\033[0;38;5;3m\]"
  55. #export blue="\[\033[0;38;5;4m\]"
  56. #export bblue="\[\033[0;38;5;12m\]"
  57. #export magenta="\[\033[0;38;5;55m\]"
  58. #export cyan="\[\033[0;38;5;6m\]"
  59. export white="\[\033[0;38;5;7m\]"
  60. export coldblue="\[\033[0;38;5;33m\]"
  61. export smoothblue="\[\033[0;38;5;111m\]"
  62. #export iceblue="\[\033[0;38;5;45m\]"
  63. export turqoise="\[\033[0;38;5;50m\]"
  64. #export smoothgreen="\[\033[0;38;5;42m\]"
  65.  
  66. if [ "$color_prompt" = yes ]; then
  67.     PS1="$green┌─($green\u$smoothblue@$green\h $coldblue\$newPWD$green)─\${fill}($coldblue\$(date \"+%a. %d.%b %y\")$green)─┐\n$green└─($turqoise\$(date \"+%H:%M:%S\") \$$green)─>$white "
  68. else
  69.     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  70. fi
  71. unset color_prompt force_color_prompt
  72.  
  73. # If this is an xterm set the title to user@host:dir
  74. case "$TERM" in
  75. xterm*|rxvt*)
  76.     PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
  77.     ;;
  78. *)
  79.     ;;
  80. esac
  81.  
  82. # enable color support of ls and also add handy aliases
  83. if [ -x /usr/bin/dircolors ]; then
  84.     test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  85.     alias ls='ls --color=auto'
  86.     alias dir='dir --color=auto'
  87.     alias vdir='vdir --color=auto'
  88.  
  89.     alias grep='grep --color=auto'
  90.     alias fgrep='fgrep --color=auto'
  91.     alias egrep='egrep --color=auto'
  92. fi
  93.  
  94. # Alias definitions.
  95. # You may want to put all your additions into a separate file like
  96. # ~/.bash_aliases, instead of adding them here directly.
  97. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  98. if [ -f ~/.bash_aliases ]; then
  99.     . ~/.bash_aliases
  100. fi
  101.  
  102. # enable programmable completion features (you don't need to enable
  103. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  104. # sources /etc/bash.bashrc).
  105. if ! shopt -oq posix; then
  106.   if [ -f /usr/share/bash-completion/bash_completion ]; then
  107.     . /usr/share/bash-completion/bash_completion
  108.   elif [ -f /etc/bash_completion ]; then
  109.     . /etc/bash_completion
  110.   fi
  111. fi
  112.  
  113. # --------------------------------------------------------------------------------
  114. # Exports
  115. # --------------------------------------------------------------------------------
  116. #doublecommander
  117. export DOUBLECMD=/mnt/opt/Anwendungen/DateiManger/DoubleCommander/
  118. PATH=$PATH:$DOUBLECMD
  119.  
  120. #set UTF-8 Locales #https://perlgeek.de/en/article/set-up-a-clean-utf8-environment
  121. #export LC_ALL=de_DE.UTF-8
  122. #export LANG=de_DE.UTF-8
  123. #export LANGUAGE=de_DE.UTF-8
  124.  
  125. #set tmpdir
  126. export TMPDIR=/mnt/tmp
  127.  
  128. #für vim mit sudo (sudoedit)
  129. export EDITOR=$(which vim)
  130.  
  131. #256 Farben in Xterm aktivieren
  132. if [ "$TERM" == "xterm" ]; then
  133.   export TERM=xterm-256color
  134. fi
  135.  
  136. export LS_OPTIONS='--color=auto'
  137. eval "`dircolors`"
  138. alias ls='ls $LS_OPTIONS'
  139.  
  140. # --------------------------------------------------------------------------------
  141. # Terminal Einstellungen
  142. # --------------------------------------------------------------------------------
  143. #disable scrolllock , for vim ctrl+s
  144. stty -ixon
  145.  
  146. #MidnightCommander -  Exit to the current directory
  147. #On exit, the shell returns to the directory Midnight Commander was started from,
  148. #instead of the last active directory.
  149. source /usr/lib/mc/mc.sh
  150.  
  151. #Autokorrektur, um Vertipper bei Verzeichnisnamen auszubessern
  152. shopt -s direxpand
  153. shopt -s dirspell
  154. shopt -s cdspell
  155.  
  156. # --------------------------------------------------------------------------------
  157. # Scanner: Hewlett-Packard PSC_1600_series all-in-one
  158. # --------------------------------------------------------------------------------
  159. export SANE_DEFAULT_DEVICE="hpaio:/usb/PSC_1600_series?serial=XXXXXXXXXXXXX"
  160. #für debugging:
  161. export SANE_DEBUG_XSCANIMAGE=3
  162. #This environment variable controls the debug level xscanimage.
  163. #Higher debug levels increase the verbosity of the output.
  164. #Value Descsription
  165. #0 print fatal errors
  166. #1 print errors
  167. #2 print warnings
  168. #3 print information messages
  169. #4 print everything
  170.  
  171. # --------------------------------------------------------------------------------
  172. # Bash Funktionen
  173. # --------------------------------------------------------------------------------

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. Alternativ kannst du den gesamten Eintrag auch als Datei herunterladen.