-
Notifications
You must be signed in to change notification settings - Fork 14
/
install.sh
executable file
·67 lines (54 loc) · 1.86 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
current_dir=$(dirname $0)
dotfiles_path=$PWD/$current_dir
vimfiles_path=$dotfiles_path/vimfiles
emacs_dir=$dotfiles_path/symlink/emacs.d
echo "=== Initializing git submodules"
git submodule update --init
echo "=== Installing vimfiles"
cd $vimfiles_path
./install.sh
cd -
echo "=== Creating symlinks for dotfiles"
cd $dotfiles_path
for name in symlink/*; do
name=$(echo $name|cut -c 9-)
target=$HOME/.$name
if [ -e $target ]; then
echo "WARNING: $target exists but not a symlink" && continue
else
ln -s $dotfiles_path/symlink/$name $HOME/.$name
fi
done
cd -
echo "=== Creating a symlink for iTerm2"
iterm_file=com.googlecode.iterm2.plist
iterm_path=$HOME/Library/Preferences/$iterm_file
if [ -e $iterm_path ]; then
echo "WARNING: $iterm_path exists but not a symlink" && continue
else
ln -s $HOME/.$iterm_file $iterm_path
fi
if ! type brew > /dev/null; then
echo "=== Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo "=== Installing Homebrew packages"
brew bundle
if type cask > /dev/null; then
echo "=== Installing Cask Packages for Emacs"
cd $emacs_dir
cask install
cd -
else
echo "=== Warning: Emacs packages were not installed because cask is not installed"
fi
echo === Setting up System Preferences
defaults write com.apple.screensaver askForPasswordDelay -int 60 # ask for password after a number of seconds
defaults write com.apple.finder AppleShowAllFiles TRUE # show hidden files in Finder
defaults write com.apple.dock autohide -int 1 # auto hide the dock
defaults write com.apple.dock orientation left # change dock orientation to the left
defaults write com.apple.dock tilesize 35 # make dock icons smaller
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 # enable full keyboard access for all controls
killall Dock # relaunch dock
echo === Done