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.

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