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.

142 lines
2.9 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. gc9l3() {
  66. gcc -Wall -std=gnu99 -g -o split_array.out split_array.c
  67. ./split_array.out 1 2 3
  68. }
  69. gc9() {
  70. gcc -Wall -std=gnu99 -g -o "${1%.*}.out" "$1" -lm
  71. }
  72. gc9r() {
  73. gc9 $1
  74. ./"${1%.*}.out"
  75. }
  76. gc9i() {
  77. gc9 $1
  78. ./"${1%.*}.out" < $2
  79. }
  80. mkex() { chmod 700 $1 ; }
  81. # apps
  82. ok() { okular $1 ; }
  83. # config
  84. alias lc="c ~/linux-config"
  85. alias vb="vi ~/.bash_aliases"
  86. alias vv="vi ~/.vimrc"
  87. alias r=". ~/.bashrc"
  88. # git
  89. # . ~/.secure
  90. alias gs="git status -u"
  91. alias gpl="git pull --rebase"
  92. alias grbc="git rebase --continue"
  93. alias gps="git push"
  94. alias vig="vi .gitignore"
  95. alias ga="git add -A *"
  96. alias gai="git add .gitignore"
  97. alias gd="git diff -w"
  98. alias gdc="git diff --cached"
  99. alias gstore="git config credential.helper store"
  100. gcm(){ git commit -m "$1" ; }
  101. alias gc="git commit"
  102. alias gl="git log"
  103. alias gsl="git shortlog"
  104. alias gst="git stash"
  105. alias gstp="git stash pop"
  106. alias gclear="git stash clear"
  107. gcho() { git checkout $1 ; }
  108. gremotes() {
  109. git remote set-url --add --push origin $1
  110. git remote set-url --add --push origin $2
  111. }
  112. # idea
  113. alias jh="echo $JAVA_HOME"
  114. alias jv="java -version"
  115. # alias idea=". ~/Desktop/idea.sh"
  116. # alias idea=". ~/usr/idea-IC-172.4343.14/bin/idea.sh"
  117. # alias jf="export JAVA_HOME=/home/kevin/usr/jdk1.8.0_151 && export PATH=$JAVA_HOME/bin:$PATH"
  118. # g(){ gvim $1 ; }
  119. # md() {
  120. # multimarkdown -f -o $1.html $1.md
  121. # if $in_lab; then
  122. # ff $1.html
  123. # fi
  124. # }
  125. rs(){ redshift -O $(($1 * 1000)) ; }
  126. alias rx="redshift -x"