From 4e6d09e8acf934f184667c57dfc65a56413d224b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Tue, 1 Aug 2017 17:07:49 +0200 Subject: [PATCH] Add profile and mrconfig files. --- .mrconfig | 27 +++++++++++++++++++++++++++ .profile | 29 +++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .mrconfig create mode 100644 .profile diff --git a/.mrconfig b/.mrconfig new file mode 100644 index 0000000..e069938 --- /dev/null +++ b/.mrconfig @@ -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' + +### }}} diff --git a/.profile b/.profile new file mode 100644 index 0000000..fcd8305 --- /dev/null +++ b/.profile @@ -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