1
0
Fork 0
mirror of https://github.com/hcartiaux/dotfiles.git synced 2024-10-18 09:15:24 +02:00
dotfiles/install.sh

125 lines
3.1 KiB
Bash
Raw Normal View History

2013-05-03 01:52:02 +02:00
#!/usr/bin/env bash
2013-05-02 23:53:31 +02:00
# set -x # Debug
2013-05-02 23:53:31 +02:00
MAIL='hyacinthe.cartiaux@free.fr'
PLAN='World domination!'
2013-05-02 23:59:38 +02:00
DOTFILES=~/.dotfiles
2020-08-17 14:09:23 +02:00
MYLAPTOP=hc-xps15
HOST=$(hostname -s)
2013-05-02 23:53:31 +02:00
echo $MAIL > ~/.forward
echo $PLAN > ~/.plan
2013-05-02 23:53:31 +02:00
[[ ! -d ~/.dotfiles ]] && git clone https://github.com/hcartiaux/dotfiles.git $DOTFILES
[[ -d ~/.dotfiles ]] && ( cd $DOTFILES ; git pull )
2013-05-02 23:53:31 +02:00
cd ~
## zsh
2013-05-03 00:27:15 +02:00
mkdir -p ~/.zsh
2014-03-06 01:35:27 +01:00
cd ~/.zsh
[[ ! -d ~/.zsh/zsh-syntax-highlighting ]] && git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
2023-02-06 22:20:10 +01:00
[[ -d ~/.zsh/zsh-syntax-highlighting ]] && git -C ~/.zsh/zsh-syntax-highlighting pull
2013-05-02 23:53:31 +02:00
ln -sf $DOTFILES/zsh/prompt_hyacinthe_setup ~/.zsh/prompt_hyacinthe_setup
2014-03-06 01:35:27 +01:00
ln -sf $DOTFILES/zsh/zshrc ~/.zshrc
2013-05-02 23:53:31 +02:00
## bash
ln -sf $DOTFILES/bash/bashrc ~/.bashrc
ln -sf $DOTFILES/bash/inputrc ~/.inputrc
ln -sf $DOTFILES/bash/bash_profile ~/.bash_profile
ln -sf $DOTFILES/bash/profile ~/.profile
ln -sf $DOTFILES/bash/bash_logout ~/.bash_logout
ln -sf $DOTFILES/bash/bash_environment ~/.bash_environment
ln -sf $DOTFILES/bash/bash_oar ~/.bash_oar
ln -sf $DOTFILES/bash/bash_slurm ~/.bash_slurm
ln -sf $DOTFILES/bash/bash_aliases ~/.bash_aliases
2013-05-02 23:53:31 +02:00
2013-05-03 00:22:46 +02:00
if [[ ! -f ~/.git-prompt.sh ]] ; then
curl -o ~/.git-prompt.sh \
https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
2013-05-03 00:22:46 +02:00
fi
2023-02-06 22:12:16 +01:00
# ksh
ln -sf $DOTFILES/ksh/kshrc ~/.kshrc
2015-03-06 15:32:28 +01:00
## vim
2013-05-02 23:53:31 +02:00
mkdir -p ~/.vim
2014-03-06 01:35:27 +01:00
cd ~/.vim
2015-03-06 15:32:28 +01:00
mkdir -p backup undo swap spell
2013-05-02 23:53:31 +02:00
ln -sf $DOTFILES/vim/vimrc ~/.vimrc
2013-05-03 00:43:11 +02:00
[[ ! -h ~/.vim/header ]] && ln -sf $DOTFILES/vim/header ~/.vim/header
2013-05-02 23:53:31 +02:00
2014-03-06 01:35:27 +01:00
[[ -e ~/.viminfo ]] && mv ~/.viminfo ~/.vim/
2013-05-02 23:53:31 +02:00
## tmux
2014-03-06 01:35:27 +01:00
ln -sf $DOTFILES/tmux/tmux.conf ~/.tmux.conf
2013-05-02 23:53:31 +02:00
## screen
2014-03-06 01:35:27 +01:00
ln -sf $DOTFILES/screen/screenrc ~/.screenrc
2013-05-02 23:53:31 +02:00
## rtorrent
ln -sf $DOTFILES/rtorrent/rtorrent.rc ~/.rtorrent.rc
mkdir -p ~/.rtorrent
2013-05-02 23:53:31 +02:00
## git
2020-05-08 17:47:44 +02:00
ln -sf $DOTFILES/git/gitconfig ~/.gitconfig
ln -sf $DOTFILES/git/gitconfig-work ~/.gitconfig-work
ln -sf $DOTFILES/git/gitconfig-personal ~/.gitconfig-personal
2013-05-02 23:53:31 +02:00
## ssh
2014-03-06 01:35:27 +01:00
mkdir -p ~/.ssh/sockets
ln -sf $DOTFILES/ssh/sshpubkey ~/.ssh/sshpubkey
cat $DOTFILES/ssh/config.* > ~/.ssh/config.perso
cat $DOTFILES/ssh/config{,.g5k} > ~/.ssh/config_g5k
2014-03-06 01:35:27 +01:00
[[ ! -f ~/.ssh/config ]] && (
cat $DOTFILES/ssh/config{,.*} > ~/.ssh/config
2014-03-06 01:35:27 +01:00
)
2013-08-21 15:18:56 +02:00
## wget
ln -sf $DOTFILES/wget/wgetrc ~/.wgetrc
# GnuPG
2017-11-02 18:13:34 +01:00
mkdir -p ~/.gnupg
ln -sf $DOTFILES/gnupg/gpg.conf ~/.gnupg/gpg.conf
ln -sf $DOTFILES/gnupg/gpg-agent.conf ~/.gnupg/gpg-agent.conf
[[ "$HOST" = "$MYLAPTOP" ]] && (
2020-05-13 18:18:53 +02:00
## direnv / pyenv configuration
mkdir -p ~/.config/direnv/
ln -sf $DOTFILES/direnv/direnvrc ~/.config/direnv/direnvrc
ln -sf $DOTFILES/direnv/envrc ~/.config/direnv/envrc
ln -sf $DOTFILES/direnv/init.sh ~/.config/direnv/init.sh
2020-05-13 19:30:57 +02:00
mkdir -p ~/.config/pyenv/
ln -sf $DOTFILES/pyenv/init.sh ~/.config/pyenv/init.sh
2020-05-13 18:18:53 +02:00
## RVM configuration
ln -sf $DOTFILES/rvm/rvmrc ~/.rvmrc
## temporary files
ln -sf /tmp ~/.adobe
ln -sf /tmp ~/.cache
ln -sf /tmp ~/.macromedia
ln -sf /tmp ~/.thumbnails
)