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.

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