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.

153 lines
3.2 KiB

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