new environment setup
This commit is contained in:
parent
c81f237993
commit
c4ed1fb8d8
2
bash/rc
2
bash/rc
@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
source "$HOME/.my_bash_env"
|
source "$HOME/.wryn/env/env.bash"
|
||||||
|
|
||||||
RC_DIR="$DOTWRYN/bash"
|
RC_DIR="$DOTWRYN/bash"
|
||||||
|
|
||||||
|
15
env/env.bash
vendored
Executable file
15
env/env.bash
vendored
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Default bash environment
|
||||||
|
RD_PATH="$HOME/RentDynamics"
|
||||||
|
SCHOOL_DIR="$HOME/School"
|
||||||
|
DOTWRYN="$HOME/.wryn"
|
||||||
|
|
||||||
|
|
||||||
|
LOCAL_OVERRIDES="$HOME/.config/wryn/env.bash"
|
||||||
|
[ -f "$LOCAL_OVERRIDES" ] \
|
||||||
|
&& source "$LOCAL_OVERRIDES" \
|
||||||
|
|| {
|
||||||
|
touch $LOCAL_OVERRIDES \
|
||||||
|
&& echo '#!/bin/bash' > $LOCAL_OVERRIDES \
|
||||||
|
&& echo '# Local overrides of .wryn environment variables' >> $LOCAL_OVERRIDES
|
||||||
|
}
|
10
env/env.sh
vendored
Executable file
10
env/env.sh
vendored
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Default shell environment
|
||||||
|
LOCAL_OVERRIDES="$HOME/.config/wryn/env.sh"
|
||||||
|
[ -f "$LOCAL_OVERRIDES" ] \
|
||||||
|
&& source "$LOCAL_OVERRIDES" \
|
||||||
|
|| {
|
||||||
|
touch $LOCAL_OVERRIDES \
|
||||||
|
&& echo '#!/bin/sh' > $LOCAL_OVERRIDES \
|
||||||
|
&& echo '# Local overrides of .wryn environment variables '>> $LOCAL_OVERRIDES
|
||||||
|
}
|
8
env/env.vim
vendored
Normal file
8
env/env.vim
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
let $RC_DIR=expand("$HOME/.wryn")
|
||||||
|
let $VIM_DIR=expand("$RC_DIR/vim")
|
||||||
|
let $WRYNVIMRC=expand("$VIM_DIR/rc.vim")
|
||||||
|
let $WRYNBASH=expand("$RC_DIR/bashrc")
|
||||||
|
let $MYBASHRC=expand("$HOME/.bashrc")
|
||||||
|
|
||||||
|
" Local environment and environment overrides
|
||||||
|
source $HOME/.config/wryn/env.vim
|
14
env/env.zsh
vendored
Executable file
14
env/env.zsh
vendored
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
# Default zsh environment
|
||||||
|
RD_PATH="$HOME/RentDynamics"
|
||||||
|
SCHOOL_DIR="$HOME/School"
|
||||||
|
DOTWRYN="$HOME/.wryn"
|
||||||
|
|
||||||
|
LOCAL_OVERRIDES="$HOME/.config/wryn/env.zsh"
|
||||||
|
[ -f "$LOCAL_OVERRIDES" ] \
|
||||||
|
&& source "$LOCAL_OVERRIDES" \
|
||||||
|
|| {
|
||||||
|
touch $LOCAL_OVERRIDES \
|
||||||
|
&& echo '#!/bin/zsh' > $LOCAL_OVERRIDES \
|
||||||
|
&& echo '# Local overrides of .wryn environment variables '>> $LOCAL_OVERRIDES
|
||||||
|
}
|
60
setup
60
setup
@ -1,54 +1,38 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
RC_DIR='$HOME/.wryn'
|
|
||||||
|
|
||||||
[ ! -f "$HOME/.bashrc" ] && touch "$HOME/.bashrc";
|
[ ! -f "$HOME/.bashrc" ] && touch "$HOME/.bashrc";
|
||||||
[ ! -f "$HOME/.vimrc" ] && touch "$HOME/.vimrc";
|
[ ! -f "$HOME/.vimrc" ] && touch "$HOME/.vimrc";
|
||||||
|
|
||||||
|
[ ! -d "$HOME/.config" ] && mkdir "$HOME/.config";
|
||||||
|
[ ! -d "$HOME/.config/wryn" ] && mkdir "$HOME/.config/wryn";
|
||||||
|
|
||||||
|
# Source RCs
|
||||||
grep '.wryn' $HOME/.bashrc >/dev/null 2>/dev/null \
|
grep '.wryn' $HOME/.bashrc >/dev/null 2>/dev/null \
|
||||||
&& echo already set up bash rc \
|
&& echo already set up bash rc \
|
||||||
|| echo source $RC_DIR/bash/rc >> $HOME/.bashrc;
|
|| echo source $HOME/.wryn/bash/rc >> $HOME/.bashrc;
|
||||||
|
|
||||||
grep '.wryn' $HOME/.vimrc >/dev/null 2>/dev/null \
|
grep '.wryn' $HOME/.vimrc >/dev/null 2>/dev/null \
|
||||||
&& echo already set up vim rc \
|
&& echo already set up vim rc \
|
||||||
|| echo source $RC_DIR/vim/rc.vim >> $HOME/.vimrc;
|
|| echo source $HOME/.wryn/vim/rc.vim >> $HOME/.vimrc;
|
||||||
|
|
||||||
grep '.wryn' $HOME/.zshrc >/dev/null 2>/dev/null \
|
grep '.wryn' $HOME/.zshrc >/dev/null 2>/dev/null \
|
||||||
&& echo already set up zsh rc \
|
&& echo already set up zsh rc \
|
||||||
|| echo source $RC_DIR/zsh/rc >> $HOME/.zshrc;
|
|| echo source $HOME/.wryn/zsh/rc >> $HOME/.zshrc;
|
||||||
|
|
||||||
LOCAL_DIR_SETUP="$HOME/.my_bash_env"
|
|
||||||
if [ ! -f "$LOCAL_DIR_SETUP" ]; then
|
|
||||||
touch "$LOCAL_DIR_SETUP";
|
|
||||||
echo '#!/bin/bash' >> $LOCAL_DIR_SETUP
|
|
||||||
echo 'RD_PATH="$HOME/RentDynamics";' >> $LOCAL_DIR_SETUP
|
|
||||||
echo 'SCHOOL_DIR="$HOME/School";' >> $LOCAL_DIR_SETUP
|
|
||||||
echo 'DOTWRYN="$HOME/.wryn";' >> $LOCAL_DIR_SETUP
|
|
||||||
else
|
|
||||||
echo 'bash environment variables already set up'
|
|
||||||
fi
|
|
||||||
|
|
||||||
LOCAL_ZSH_SETUP="$HOME/.my_zsh_env"
|
|
||||||
if [ ! -f "$LOCAL_ZSH_SETUP" ]; then
|
|
||||||
touch "$LOCAL_ZSH_SETUP";
|
|
||||||
echo '#!/bin/zsh' >> $LOCAL_ZSH_SETUP
|
|
||||||
echo 'RD_PATH="$HOME/RentDynamics";' >> $LOCAL_ZSH_SETUP
|
|
||||||
echo 'SCHOOL_ZSH="$HOME/School";' >> $LOCAL_ZSH_SETUP
|
|
||||||
echo 'DOTWRYN="$HOME/.wryn";' >> $LOCAL_ZSH_SETUP
|
|
||||||
else
|
|
||||||
echo 'zsh environment already set up';
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_VIM_SETUP="$HOME/.my_vim_env"
|
# setup local environments
|
||||||
if [ ! -f "$LOCAL_VIM_SETUP" ]; then
|
which sh >/dev/null && "$HOME/.wryn/env/env.sh";
|
||||||
touch "$LOCAL_VIM_SETUP";
|
which bash >/dev/null && "$HOME/.wryn/env/env.bash";
|
||||||
echo 'let $RC_DIR=expand("$HOME/.wryn")' >> $LOCAL_VIM_SETUP
|
which zsh >/dev/null && "$HOME/.wryn/env/env.zsh";
|
||||||
echo 'let $VIM_DIR=expand("$RC_DIR/vim")' >> $LOCAL_VIM_SETUP
|
|
||||||
echo 'let $WRYNVIMRC=expand("$VIM_DIR/rc.vim")' >> $LOCAL_VIM_SETUP
|
LOCAL_VIM_ENV="$HOME/.config/wryn/env.vim"
|
||||||
echo 'let $WRYNBASH=expand("$RC_DIR/bashrc")' >> $LOCAL_VIM_SETUP
|
[ ! -f "$LOCAL_VIM_ENV" ] \
|
||||||
echo 'let $MYBASHRC=expand("$HOME/.bashrc")' >> $LOCAL_VIM_SETUP
|
&& {
|
||||||
echo 'let $WEBBROWSER="' $(which google-chrome-stable) '"' >> $LOCAL_VIM_SETUP
|
touch "$LOCAL_VIM_ENV";
|
||||||
else
|
which google-chrome-stable \
|
||||||
|
&& echo 'let $WEBBROWSER="'$(which google-chrome-stable)'"' >> $LOCAL_VIM_ENV\
|
||||||
|
|| echo 'let $WEBBROWSER=""' >> $LOCAL_VIM_ENV;
|
||||||
|
|
||||||
|
} || {
|
||||||
echo 'vim environment variables already set up'
|
echo 'vim environment variables already set up'
|
||||||
fi
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
" -- Environment Variables --------------------------------------- {{{
|
" -- Environment Variables --------------------------------------- {{{
|
||||||
source $HOME/.my_vim_env
|
source $HOME/.wryn/env/env.vim
|
||||||
"sets the following variables:
|
"sets the following variables:
|
||||||
"$RC_DIR $VIM_DIR $WRYNVIMRC $WRYNBASH $MYBASHRC $WEBBROWSER
|
"$RC_DIR $VIM_DIR $WRYNVIMRC $WRYNBASH $MYBASHRC $WEBBROWSER
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user