From f8cb335b4f19f35d4b7f679415b98e177bad137c Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Sat, 20 Jan 2018 02:56:54 -0500 Subject: [PATCH] Combined home and lab school aliases --- dotfiles/.bash_aliases | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/dotfiles/.bash_aliases b/dotfiles/.bash_aliases index 96babcc..48e321d 100644 --- a/dotfiles/.bash_aliases +++ b/dotfiles/.bash_aliases @@ -1,8 +1,10 @@ in_lab=false +cdSchool="c ~/Documents/School"; if [ -d "/h/u3/c7/" ]; then TERM=xterm-256color xmodmap -e "clear Lock" in_lab=true + cdSchool="c ~"; fi # system @@ -16,24 +18,13 @@ alias s="systemctl suspend" # directories c() { cd "$@" && ls -a ; } -cd-up() { c $(printf "%0.s../" $(seq 1 $1 )) ; } -alias "c."="cd-up" +cd_up() { c $(printf "%0.s../" $(seq 1 $1 )) ; } +alias "c."="cd_up" alias cdd="c ~/Downloads" if $in_lab; then ff() { firefox $1 ; } zip() { tar -zcvf $1.tar.gz $1/ ; } alias nau="nautilus ." - - # 209 - alias ll="ls -l" - alias 9r="c ~/209/mokkar" - alias l2="c ~/209/mokkar/lab2" - - gcc9() { - gcc -Wall -std=gnu99 -g -o "${1%.*}.out" "$1" - ./"${1%.*}.out" - } - mkex() { chmod 700 $1 ; } else rt() { output="HDMI-0" @@ -62,16 +53,27 @@ else alias spt="speedtest" alias pg="ping -c 5 google.ca" - alias sch="c ~/Documents/School/" - alias 136="c ~/Documents/School/136" - alias mt="ok ~/Documents/School/136/calc-textbook.pdf" - alias 209="c ~/Documents/School/209" - alias psy="c ~/Documents/School/psy" - alias rcg="c ~/Documents/coding/random-color-generator" alias dcr="c ~/Documents/coding/dcr-logger" fi +# school +alias sch="$cdSchool" +alias 136="$cdSchool/136" +alias mt="ok ~/Documents/School/136/calc-textbook.pdf" +alias psy="$cdSchool/psy" + + # 209 + alias ll="ls -l" + alias 209="$cdSchool/209" + alias 9r="$cdSchool/209/mokkar" + alias l2="$cdSchool/209/mokkar/lab2" + gcc9() { + gcc -Wall -std=gnu99 -g -o "${1%.*}.out" "$1" + ./"${1%.*}.out" + } + mkex() { chmod 700 $1 ; } + # apps ok() { okular $1 ; }