Dotfiles for my tiling window manager + terminal workflow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
3.6 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. in_lab=false
  2. cd_school="d ~/Documents/School";
  3. if [ -d "/h/u3/c7/" ]; then
  4. TERM=xterm-256color
  5. xmodmap -e "clear Lock"
  6. in_lab=true
  7. cd_school="d ~";
  8. fi
  9. # system
  10. alias l='ls -a'
  11. alias ll='ls -alF'
  12. alias cs='printf "\033c"'
  13. shopt -s dotglob
  14. alias reb="sudo shutdown -r 0"
  15. alias sd="sudo shutdown 0"
  16. alias s="systemctl suspend"
  17. alias hst="history"
  18. # directories
  19. # unalias c
  20. d() { cd "$@" && ls -a ; }
  21. cd_up() { d $(printf "%0.s../" $(seq 1 $1 )) ; }
  22. alias "c."="cd_up"
  23. alias cdd="d ~/Downloads"
  24. alias dsnip="d ~/.vim/plugged/vim-snippets/UltiSnips/"
  25. alias csnip="d ~/.vim/UltiSnips/"
  26. vdsnip() { vi ~/.vim/plugged/vim-snippets/UltiSnips/"$1".snippets ; }
  27. vsnip() { vi ~/.vim/UltiSnips/"$1".snippets ; }
  28. if $in_lab; then
  29. ff() { firefox $1 ; }
  30. zip() { tar -zcvf $1.tar.gz $1/ ; }
  31. alias nau="nautilus ."
  32. else
  33. rt() {
  34. output="HDMI-0"
  35. if [ "$1" = "s" ]
  36. # if [ "${1:0:1}" = "s" ]
  37. then
  38. output="DVI-I-1"
  39. fi
  40. dir="normal"
  41. if [ "$2" = "r" ]
  42. # if [ "${1:1:2}" = "r" ]
  43. then
  44. dir="right"
  45. fi
  46. if [ "$2" = "l" ]
  47. then
  48. dir="left"
  49. fi
  50. # echo "xrandr --output \"$output\" --rotate \"$dir\""
  51. xrandr --output "$output" --rotate "$dir"
  52. }
  53. alias ow7="virtualbox startvm W7"
  54. # alias ow7="VBoxManage startvm W7 --type headless"
  55. chr() { google-chrome $1 ; }
  56. alias nem="nemo ."
  57. alias spt="speedtest"
  58. alias pg="ping -c 5 google.ca"
  59. alias mt="ok ~/Documents/School/136/calc-textbook.pdf"
  60. alias 36t="ok ~/Documents/School/236/236-textbook.pdf"
  61. alias rcg="d ~/Documents/coding/random-color-generator"
  62. alias dcr="d ~/Documents/coding/dcr-logger"
  63. fi
  64. # school
  65. alias sch="$cd_school"
  66. alias 136="$cd_school/136"
  67. alias 236="$cd_school/236"
  68. alias pr2="$cd_school/136/par/2"
  69. alias psy="$cd_school/psy"
  70. # 209
  71. alias ll="ls -l"
  72. alias 209="$cd_school/209"
  73. alias 9r="$cd_school/209/mokkar"
  74. alias l3="$cd_school/209/mokkar/lab3"
  75. alias a1="$cd_school/209/mokkar/a1"
  76. # alias cdf="ssh -t mokkar@cdf.utoronto.ca '. ./.bashrc; bash -l'"
  77. alias cdf="echo \". ./.bashrc\"&& ssh mokkar@cdf.utoronto.ca"
  78. ca12() {
  79. gcc -Wall -std=gnu99 -g -o validate_sin.out validate_sin.c sin_helpers.c
  80. ./validate_sin.out 810620716
  81. }
  82. ca1() {
  83. gcc -Wall -std=gnu99 -g -o count_large.out count_large.c
  84. # ll | ./count_large.out 4000
  85. ./count_large.out 0 rw------- < ll.txt
  86. }
  87. cl3() {
  88. gcc -Wall -std=gnu99 -g -o split_array.out split_array.c
  89. ./split_array.out 1 2 3
  90. }
  91. c9() {
  92. gcc -Wall -std=gnu99 -g -o "${1%.*}.out" "$1" -lm
  93. }
  94. c9r() {
  95. gc9 $1
  96. ./"${1%.*}.out"
  97. }
  98. c9i() {
  99. gc9 $1
  100. ./"${1%.*}.out" < $2
  101. }
  102. mkex() { chmod 700 $1 ; }
  103. # apps
  104. ok() { okular $1 ; }
  105. # config
  106. alias lc="d ~/linux-config"
  107. alias vb="vi ~/.bash_aliases"
  108. alias vv="vi ~/.vimrc"
  109. alias r=". ~/.bashrc"
  110. # git
  111. # . ~/.secure
  112. alias gs="git status -u"
  113. alias gpl="git pull --rebase"
  114. alias grbc="git rebase --continue"
  115. alias gps="git push"
  116. alias vig="vi .gitignore"
  117. alias ga="git add -A *"
  118. alias gai="git add .gitignore"
  119. alias gd="git diff -w"
  120. alias gdc="git diff --cached"
  121. alias gstore="git config credential.helper store"
  122. gcm(){ git commit -m "$1" ; }
  123. alias gc="git commit"
  124. alias gl="git log"
  125. alias gsl="git shortlog"
  126. alias gst="git stash"
  127. alias gstp="git stash pop"
  128. alias gclear="git stash clear"
  129. gcho() { git checkout $1 ; }
  130. gremotes() {
  131. git remote set-url --add --push origin $1
  132. git remote set-url --add --push origin $2
  133. }
  134. # idea
  135. alias jh="echo $JAVA_HOME"
  136. alias jv="java -version"
  137. # alias idea=". ~/Desktop/idea.sh"
  138. # alias idea=". ~/usr/idea-IC-172.4343.14/bin/idea.sh"
  139. # alias jf="export JAVA_HOME=/home/kevin/usr/jdk1.8.0_151 && export PATH=$JAVA_HOME/bin:$PATH"
  140. # g(){ gvim $1 ; }
  141. # md() {
  142. # multimarkdown -f -o $1.html $1.md
  143. # if $in_lab; then
  144. # ff $1.html
  145. # fi
  146. # }
  147. rs(){ redshift -O $(($1 * 1000)) ; }
  148. alias rx="redshift -x"