Advertisement
Guest User

Untitled

a guest
Apr 11th, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. #
  2. # ~/.bashrc
  3. #
  4.  
  5. # If not running interactively, don't do anything
  6. [[ $- != *i* ]] && return
  7.  
  8. PS1='[\u@\h \W]\$ '
  9.  
  10. export HISTSIZE=50000
  11. shopt -s histappend
  12.  
  13. export EDITOR="vim"
  14. export BROWSER="chromium"
  15. export WINEARCH="win32"
  16. PATH=$PATH:/usr/local/Elm-Platform/0.13/.cabal-sandbox/bin
  17. PATH=$PATH:/home/pieter/bin
  18. export PATH
  19. export XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0"
  20. export LIBVA_DRIVER_NAME=vdpau
  21. export _JAVA_AWT_WM_NONrePARENTING=1
  22.  
  23. # fix QTGTK
  24. export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
  25.  
  26. #--------------------------------------------------
  27. # aliases
  28. #--------------------------------------------------
  29.  
  30. alias ls='ls --color=auto'
  31. alias unmute='amixer -c 0 set Headphone 100% unmute'
  32. alias syu="yaourt -Syu && yaourt -Syua --noconfirm"
  33. alias df="df -h"
  34. alias ls="ls -F --color=auto"
  35. alias grep="grep --color=auto"
  36. alias next="binge.py"
  37. alias hon="hdmi-on"
  38. alias hoff="hdmi-off"
  39.  
  40. alias sudo="sudo "
  41. alias off="systemctl poweroff"
  42. alias hib="systemctl hibernate"
  43. alias reb="systemctl reboot"
  44.  
  45. alias b="cd ~/bin"
  46. alias t="cd /mnt/data/Torrent\ Downloads"
  47. alias m="cd ~/Dropbox/Public/KUL/masterjaar"
  48. alias th="cd ~/Dropbox/thesis"
  49. alias h="cd ~"
  50. alias d="cd ~/Downloads"
  51. alias g="gvim "
  52. alias mountnet="sudo mount -t cifs //192.168.1.104/netwerkschijf /mnt/netwerkschijf -o user=admin,password=vanZet8"
  53.  
  54. # vi mode in bash
  55. set -o vi
  56.  
  57. # enable history completion
  58. bind '"\e[A": history-search-backward'
  59. bind '"\e[B": history-search-forward'
  60.  
  61. # add to cd path CDPATH=".:~/Dropbox"
  62. # sudo auto complete
  63. complete -cf sudo
  64.  
  65. #--------------------------------------------------
  66. # functions
  67. #--------------------------------------------------
  68.  
  69. extr () {
  70. if [ -f $1 ] ; then
  71. case $1 in
  72. *.tar.bz2) tar xjf $1 ;;
  73. *.tar.gz) tar xzf $1 ;;
  74. *.bz2) bunzip2 $1 ;;
  75. *.rar) rar x $1 ;;
  76. *.gz) gunzip $1 ;;
  77. *.tar) tar xf $1 ;;
  78. *.tbz2) tar xjf $1 ;;
  79. *.tgz) tar xzf $1 ;;
  80. *.zip) unzip $1 ;;
  81. *.Z) uncompress $1 ;;
  82. *.7z) 7z x $1 ;;
  83. *) echo "'$1' cannot be extracted via extr()" ;;
  84. esac
  85. else
  86. echo "'$1' is not a valid file"
  87. fi
  88. }
  89.  
  90. timesleep() {
  91. sudo rtcwake -m mem -t $(date --date="$@" +%s)
  92. }
  93.  
  94. pu() {
  95. dropbox puburl "$@" | xsel
  96. }
  97.  
  98. cd() {
  99. builtin cd "$@" && ls
  100. }
  101.  
  102. copy() {
  103. cp -r "$@" ~/.drag
  104. }
  105.  
  106. cut() {
  107. mv "$@" ~/.drag
  108. }
  109.  
  110. paste() {
  111. mv ~/.drag/* ./
  112. }
  113.  
  114. launch() {
  115. nohup "$@" > /dev/null 2>&1&
  116. }
  117.  
  118. pdf() {
  119. zathura "$1" &
  120. }
  121.  
  122. function subs {
  123. subberthehut -fns "$1"
  124. }
  125.  
  126. function subsp {
  127. if [ -z "$1" ]; then
  128. file=$(find *.mkv)
  129. if [ -z "$file" ]; then
  130. file=$(find *.mp4)
  131. if [ -z "$file" ]; then
  132. file=$(find *.avi)
  133. fi
  134. fi
  135. subberthehut -fns "$file" && smplayer "$file" -fullscreen &
  136. else
  137. subberthehut -fns "$1" && smplayer "$1" -fullscreen &
  138. fi
  139. }
  140.  
  141. function play {
  142. if [ -z "$1" ]; then
  143. file=$(find *.mkv)
  144. if [ -z "$file" ]; then
  145. file=$(find *.mp4)
  146. if [ -z "$file" ]; then
  147. file=$(find *.avi)
  148. fi
  149. fi
  150. smplayer "$file" -fullscreen &
  151. else
  152. smplayer "$1" -fullscreen &
  153. fi
  154. }
  155.  
  156. function list-installed {
  157. pacman -Qei $(pacman -Qu|cut -d" " -f 1)|awk ' BEGIN {FS=":"}/^Name/{printf("\033[1;36m%s\033[1;37m", $2)}/^Description/{print $2}'
  158. }
  159. ls
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement