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.

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