2014-08-31 07:01:19 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-07-30 20:39:07 +01:00
|
|
|
SUDO=""
|
|
|
|
if [[ -z $NOSUDO ]]; then
|
2016-07-30 20:42:34 +01:00
|
|
|
SUDO="sudo"
|
2016-07-30 20:39:07 +01:00
|
|
|
fi
|
|
|
|
|
2016-07-30 20:42:34 +01:00
|
|
|
echo "using '$SUDO' as sudo"
|
|
|
|
|
2015-04-30 21:29:17 +01:00
|
|
|
set -e
|
2015-01-25 08:57:25 +00:00
|
|
|
echo
|
|
|
|
echo "configuring settings common among OSes"
|
2016-07-30 20:39:07 +01:00
|
|
|
$SUDO true
|
2015-07-19 10:23:35 +01:00
|
|
|
|
2015-01-25 08:57:25 +00:00
|
|
|
#zsh
|
2015-07-19 10:23:35 +01:00
|
|
|
if [[ -z $DONT_CHANGE_SHELL ]]; then
|
|
|
|
echo "changing shell to zsh"
|
|
|
|
chsh -s `which zsh` $USER
|
|
|
|
fi
|
2014-08-31 07:01:19 +01:00
|
|
|
|
2016-06-04 07:59:40 +01:00
|
|
|
CURL="curl -sSf"
|
|
|
|
|
2016-07-30 20:08:05 +01:00
|
|
|
if [[ -z $DIR ]]; then
|
|
|
|
echo "please set DIR"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-03-28 08:10:58 +00:00
|
|
|
DIR=`realpath $DIR`
|
|
|
|
echo "using $DIR as the top level directory"
|
2014-08-31 07:01:19 +01:00
|
|
|
cd $DIR
|
2015-09-20 10:57:01 +01:00
|
|
|
git submodule update --init --recursive
|
2014-08-31 07:01:19 +01:00
|
|
|
|
2015-03-16 06:01:03 +00:00
|
|
|
#configs
|
2014-12-25 16:17:42 +00:00
|
|
|
ln -vfs "$DIR/.vim" ~/.
|
|
|
|
ln -vfs "$DIR/.vimrc" ~/.
|
|
|
|
ln -vfs "$DIR/.tmux.conf" ~/.
|
2014-08-31 07:01:19 +01:00
|
|
|
rm -f "~/.zshrc"
|
2014-12-25 16:17:42 +00:00
|
|
|
ln -vfs "$DIR/.zshrc" ~/.
|
2016-06-04 08:12:19 +01:00
|
|
|
ln -vfs "$DIR/.setenv" ~/.
|
2014-12-25 16:17:42 +00:00
|
|
|
ln -vfs "$DIR/.oh-my-zsh" ~/.
|
2015-07-03 22:35:00 +01:00
|
|
|
ln -vfs "$DIR/.oh-my-zsh-plugins/zsh-syntax-highlighting" ~/.oh-my-zsh/custom/plugins/
|
2014-12-25 16:17:42 +00:00
|
|
|
ln -vfs "$DIR/.Slic3r" ~/.
|
2015-02-28 21:39:29 +00:00
|
|
|
ln -vfs "$DIR/.ghci" ~/.
|
2016-05-03 19:20:46 +01:00
|
|
|
ln -vfs "$DIR/.conkyrc" ~/.
|
2015-03-11 20:37:36 +00:00
|
|
|
mkdir -p ~/.kde/share/config/
|
|
|
|
ln -vfs "$DIR/.kdiff3rc" ~/.kde/share/config/kdiff3rc
|
2014-12-25 16:17:42 +00:00
|
|
|
ln -vfs "$DIR/.gitconfig.linux.private" ~/.gitconfig
|
2015-04-12 18:07:50 +01:00
|
|
|
mkdir -p ~/.config/autostart/
|
2015-10-17 20:05:23 +01:00
|
|
|
# autostart apps
|
|
|
|
ln -vfs "$DIR/.config/autostart/redshift-gtk.desktop" ~/.config/autostart/
|
2015-07-04 11:12:53 +01:00
|
|
|
mkdir -p ~/.config/vdirsyncer/
|
|
|
|
ln -vfs "$DIR/.config/vdirsyncer/config" ~/.config/vdirsyncer/
|
2015-09-28 19:59:10 +01:00
|
|
|
ln -vfs "$DIR/.config/redshift.conf" ~/.config/redshift.conf
|
2015-03-16 06:01:03 +00:00
|
|
|
|
2016-06-04 08:12:19 +01:00
|
|
|
source ~/.setenv
|
|
|
|
|
2015-08-01 08:20:19 +01: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
|
2016-07-30 20:39:07 +01:00
|
|
|
$SUDO ln -vfs /usr/bin/nodejs /usr/bin/node
|
2015-08-01 08:20:19 +01:00
|
|
|
fi
|
|
|
|
|
2015-03-16 06:01:03 +00:00
|
|
|
# tools
|
2014-12-25 16:17:42 +00:00
|
|
|
ln -vfs "$DIR/tools" ~/
|
2014-08-31 07:01:19 +01:00
|
|
|
|
2014-10-26 09:02:50 +00:00
|
|
|
# stuff that does not like symbolic links
|
2015-01-03 14:42:17 +00:00
|
|
|
mkdir -vp ~/.config/terminator
|
2014-10-26 09:02:50 +00:00
|
|
|
rm -f ~/.config/terminator/config
|
|
|
|
ln "$DIR/.config/terminator/config" ~/.config/terminator/config
|
|
|
|
|
2014-08-31 07:01:19 +01:00
|
|
|
#install fonts
|
2015-07-31 19:25:32 +01:00
|
|
|
mkdir -p ~/.fonts
|
2014-08-31 07:01:19 +01:00
|
|
|
cp -rv "$DIR/fonts" ~/.fonts
|
2016-02-15 16:07:34 +00:00
|
|
|
set +e
|
2016-01-30 10:37:33 +00:00
|
|
|
fc-cache -rv
|
2016-07-30 20:39:07 +01:00
|
|
|
$SUDO fc-cache -rv
|
2016-02-15 16:07:34 +00:00
|
|
|
set -e
|
2014-08-31 07:01:19 +01:00
|
|
|
|
2016-07-31 08:43:37 +01: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
|
|
|
|
cargo install -f rustfmt
|
2015-07-31 19:25:32 +01:00
|
|
|
fi
|
2015-07-19 08:56:32 +01:00
|
|
|
|
2016-08-11 13:37:03 +01:00
|
|
|
if [[ -z $NORUBY ]]; then
|
|
|
|
gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
|
2016-08-11 13:53:45 +01:00
|
|
|
curl -sSL https://get.rvm.io | bash -s stable --ruby
|
2016-08-11 13:37:03 +01:00
|
|
|
fi
|
|
|
|
|
2016-08-05 08:56:31 +01:00
|
|
|
if [[ -z $NOVIM ]]; then
|
|
|
|
echo "\n" | vim +PluginInstall +qa
|
2016-07-31 08:43:37 +01:00
|
|
|
fi
|
2016-07-09 10:21:52 +01:00
|
|
|
|
2016-08-04 16:59:32 +01:00
|
|
|
if [[ -z $NO_GO ]]; then
|
|
|
|
export GOPATH="$HOME/go"
|
|
|
|
mkdir -p "$GOPATH"
|
2016-04-10 18:38:38 +01:00
|
|
|
|
2016-08-04 16:59:32 +01:00
|
|
|
# excercism
|
|
|
|
go get -u github.com/exercism/cli/exercism
|
|
|
|
fi
|
2016-04-10 18:38:38 +01:00
|
|
|
|
2014-12-25 16:17:42 +00:00
|
|
|
# talks: reveal-md
|
2016-07-30 20:39:07 +01:00
|
|
|
$SUDO npm install -g reveal-md
|
|
|
|
$SUDO npm install -g diff-so-fancy
|
2014-08-31 07:01:19 +01:00
|
|
|
|
2015-08-01 06:43:12 +01:00
|
|
|
# vdir syncer
|
2015-07-19 12:16:03 +01:00
|
|
|
echo "installing vdirsyncer"
|
2016-07-30 20:39:07 +01:00
|
|
|
$SUDO pip install vdirsyncer
|
2015-07-04 10:45:07 +01:00
|
|
|
|
2016-07-01 12:29:03 +01:00
|
|
|
if [[ -z $USER ]]; then
|
|
|
|
USER=`whoami`
|
|
|
|
fi
|
|
|
|
|
2015-08-18 17:47:25 +01:00
|
|
|
# normalize npm permissions
|
2015-08-18 19:59:14 +01:00
|
|
|
mkdir -p $HOME/.npm
|
2016-07-30 20:39:07 +01:00
|
|
|
$SUDO chown $USER $HOME/.npm -R
|
2015-08-18 17:47:25 +01:00
|
|
|
|
2014-08-31 07:01:19 +01:00
|
|
|
echo
|
2015-01-25 08:58:43 +00:00
|
|
|
echo "now go ahead and restart"
|
|
|
|
echo
|
|
|
|
|
2014-08-31 07:01:19 +01:00
|
|
|
|