From 6f3aecd02854889c57060baad44b36c0229afec0 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Sat, 28 Oct 2017 01:25:12 -0400 Subject: [PATCH] bash files can detect whether in lab or not. --- dotfiles/.bash_aliases | 33 +++++++++++++++++++++++++-------- dotfiles/.bashrc | 8 +++++--- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/dotfiles/.bash_aliases b/dotfiles/.bash_aliases index 8155276..3f78c19 100644 --- a/dotfiles/.bash_aliases +++ b/dotfiles/.bash_aliases @@ -1,3 +1,8 @@ +in_lab=false +if [ -d "/h/u3/c7/" ]; then + in_lab=true +fi + # system alias c="clear" shopt -s dotglob @@ -8,18 +13,30 @@ alias s="systemctl suspend" # directories alias cdr="cd ~/../../" alias cdd="cd ~/Downloads" -alias a2="cd ~/Documents/School/207/mokkar/a2" -alias a2n="a2 && vi notes.txt" -alias rcg="cd ~/Documents/coding/random-color-generator" - # 221 - alias 221="cd ~/Documents/School/221" - alias mt="okular ~/Documents/School/221/Textbook.pdf" - alias mlt="okular ~/Downloads/Textbook.pdf" - # 258 (lab) +if $in_lab; then + alias mt="okular ~/Downloads/Textbook.pdf" + + # 207 + alias a2="cd ~/207/mokkar/a2" + alias a2n="a2 && vi notes.txt" + + # 258 alias p2="cd ~/258/258-labs-self/l5/p2" alias l5="cd ~/258/258-labs-self/l5" alias lab="cd ~/258/258-labs-self" +else + alias mt="okular ~/Documents/School/221/Textbook.pdf" + alias rcg="cd ~/Documents/coding/random-color-generator" + + # 207 + alias a2="cd ~/Documents/School/207/mokkar/a2" + alias a2n="a2 && vi notes.txt" + + # 221 + alias 221="cd ~/Documents/School/221" +fi + # config alias lc="cd ~/linux-config" alias vb="vi ~/.bash_aliases" diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index a874e5d..03165c1 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -127,10 +127,12 @@ bind "TAB:menu-complete" bind "set show-all-if-ambiguous on" bind "set menu-complete-display-prefix on" -DIR_LAB="/h/u3/c7/05/mokkar/.bash_it" -DIR_HOME="/home/kevin/.bash_it" +DIR_BASH_IT="/home/kevin/.bash_it" +if [ -d "/h/u3/c7/" ]; then + DIR_BASH_IT="/h/u3/c7/05/mokkar/.bash_it" +fi # Path to the bash it configuration -export BASH_IT="$DIR_HOME" +export BASH_IT="$DIR_BASH_IT" # Lock and Load a custom theme file # location /.bash_it/themes/