Advertisement
Guest User

kex's bashrc

a guest
Jun 7th, 2014
850
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.43 KB | None | 0 0
  1. # Color codes
  2. RS="\[\033[0m\]"    # reset
  3. HC="\[\033[1m\]"    # hicolor
  4. UL="\[\033[4m\]"    # underline
  5. INV="\[\033[7m\]"   # inverse background and foreground
  6. FBLK="\[\033[30m\]" # foreground black
  7. FRED="\[\033[31m\]" # foreground red
  8. FGRN="\[\033[32m\]" # foreground green
  9. FYEL="\[\033[33m\]" # foreground yellow
  10. FBLE="\[\033[34m\]" # foreground blue
  11. FMAG="\[\033[35m\]" # foreground magenta
  12. FCYN="\[\033[36m\]" # foreground cyan
  13. FWHT="\[\033[37m\]" # foreground white
  14. BBLK="\[\033[40m\]" # background black
  15. BRED="\[\033[41m\]" # background red
  16. BGRN="\[\033[42m\]" # background green
  17. BYEL="\[\033[43m\]" # background yellow
  18. BBLE="\[\033[44m\]" # background blue
  19. BMAG="\[\033[45m\]" # background magenta
  20. BCYN="\[\033[46m\]" # background cyan
  21. BWHT="\[\033[47m\]" # background white
  22.  
  23. # Prompt
  24. #PS1="$HC$FBLK[$FBLE\u$FBLK]$FBLK$FBLK[$FBLE\w$FBLK]\$$FBLK$RS "
  25. PS1="$HC$FBLK┌─╼$FBLK[$FBLE\u$FBLK]$FBLK╾─╼$FBLK[$FBLE\w$FBLK]$FBLK\n└─╼$RS "
  26.  
  27. # Don't put duplicate lines in the history and don't overwrite GNU Midnight Commander's setting of `ignorespace'.
  28. HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups
  29.  
  30. # ... or force ignoredups and ignorespace
  31. HISTCONTROL=ignoreboth
  32.  
  33. # append to the history file, don't overwrite it
  34. shopt -s histappend
  35.  
  36. # check the window size after each command and, if necessary, update the values of LINES and COLUMNS.
  37. shopt -s checkwinsize
  38.  
  39. # Colored ManPages:
  40. export LESS_TERMCAP_mb=$'\E[01;31m'
  41. export LESS_TERMCAP_md=$'\E[01;31m'
  42. export LESS_TERMCAP_me=$'\E[0m'
  43. export LESS_TERMCAP_se=$'\E[0m'
  44. export LESS_TERMCAP_so=$'\E[01;44;33m'
  45. export LESS_TERMCAP_ue=$'\E[0m'
  46. export LESS_TERMCAP_us=$'\E[01;32m'
  47.  
  48. # ALIASES
  49.  
  50. # for shutdown and restart
  51. alias sd="sudo shutdown -h now"
  52. alias sd1="sleep 1h && sudo shutdown -h now"
  53. alias rs="sudo shutdown -r now"
  54.  
  55. # for scrot
  56. alias snap='scrot -cd 5 -q 100'
  57.  
  58. # for ls
  59. alias ls='ls --color=auto'
  60. alias ll='ls -l'
  61.  
  62. # for extracting archives
  63. extract () {
  64.    if [ -f $1 ] ; then
  65.        case $1 in
  66.     *.tar.bz3)  mkdir ${1%.tar.bz2} && mv $1 ${1%.tar.bz2} && cd ${1%.tar.bz2} && tar xvjf $1;;
  67.         *.tar.gz)       mkdir ${1%.tar.gz} && mv $1 ${1%.tar.gz} && cd ${1%.tar.gz} && tar xvzf $1;;
  68.         *.tar.xz)       mkdir ${1%.tar.xz} && mv $1 ${1%.tar.xz} && cd ${1%.tar.xz} && tar Jxvf $1;;
  69.         *.bz2)          mkdir ${1%.bz2} && mv $1 ${1%.bz2} && cd ${1%.bz2} && bunzip2 $1;;
  70.         *.rar)          mkdir ${1%.rar} && mv $1 ${1%.rar} && cd ${1%.rar} && unrar x $1;;
  71.         *.gz)           mkdir ${1%.gz} && mv $1 ${1%.gz} && cd ${1%.gz} && gunzip $1;;
  72.         *.tar)          mkdir ${1%.tar} && mv $1 ${1%.tar} && cd ${1%.tar} && tar xvf $1;;
  73.         *.tbz2)         mkdir ${1%.tbz2} && mv $1 ${1%.tbz2} && cd ${1%.tbz2} && tar xvjf $1;;
  74.         *.tgz)          mkdir ${1%.tgz} && mv $1 ${1%.tgz} && cd ${1%.tgz} && tar xvzf $1;;
  75.     *.zip)          mkdir ${1%.zip} && mv $1 ${1%.zip} && cd ${1%.zip} && unzip $1;;
  76.         *.Z)            mkdir ${1%.Z} && mv $1 ${1%.Z} && cd ${1%.Z} && uncompress $1;;
  77.         *.7z)           mkdir ${1%.7z} && mv $1 ${1%.7z} && cd ${1%.7z} && 7z x $1;;
  78.         *)              echo "don't know how to extract '$1'..." ;;
  79.        esac
  80.    else
  81.        echo "'$1' is not a valid file!"
  82.    fi
  83.  }
  84.  
  85. # for pacman
  86. #alias update="sudo pacman -Sy --color always"
  87. #alias upgrade="sudo pacman -Su --color always"
  88. #alias install="sudo pacman -S --color always"
  89. #alias remove="sudo pacman -R --color always"
  90. #alias search="pacman -Ss --color always"
  91.  
  92. # for apt-get
  93. alias update='sudo apt-get update'
  94. alias upgrade='sudo apt-get upgrade'
  95. alias dist-upgrade='sudo apt-get dist-upgrade'
  96. alias install='sudo apt-get install'
  97. alias search='aptitude search'
  98. alias remove='sudo apt-get remove'
  99. alias purge='sudo apt-get purge'
  100. alias autoremove='sudo apt-get autoremove'
  101.  
  102. # for config files
  103. alias bspwmcfg='vim ~/.config/bspwm/bspwmrc'
  104. alias sxhkdcfg='vim ~/.config/sxhkd/sxhkdrc'
  105. alias obcfg='vim ~/.config/openbox/rc.xml'
  106. alias obmenucfg='vim ~/.config/openbox/menu.xml'
  107. alias autostartcfg='vim ~/.config/openbox/autostart'
  108. alias tintcfg='vim ~/.config/tint2/tint2rc'
  109. alias vimcfg='vim ~/.vimrc'
  110. alias bashcfg='vim ~/.bashrc'
  111. alias tmuxcfg='vim ~/.tmux.conf'
  112. alias resourcecfg='vim ~/.Xresources'
  113. alias comptoncfg='vim ~/.compton.conf'
  114.  
  115. # for phone mounting (android)
  116. alias android-connect='mtpfs -o allow_other /mnt/phone'
  117. alias android-disconnect='fusermount -u /mnt/phone'
  118.  
  119. # for tmux attaching
  120. alias ta='tmux attach'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement