dotfiles/common/configure_fresh_system

128 lines
2.7 KiB
Text
Raw Normal View History

#!/bin/bash
set -e
echo
echo "configuring settings common among OSes"
2015-07-19 10:23:35 +01:00
sudo true
#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
2016-06-04 07:59:40 +01:00
CURL="curl -sSf"
if [[ -z $DIR ]]; then
echo "please set DIR"
exit 1
fi
DIR=`realpath $DIR`
echo "using $DIR as the top level directory"
cd $DIR
git submodule update --init --recursive
#configs
ln -vfs "$DIR/.vim" ~/.
ln -vfs "$DIR/.vimrc" ~/.
ln -vfs "$DIR/.tmux.conf" ~/.
rm -f "~/.zshrc"
ln -vfs "$DIR/.zshrc" ~/.
ln -vfs "$DIR/.setenv" ~/.
ln -vfs "$DIR/.oh-my-zsh" ~/.
ln -vfs "$DIR/.oh-my-zsh-plugins/zsh-syntax-highlighting" ~/.oh-my-zsh/custom/plugins/
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" ~/.
mkdir -p ~/.kde/share/config/
ln -vfs "$DIR/.kdiff3rc" ~/.kde/share/config/kdiff3rc
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
source ~/.setenv
# 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
sudo ln -vfs /usr/bin/nodejs /usr/bin/node
fi
# tools
ln -vfs "$DIR/tools" ~/
# stuff that does not like symbolic links
mkdir -vp ~/.config/terminator
rm -f ~/.config/terminator/config
ln "$DIR/.config/terminator/config" ~/.config/terminator/config
#install fonts
mkdir -p ~/.fonts
cp -rv "$DIR/fonts" ~/.fonts
set +e
fc-cache -rv
sudo fc-cache -rv
set -e
2015-07-19 08:56:32 +01:00
#rust
echo "installing rust"
2016-06-04 07:59:40 +01:00
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
2016-07-09 08:28:30 +01:00
git clone https://github.com/rust-lang/rust.git --recursive
else
cd rust
git pull
2016-07-09 08:28:30 +01:00
git submodule update --init --recursive
fi
2015-07-19 08:56:32 +01:00
cargo install -f rustfmt
2016-07-09 11:57:56 +01:00
echo "\n" | vim +PluginInstall +qa
cd "$DIR/.vim/bundle/YouCompleteMe/"
git submodule update --init --recursive
./install.py --racer-completer --clang-completer
2016-04-10 18:38:38 +01:00
# go
export GOPATH="$HOME/go"
mkdir -p "$GOPATH"
# excercism
go get -u github.com/exercism/cli/exercism
# talks: reveal-md
sudo npm install -g reveal-md
sudo npm install -g diff-so-fancy
# vdir syncer
echo "installing vdirsyncer"
sudo pip install vdirsyncer
2015-07-04 10:45:07 +01:00
if [[ -z $USER ]]; then
USER=`whoami`
fi
2015-08-18 17:47:25 +01:00
# normalize npm permissions
mkdir -p $HOME/.npm
sudo chown $USER $HOME/.npm -R
2015-08-18 17:47:25 +01:00
echo
echo "now go ahead and restart"
echo