2014-08-31 08:01:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-07-30 21:39:07 +02:00
|
|
|
SUDO=""
|
|
|
|
if [[ -z $NOSUDO ]]; then
|
2016-07-30 21:42:34 +02:00
|
|
|
SUDO="sudo"
|
2016-07-30 21:39:07 +02:00
|
|
|
fi
|
|
|
|
|
2016-07-30 21:42:34 +02:00
|
|
|
echo "using '$SUDO' as sudo"
|
|
|
|
|
2015-04-30 22:29:17 +02:00
|
|
|
set -e
|
2015-01-25 09:57:25 +01:00
|
|
|
echo
|
|
|
|
echo "configuring settings common among OSes"
|
2016-07-30 21:39:07 +02:00
|
|
|
$SUDO true
|
2015-07-19 11:23:35 +02:00
|
|
|
|
2015-01-25 09:57:25 +01:00
|
|
|
#zsh
|
2015-07-19 11:23:35 +02:00
|
|
|
if [[ -z $DONT_CHANGE_SHELL ]]; then
|
|
|
|
echo "changing shell to zsh"
|
|
|
|
chsh -s `which zsh` $USER
|
|
|
|
fi
|
2014-08-31 08:01:19 +02:00
|
|
|
|
2016-11-03 21:21:29 +01:00
|
|
|
CURL="curl -sSfL"
|
2016-06-04 08:59:40 +02:00
|
|
|
|
2016-07-30 21:08:05 +02:00
|
|
|
if [[ -z $DIR ]]; then
|
|
|
|
echo "please set DIR"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-03-28 09:10:58 +01:00
|
|
|
DIR=`realpath $DIR`
|
|
|
|
echo "using $DIR as the top level directory"
|
2014-08-31 08:01:19 +02:00
|
|
|
cd $DIR
|
2015-09-20 11:57:01 +02:00
|
|
|
git submodule update --init --recursive
|
2014-08-31 08:01:19 +02:00
|
|
|
|
2015-03-16 07:01:03 +01:00
|
|
|
#configs
|
2014-12-25 17:17:42 +01:00
|
|
|
ln -vfs "$DIR/.vim" ~/.
|
2016-09-10 13:38:42 +02:00
|
|
|
ln -vfs "$DIR/.vimrc.linux" ~/.vimrc
|
2014-12-25 17:17:42 +01:00
|
|
|
ln -vfs "$DIR/.tmux.conf" ~/.
|
2017-02-12 11:47:30 +00:00
|
|
|
ln -vfs "$DIR/.tmux.macosx" ~/.
|
2014-08-31 08:01:19 +02:00
|
|
|
rm -f "~/.zshrc"
|
2016-11-13 17:09:48 +01:00
|
|
|
ln -vfs "$DIR/.zprezto" ~/.
|
2016-11-13 19:55:32 +01:00
|
|
|
ln -vfs "$DIR/.zpreztorc" ~/.zpreztorc
|
2016-11-13 17:16:45 +01:00
|
|
|
ln -vfs "$DIR/.zprofile" ~/.zprofile
|
2016-11-13 17:09:48 +01:00
|
|
|
ln -vfs "$DIR/.zprezto/runcoms/zshenv" ~/.zshenv
|
2016-11-13 19:55:32 +01:00
|
|
|
ln -vfs "$DIR/.zshrc" ~/.zshrc
|
2017-01-26 05:44:03 +00:00
|
|
|
ln -vfs "$DIR/.hyper.js" ~/.hyper.js
|
|
|
|
ln -vfs "$DIR/.hyper_plugins" ~/.hyper_plugins
|
2016-11-13 17:09:48 +01:00
|
|
|
|
2017-01-19 10:03:34 +00:00
|
|
|
ln -vfs "$DIR/.setenv.sh" ~/.setenv
|
2014-12-25 17:17:42 +01:00
|
|
|
ln -vfs "$DIR/.Slic3r" ~/.
|
2015-02-28 22:39:29 +01:00
|
|
|
ln -vfs "$DIR/.ghci" ~/.
|
2016-05-03 20:20:46 +02:00
|
|
|
ln -vfs "$DIR/.conkyrc" ~/.
|
2015-03-11 21:37:36 +01:00
|
|
|
mkdir -p ~/.kde/share/config/
|
|
|
|
ln -vfs "$DIR/.kdiff3rc" ~/.kde/share/config/kdiff3rc
|
2014-12-25 17:17:42 +01:00
|
|
|
ln -vfs "$DIR/.gitconfig.linux.private" ~/.gitconfig
|
2015-04-12 19:07:50 +02:00
|
|
|
mkdir -p ~/.config/autostart/
|
2015-10-17 21:05:23 +02:00
|
|
|
# autostart apps
|
2015-07-04 12:12:53 +02:00
|
|
|
mkdir -p ~/.config/vdirsyncer/
|
|
|
|
ln -vfs "$DIR/.config/vdirsyncer/config" ~/.config/vdirsyncer/
|
2016-11-25 21:08:37 +01:00
|
|
|
mkdir -p ~/.config/Code/User
|
2016-11-25 20:05:15 +01:00
|
|
|
ln -vfs "$DIR/.config/Code/User/settings.json" ~/.config/Code/User/settings.json
|
2015-03-16 07:01:03 +01:00
|
|
|
|
2016-06-04 09:12:19 +02:00
|
|
|
source ~/.setenv
|
|
|
|
|
2015-08-01 09:20:19 +02:00
|
|
|
# symlink 'nodejs' as node on some systems
|
|
|
|
# will replace symlink if it exists, but won't replace regular file
|
|
|
|
if [[ ! -f /usr/bin/node ]]; then
|
2017-01-26 05:44:03 +00:00
|
|
|
if [[ -f /usr/bin/nodejs ]]; then
|
|
|
|
$SUDO ln -vfs /usr/bin/nodejs /usr/bin/node
|
|
|
|
fi
|
2015-08-01 09:20:19 +02:00
|
|
|
fi
|
|
|
|
|
2015-03-16 07:01:03 +01:00
|
|
|
# tools
|
2014-12-25 17:17:42 +01:00
|
|
|
ln -vfs "$DIR/tools" ~/
|
2014-08-31 08:01:19 +02:00
|
|
|
|
2014-10-26 10:02:50 +01:00
|
|
|
# stuff that does not like symbolic links
|
2015-01-03 15:42:17 +01:00
|
|
|
mkdir -vp ~/.config/terminator
|
2014-10-26 10:02:50 +01:00
|
|
|
rm -f ~/.config/terminator/config
|
|
|
|
ln "$DIR/.config/terminator/config" ~/.config/terminator/config
|
|
|
|
|
2014-08-31 08:01:19 +02:00
|
|
|
#install fonts
|
2015-07-31 20:25:32 +02:00
|
|
|
mkdir -p ~/.fonts
|
2014-08-31 08:01:19 +02:00
|
|
|
cp -rv "$DIR/fonts" ~/.fonts
|
2016-02-15 17:07:34 +01:00
|
|
|
set +e
|
2016-01-30 11:37:33 +01:00
|
|
|
fc-cache -rv
|
2016-07-30 21:39:07 +02:00
|
|
|
$SUDO fc-cache -rv
|
2016-02-15 17:07:34 +01:00
|
|
|
set -e
|
2014-08-31 08:01:19 +02:00
|
|
|
|
2017-08-08 21:26:01 +02:00
|
|
|
source "$DIR/common/install_vim_from_sources.sh"
|
|
|
|
|
2016-07-31 09:43:37 +02:00
|
|
|
if [[ -z $NORUST ]]; then
|
|
|
|
#rust
|
|
|
|
echo "installing rust"
|
|
|
|
RUSTUP_TEMP="/tmp/blastoff.sh"
|
|
|
|
$CURL https://sh.rustup.rs > "$RUSTUP_TEMP"
|
|
|
|
chmod a+x "$RUSTUP_TEMP"
|
|
|
|
"$RUSTUP_TEMP" -y
|
|
|
|
rm -f "$RUSTUP_TEMP"
|
|
|
|
rustup update
|
|
|
|
rustup default stable
|
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
|
|
|
|
cd "$DIR/../"
|
|
|
|
echo "getting rust sources..."
|
|
|
|
if [[ ! -d rust ]]; then
|
|
|
|
git clone https://github.com/rust-lang/rust.git --recursive
|
|
|
|
else
|
|
|
|
cd rust
|
|
|
|
git pull
|
|
|
|
git submodule update --init --recursive
|
|
|
|
fi
|
2017-10-16 20:02:25 +01:00
|
|
|
|
|
|
|
set +e
|
|
|
|
cargo install cargo-update rustfmt racer rustsym ripgrep
|
2017-01-26 05:44:03 +00:00
|
|
|
|
|
|
|
cd "$DIR/../"
|
|
|
|
if [[ ! -d alacritty ]]; then
|
|
|
|
git clone https://github.com/jwilm/alacritty.git --recursive
|
|
|
|
cd alacritty
|
|
|
|
else
|
|
|
|
cd alacritty
|
|
|
|
git pull
|
|
|
|
git submodule update --init --recursive
|
|
|
|
fi
|
2017-02-12 11:47:30 +00:00
|
|
|
rustup override set stable
|
2017-01-26 05:44:03 +00:00
|
|
|
cargo install
|
2016-10-07 10:01:17 +02:00
|
|
|
set -e
|
2015-07-31 20:25:32 +02:00
|
|
|
fi
|
2015-07-19 09:56:32 +02:00
|
|
|
|
2016-11-01 14:35:53 +01:00
|
|
|
set +e
|
|
|
|
echo "Querying for gpg2 path"
|
|
|
|
gpg2_path=`which gpg2`
|
|
|
|
echo "Got $gpg2_path for gpg2 path"
|
2016-11-01 14:38:20 +01:00
|
|
|
set -e
|
2016-11-03 21:38:04 +01:00
|
|
|
if [[ -x "$gpg2_path" ]]; then
|
2016-11-01 14:35:53 +01:00
|
|
|
echo "Using gpg2"
|
|
|
|
GPG=gpg2
|
|
|
|
else
|
|
|
|
echo "WARNING using gpg instead of gpg2"
|
|
|
|
GPG=gpg
|
|
|
|
fi
|
|
|
|
|
2016-08-11 14:37:03 +02:00
|
|
|
if [[ -z $NORUBY ]]; then
|
2016-11-01 15:04:54 +01:00
|
|
|
set +e
|
|
|
|
$GPG --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
|
|
|
|
set -e
|
2016-11-01 14:35:53 +01:00
|
|
|
$GPG --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
|
2016-11-03 21:12:59 +01:00
|
|
|
echo "Downloading RVM..."
|
2016-11-03 21:18:13 +01:00
|
|
|
$CURL https://get.rvm.io | bash
|
2016-11-02 20:42:28 +01:00
|
|
|
set +e
|
2016-11-03 21:12:59 +01:00
|
|
|
echo "Sourcing RVM..."
|
2016-11-02 20:42:28 +01:00
|
|
|
source /usr/local/rvm/scripts/rvm
|
2016-11-01 20:14:18 +01:00
|
|
|
source ~/.rvm/scripts/rvm
|
2016-11-02 20:42:28 +01:00
|
|
|
set -e
|
2016-11-03 21:12:59 +01:00
|
|
|
echo "Installing Ruby..."
|
2017-01-24 19:53:30 +00:00
|
|
|
rvm install ruby --disable-binary
|
2016-08-11 14:37:03 +02:00
|
|
|
fi
|
2016-04-30 10:46:06 +02:00
|
|
|
|
2016-08-05 09:56:31 +02:00
|
|
|
if [[ -z $NOVIM ]]; then
|
2016-10-13 16:44:59 +02:00
|
|
|
if [[ ! -d ~/.fzf ]]; then
|
|
|
|
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
|
|
|
|
else
|
|
|
|
cd ~/.fzf
|
|
|
|
git pull
|
|
|
|
git submodule update --init --recursive
|
|
|
|
fi
|
2017-05-14 13:05:54 +01:00
|
|
|
if [[ -z $NO_GO ]]; then
|
|
|
|
echo "Installing fzf"
|
|
|
|
~/.fzf/install --64 --all
|
|
|
|
fi
|
2016-11-01 14:22:07 +01:00
|
|
|
echo "Installing Vim plugins"
|
2017-02-12 11:47:30 +00:00
|
|
|
echo "\n" | vim +PluginInstall! +qa
|
2016-11-01 14:22:07 +01:00
|
|
|
|
2016-09-10 15:19:33 +02:00
|
|
|
if [[ -z $NOYCM ]]; then
|
2016-11-01 18:38:14 +01:00
|
|
|
echo "configuring YouCompleteMe"
|
2016-09-10 15:19:33 +02:00
|
|
|
cd ~/.vim/bundle/YouCompleteMe
|
2017-02-12 11:47:30 +00:00
|
|
|
git submodule update --init --recursive
|
2016-09-15 06:43:04 +02:00
|
|
|
if [[ -z $NOPYTHON3 ]]; then
|
|
|
|
python3 ./install.py --clang-completer --racer-completer --tern-completer
|
|
|
|
else
|
|
|
|
python ./install.py --clang-completer --racer-completer --tern-completer
|
|
|
|
fi
|
2016-09-10 15:19:33 +02:00
|
|
|
fi
|
2016-07-31 09:43:37 +02:00
|
|
|
fi
|
2014-12-25 17:17:42 +01:00
|
|
|
|
2016-08-04 17:59:32 +02:00
|
|
|
if [[ -z $NO_GO ]]; then
|
2017-03-18 09:16:20 +00:00
|
|
|
GOPATH="$HOME/go"
|
|
|
|
export GOPATH=`realpath "$GOPATH"`
|
2016-08-04 17:59:32 +02:00
|
|
|
mkdir -p "$GOPATH"
|
2016-04-10 19:38:38 +02:00
|
|
|
|
2016-08-04 17:59:32 +02:00
|
|
|
# excercism
|
|
|
|
go get -u github.com/exercism/cli/exercism
|
|
|
|
fi
|
2016-04-10 19:38:38 +02:00
|
|
|
|
2016-07-30 21:39:07 +02:00
|
|
|
$SUDO npm install -g reveal-md
|
|
|
|
$SUDO npm install -g diff-so-fancy
|
2017-09-22 12:08:05 +01:00
|
|
|
$SUDO npm install -g cssnano
|
2014-08-31 08:01:19 +02:00
|
|
|
|
2016-11-03 20:55:20 +01:00
|
|
|
if [[ -z $NOPYTHON3 ]]; then
|
2016-11-03 21:58:39 +01:00
|
|
|
set +e
|
2016-11-03 20:55:20 +01:00
|
|
|
pip3_path=`which pip3`
|
2016-11-03 21:58:39 +01:00
|
|
|
set -e
|
2016-11-03 20:55:20 +01:00
|
|
|
echo "pip3 path is $pip3_path"
|
2016-11-03 21:38:04 +01:00
|
|
|
if [[ -x "$pip3_path" ]]; then
|
2016-11-03 20:55:20 +01:00
|
|
|
echo "Choosing pip3 for pip"
|
|
|
|
PIP=pip3
|
|
|
|
else
|
|
|
|
echo "Choosing pip"
|
|
|
|
PIP=pip
|
|
|
|
fi
|
2017-01-25 21:36:23 +00:00
|
|
|
echo "Upgrading pip"
|
2017-03-09 07:00:45 +00:00
|
|
|
$SUDO $PIP install --upgrade pip setuptools
|
|
|
|
$SUDO $PIP install --upgrade packaging
|
2016-11-03 20:55:20 +01:00
|
|
|
echo "Installing Nikola"
|
2017-03-09 07:00:45 +00:00
|
|
|
$SUDO $PIP install --upgrade pygments-style-solarized ws4py watchdog webassets Nikola
|
2016-10-16 17:35:28 +02:00
|
|
|
fi
|
2015-07-04 11:45:07 +02:00
|
|
|
|
2016-07-01 13:29:03 +02:00
|
|
|
if [[ -z $USER ]]; then
|
|
|
|
USER=`whoami`
|
|
|
|
fi
|
2015-07-04 11:45:07 +02:00
|
|
|
|
2015-08-18 18:47:25 +02:00
|
|
|
# normalize npm permissions
|
2015-08-18 20:59:14 +02:00
|
|
|
mkdir -p $HOME/.npm
|
2017-01-26 05:44:03 +00:00
|
|
|
$SUDO chown -R $USER $HOME/.npm
|
2015-08-18 18:47:25 +02:00
|
|
|
|
2014-08-31 08:01:19 +02:00
|
|
|
echo
|
2015-01-25 09:58:43 +01:00
|
|
|
echo "now go ahead and restart"
|
|
|
|
echo
|
|
|
|
|
2014-08-31 08:01:19 +02:00
|
|
|
|