Add profile and mrconfig files.

This commit is contained in:
Jeremy Gardais 2017-08-01 17:07:49 +02:00
commit 4e6d09e8ac
2 changed files with 56 additions and 0 deletions

27
.mrconfig Normal file
View File

@ -0,0 +1,27 @@
[DEFAULT]
git_gc = git gc "$@"
### {{{ User config
[$HOME/repos/gardouille.vim]
checkout = git clone 'https://git.101010.fr/gardouille-dotfiles/vim.git' 'gardouille.vim'
update = git pull 'https://git.101010.fr/gardouille-dotfiles/vim.git'
[$HOME/repos/101010.zsh]
checkout = git clone 'https://git.101010.fr/gardouille-dotfiles/zsh.git' '101010.zsh'
update = git pull 'https://git.101010.fr/gardouille-dotfiles/zsh.git'
[$HOME/repos/gardouille.tmux]
checkout = git clone 'https://git.101010.fr/gardouille-dotfiles/tmux.git' 'gardouille.tmux'
update = git pull 'https://git.101010.fr/gardouille-dotfiles/tmux.git'
[$HOME/repos/gardouille.scripts]
checkout = git clone 'https://git.101010.fr/gardouille-dotfiles/scripts.git' 'gardouille.scripts'
update = git pull 'https://git.101010.fr/gardouille-dotfiles/scripts.git'
### }}}
### {{{ IPR repo
[$HOME/repos/ipr.scripts]
checkout = git clone 'https://git.ipr.univ-rennes1.fr/cellinfo/scripts.git' 'ipr.scripts'
### }}}

29
.profile Normal file
View File

@ -0,0 +1,29 @@
REPO_PATH="${HOME}/repos"
[ -d "${REPO_PATH}" ] && mkdir -p "${REPO_PATH}"
# If mr and .mrconfig file are available and no mr command was already launch (eg: .tmux directory unavailable)
if [ $(command -v mr) ] && [ -f "${HOME}"/.mrconfig ] && [ ! -L "${HOME}"/.tmux ]; then
mr checkout
fi
# Tmux
[ -d "${REPO_PATH}"/gardouille.tmux ] && [ ! -L "${HOME}"/.tmux ] && rm -f "${HOME}"/.tmux && ln -s "${REPO_PATH}"/gardouille.tmux "${HOME}"/.tmux
[ -L "${HOME}"/.tmux ] && [ ! -L "${HOME}"/.tmux.conf ] && rm -f "${HOME}"/.tmux.conf && ln -s "${HOME}"/.tmux/tmux.conf "${HOME}"/.tmux.conf
# Vim
[ -d "${REPO_PATH}"/gardouille.vim ] && [ ! -L "${HOME}"/.vim ] && rm -f "${HOME}"/.vim && ln -s "${REPO_PATH}"/gardouille.vim "${HOME}"/.vim
[ -L "${HOME}"/.vim ] && [ ! -L "${HOME}"/.vimrc ] && rm -f "${HOME}"/.vimrc && ln -s "${HOME}"/.vim/vimrc "${HOME}"/.vimrc
# Zsh
[ -d "${REPO_PATH}"/101010.zsh ] && [ ! -L "${HOME}"/.zsh ] && rm -rf .zsh/ && ln -s "${REPO_PATH}"/101010.zsh "${HOME}"/.zsh
[ -L "${HOME}"/.zsh ] && [ ! -L "${HOME}"/.zshrc ] && rm -f .zshrc && ln -s "${HOME}"/.zsh/zshrc "${HOME}"/.zshrc
# bin
[ -d "${REPO_PATH}"/gardouille.scripts ] && [ ! -L "${HOME}"/bin ] && rm -rf "${HOME}"/bin && ln -s "${REPO_PATH}"/gardouille.scripts "${HOME}"/bin
# If ZSH is available
if [ $(command -v zsh) ]; then
exec zsh
fi