Created
May 25, 2012 18:56
-
-
Save supermomonga/2789864 to your computer and use it in GitHub Desktop.
initialize bash script for Max OS X
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd ~/ | |
home=`pwd` | |
# Disable dashboard | |
defaults write com.apple.dashboard mcx-disabled -boolean YES | |
killall Dock | |
# Remove localized file | |
localized=( | |
"${home}/Desktop" | |
"${home}/Documents" | |
"${home}/Downloads" | |
"${home}/Library" | |
"${home}/Movies" | |
"${home}/Music" | |
"${home}/Pictures" | |
"${home}/Public" | |
"${home}/Sites") | |
#'/Applications/Utilities' | |
for path in ${localized[@]}; do | |
cd $path | |
mv ./.localized ./.localized.disable | |
done | |
cd ~/ | |
# Install Homebrew | |
if [ -e '/usr/local/bin/brew' ]; then | |
echo '- homebrew is already installed.' | |
else | |
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)" | |
echo '- homebrew install finished' | |
fi | |
# Install git and clone dotfiles repository | |
if [ -e '/usr/local/bin/git' ]; then | |
echo '- Git is already installed.' | |
else | |
brew install git | |
echo '- Git install finished.' | |
fi | |
if [ -e "${home}/dotfiles" ]; then | |
echo '- dotfiles repository is already cloned.' | |
else | |
git clone [email protected]:supermomonga/dotfiles.git | |
echo '- dotfiles repository clone finished.' | |
fi | |
# Create symbolic links | |
rm -rf ~/.emacs.d ; ln -s ~/dotfiles/.emacs.d ~/.emacs.d | |
rm -rf ~/.gitconfig ; ln -s ~/dotfiles/.gitconfig ~/.gitconfig | |
rm -rf ~/.gitignore ; ln -s ~/dotfiles/.gitignore ~/.gitignore | |
rm -rf ~/.vimrc ; ln -s ~/dotfiles/.vimrc ~/.vimrc | |
rm -rf ~/.gvimrc ; ln -s ~/dotfiles/.gvimrc ~/.gvimrc | |
rm -rf ~/.zshrc ; ln -s ~/dotfiles/.zshrc ~/.zshrc | |
rm -rf ~/.zsh_history ; ln -s ~/dotfiles/.zsh_history ~/.zsh_history | |
rm -rf ~/.ssh ; ln -s ~/dotfiles/.ssh ~/.ssh | |
rm -rf ~/.recentf ; ln -s ~/dotfiles/.recentf ~/.recentf | |
# Install rvm, ruby 1.9.3 | |
if [ -e "${home}/.rvm/bin/rvm" ]; then | |
echo 'RVM is already installed.' | |
else | |
curl -L get.rvm.io | bash -s stable | |
echo 'source "${home}/.rvm/scripts/rvm"' >> ~/.bashrc | |
fi | |
source ~/.bashrc | |
rvm install 1.9.3 | |
# Install homebrew packages | |
brew install wget | |
brew install emacs --HEAD --use-git-head --cocoa --srgb | |
#ln -s /usr/local/Cellar/emacs/HEAD/Emacs.app /Applications/Emacs.app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment