-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.macos
79 lines (62 loc) · 3 KB
/
.macos
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
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env bash
# ~/.macos — https://mths.be/macos
# Modified by Kent C. Dodds
# Modified by Michael Danilov
# Run without downloading:
# curl https://raw.githubusercontent.com/MichaelDanilov/dotfiles/master/.macos | bash
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.macos` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
###############################################################################
# Michael's Customizations #
###############################################################################
echo "Hello $(whoami)! Let's get you set up."
if [ -z "$HOME" ]; then
echo "Seems you're \$HOMEless :("; exit 1;
fi
echo "installing ohmyz"
# install ohmyz https://ohmyz.sh/
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
echo "installing homebrew"
# install homebrew https://brew.sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "brew installing stuff"
# tree: really handy for listing out directories in text
# bat: A cat(1) clone with syntax highlighting and Git integration.
brew install git bash-completion tree bat gpg
echo "installing node (via nvm-install)"
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
echo "node --version: $(node --version)"
echo "npm --version: $(npm --version)"
echo "installing apps with brew cask"
brew cask install alfred google-chrome firefox bettertouchtool bartender visual-studio-code \
1password virtualbox sublime-text vlc
echo "cloning dotfiles and replace existed"
# remove previous version
rm ~/.{bashrc,bash_profile,bash_prompt,exports,exports_user,aliases,aliases_user,functions,functions_user,\
gitconfig,gitignore,zshrc,oh-my-zsh/themes/malbino.zsh-theme,nvmrc,vimrc}
git clone git@github.com:MichaelDanilov/dotfiles.git ~/dotfiles
# Create files with user private data
touch ~/dotfiles/bash/.exports_user
touch ~/dotfiles/bash/.aliases_user
touch ~/dotfiles/bash/.functions_user
# Link it to home directory
ln -s ~/dotfiles/bash/.bashrc ~/.bashrc
ln -s ~/dotfiles/bash/.bash_profile ~/.bash_profile
ln -s ~/dotfiles/bash/.bash_prompt ~/.bash_prompt
ln -s ~/dotfiles/bash/.exports ~/.exports
ln -s ~/dotfiles/bash/.exports_user ~/.exports_user
ln -s ~/dotfiles/bash/.aliases ~/.aliases
ln -s ~/dotfiles/bash/.aliases_user ~/.aliases_user
ln -s ~/dotfiles/bash/.functions ~/.functions
ln -s ~/dotfiles/bash/.functions_user ~/.functions_user
ln -s ~/dotfiles/bash/.vimrc ~/.vimrc
ln -s ~/dotfiles/git/.gitconfig ~/.gitconfig
ln -s ~/dotfiles/git/.gitignore ~/.gitignore
ln -s ~/dotfiles/zsh/.zshrc ~/.zshrc
ln -s ~/dotfiles/zsh/malbino.zsh-theme ~/.oh-my-zsh/themes/malbino.zsh-theme
ln -s ~/dotfiles/misc/.nvmrc ~/.nvmrc