Advertisement
Mashudi

bashrcku2

Feb 28th, 2015
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.34 KB | None | 0 0
  1.    
  2.  
  3.     # ~/.bashrc: executed by bash(1) for non-login shells.
  4.     # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  5.     # for examples
  6.      
  7.     # Pager
  8.     #export PAGER=most
  9.      
  10.     # If not running interactively, don't do anything
  11.     [ -z "$PS1" ] && return
  12.      
  13.     # don't put duplicate lines in the history. See bash(1) for more options
  14.     # don't overwrite GNU Midnight Commander's setting of `ignorespace'.
  15.     HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
  16.     # ... or force ignoredups and ignorespace
  17.     HISTCONTROL=ignoreboth
  18.      
  19.     # append to the history file, don't overwrite it
  20.     shopt -s histappend
  21.      
  22.     # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  23.      
  24.     # check the window size after each command and, if necessary,
  25.     # update the values of LINES and COLUMNS.
  26.     shopt -s checkwinsize
  27.      
  28.     # make less more friendly for non-text input files, see lesspipe(1)
  29.     #[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  30.      
  31.     # set variable identifying the chroot you work in (used in the prompt below)
  32.     if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  33.         debian_chroot=$(cat /etc/debian_chroot)
  34.     fi
  35.      
  36.     # set a fancy prompt (non-color, unless we know we "want" color)
  37.     case "$TERM" in
  38.         xterm-color) color_prompt=yes;;
  39.     esac
  40.      
  41.     # uncomment for a colored prompt, if the terminal has the capability; turned
  42.     # off by default to not distract the user: the focus in a terminal window
  43.     # should be on the output of commands, not on the prompt
  44.     force_color_prompt=yes
  45.      
  46.     if [ -n "$force_color_prompt" ]; then
  47.         if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  48.         # We have color support; assume it's compliant with Ecma-48
  49.         # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  50.         # a case would tend to support setf rather than setaf.)
  51.         color_prompt=yes
  52.         else
  53.         color_prompt=
  54.         fi
  55.     fi
  56.      
  57.     if [ "$color_prompt" = yes ]; then
  58.         PS1='\[\e[0;34m\]┌──[\[\e[0;32m\]\u\[\e[0;31m\]@\[\e[0;35m\]\h\[\e[0;34m\]]──\[\e[0;34m\][\[\e[0;32m\]\w\[\e[0;34m\]] \n└── \[\e[0;34m\]'
  59.     else
  60.         PS1='┌────[\u@\h]────────────────────────────────────────[\t]────┐ \n└───>[${PWD}] \$ '
  61.     fi
  62.     unset color_prompt force_color_prompt
  63.      
  64.     # If this is an xterm set the title to user@host:dir
  65.     case "$TERM" in
  66.     xterm*|rxvt*)
  67.         PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
  68.         ;;
  69.     *)
  70.         ;;
  71.     esac
  72.      
  73.     # Alias definitions.
  74.     # You may want to put all your additions into a separate file like
  75.     # ~/.bash_aliases, instead of adding them here directly.
  76.     # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  77.      
  78.     #if [ -f ~/.bash_aliases ]; then
  79.     #    . ~/.bash_aliases
  80.     #fi
  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.     # some more ls aliases
  95.     #alias ll='ls -l'
  96.     #alias la='ls -A'
  97.     alias l='ls -CF'
  98.     alias install='sudo apt-get install'
  99.     alias update='sudo apt-get update'
  100.     alias upgrade='sudo apt-get -u upgrade'
  101.     alias agi='sudo apt-get install'
  102.     alias agu='sudo apt-get update'
  103.     alias agg='sudo apt-get -u upgrade'
  104.      
  105.     # personal aliases
  106.     alias ls='ls -hF --color'    # add colors for filetype recognition
  107.     alias lx='ls -lXB'        # sort by extension
  108.     alias lk='ls -lSr'        # sort by size
  109.     alias la='ls -Al'        # show hidden files
  110.     alias lr='ls -lR'        # recursice ls
  111.     alias lt='ls -ltr'        # sort by date
  112.     alias lm='ls -al |more'        # pipe through 'more'
  113.     alias ll='ls -l'        # long listing
  114.     alias lsize='ls --sort=size -lhr' # list by size
  115.     alias lsd='ls -l | grep "^d"'   #list only directories
  116.     alias lalf='ls -alF'
  117.     alias acyl='cd ~/.icons/ACYL_Icon_Theme_0.9.3/ && bash AnyColorYouLike'
  118.     alias reboot='sudo shutdown -r now'
  119.     alias shutdown='sudo shutdown -h now'
  120.      
  121.     #Command substitution
  122.     alias h='history | grep $1'
  123.     alias rm='rm -i'
  124.     alias cp='cp -v -i'
  125.     alias mv='mv -i'
  126.     alias which='type -all'
  127.     alias ..='cd ..'
  128.      
  129.     # Creates an archive from given directory
  130.     mktar() { tar cvf  "${1%%/}.tar"     "${1%%/}/"; }
  131.     mktgz() { tar cvzf "${1%%/}.tar.gz"  "${1%%/}/"; }
  132.     mktbz() { tar cvjf "${1%%/}.tar.bz2" "${1%%/}/"; }
  133.      
  134.     ### FUNCTIONS
  135.      
  136.     # Easy extract
  137.     # uncompress depending on extension...
  138.     extract() {    
  139.       if [ -f "$1" ] ; then
  140.         case "$1" in
  141.           *.tar.bz2) tar xvjf "$1"   ;;
  142.           *.tar.gz)  tar xvzf "$1"   ;;
  143.           *.bz2)     bunzip2 "$1"    ;;
  144.           *.rar)     unrar x "$1"    ;;
  145.           *.gz)      gunzip "$1"     ;;
  146.           *.tar)     tar xvf "$1"    ;;
  147.           *.tbz2)    tar xvjf "$1"   ;;
  148.           *.tgz)     tar xvzf "$1"   ;;
  149.           *.zip)     unzip "$1"      ;;
  150.           *.Z)       uncompress "$1" ;;
  151.           *.7z)      7z x "$1"       ;;
  152.           *)
  153.           echo "'$1' cannot be extracted"
  154.           return 1
  155.           ;;
  156.         esac
  157.       else
  158.         echo "'$1' is not a valid file"
  159.         return 1
  160.       fi
  161.       return 0
  162.     }
  163.      
  164.      
  165.      
  166.     # enable programmable completion features (you don't need to enable
  167.     # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  168.     # sources /etc/bash.bashrc).
  169.     if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
  170.         . /etc/bash_completion
  171.     fi
  172.      
  173.      
  174.     #------------------------------------------////
  175.     # Colors:
  176.     #------------------------------------------////
  177.     black='\e[0;30m'
  178.     blue='\e[0;34m'
  179.     green='\e[0;32m'
  180.     cyan='\e[0;36m'
  181.     red='\e[0;31m'
  182.     purple='\e[0;35m'
  183.     brown='\e[0;33m'
  184.     lightgray='\e[0;37m'
  185.     darkgray='\e[1;30m'
  186.     lightblue='\e[1;34m'
  187.     lightgreen='\e[1;32m'
  188.     lightcyan='\e[1;36m'
  189.     lightred='\e[1;31m'
  190.     lightpurple='\e[1;35m'
  191.     yellow='\e[1;33m'
  192.     white='\e[1;37m'
  193.     nc='\e[0m'
  194.      
  195.     #!/bin/bash
  196.     # Term Colors
  197.      
  198.     FGNAMES=('▐▐▐' 'L I' 'G H T' 'S T A R' '@ D A R K S P A C E ▐▐▐')
  199.     BGNAMES=('I,m Fendy si Newbi  ')
  200.      
  201.     for b in $(seq 0 0); do
  202.         if [ "$b" -gt 0 ]; then
  203.           bg=$(($b+39))
  204.         fi
  205.     #echo -en "\033[0m ${BGNAMES[$b]}"
  206.     echo
  207.         for f in $(seq 0 7); do
  208.           echo -en "\033[${bg}m\033[$(($f+30))m ${FGNAMES[$f]} "
  209.           #echo -en "\033[${bg}m\033[1;$(($f+30))m ${FGNAMES[$f]} "
  210.         done
  211.     echo
  212.       echo -e "\033[0m"  
  213.     done
  214.  
  215.     export PATH="$HOME/.linuxbrew/bin:$PATH"
  216.     export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
  217.     export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
  218.  
  219.     if [ -f ~/.bash_aliases ]; then
  220.       . ~/.bash_aliases
  221.     fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement