-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·131 lines (102 loc) · 4.6 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/env bash
# Dotfiles dir
DOTFILES_DIR="$(pwd)"
. "$DOTFILES_DIR/helpers/colors.sh"
. "$DOTFILES_DIR/helpers/functions.sh"
printf "\n%sCheck XCode...%s" "${cyn}" "${end}"
if ! command_exists 'gcc'; then
printf "\n%sThe XCode Command Line Tools must be installed first.%s\n" "${red}" "${end}"
printf "\n%ssudo softwareupdate -i -a%s" "${red}" "${end}"
printf "\n%sxcode-select --install%s" "${red}" "${end}"
printf "\n%ssudo xcodebuild -license%s" "${red}" "${end}"
exit 1
else
printf "%s[OK]%s\n" "${grn}" "${end}"
fi
printf "\n%sLink bash configs...\n%s" "${cyn}" "${end}"
ln -sfv "$DOTFILES_DIR/bashrc" "${HOME}/.bashrc"
check_status $?
ln -sfv "$DOTFILES_DIR/bash_profile" "${HOME}/.bash_profile"
check_status $?
ln -sfv "$DOTFILES_DIR/.bashrc.d" ~
check_status $?
printf "\n%sLoad .bashrc...%s" "${cyn}" "${end}"
source "${HOME}/.bashrc";
printf "\n%sLoad config...%s" "${cyn}" "${end}"
if test -f "$DOTFILES_DIR/config"; then
. "$DOTFILES_DIR/config";
printf "\nUsing %s%s%s as a configuration\n" "${cyn}" "$DOTFILES_DIR/config" "${end}"
else
printf "%sConfiguration not found%s\n" "${yel}" "${end}"
fi
printf "\n%s#############################################%s" "${cyn}" "${end}"
printf "\n%s# #%s" "${cyn}" "${end}"
printf "\n%s# Homebrew #%s" "${cyn}" "${end}"
printf "\n%s# http://brew.sh/ #%s" "${cyn}" "${end}"
printf "\n%s# #%s" "${cyn}" "${end}"
printf "\n%s#############################################%s\n" "${cyn}" "${end}"
. "$DOTFILES_DIR/install/homebrew.sh"
printf "\n%s#################################################%s" "${cyn}" "${end}"
printf "\n%s# #%s" "${cyn}" "${end}"
printf "\n%s# setup macOS Defaults #%s" "${cyn}" "${end}"
printf "\n%s# https://www.defaults-write.com/ #%s" "${cyn}" "${end}"
printf "\n%s# #%s" "${cyn}" "${end}"
printf "\n%s#################################################%s\n" "${cyn}" "${end}"
osascript -e 'tell application "System Preferences" to quit'
printf "Setup general settings...\n"
. "$DOTFILES_DIR/osx/general.sh"
printf "Setup security settings...\n"
. "$DOTFILES_DIR/osx/security.sh"
printf "Setup energy savings settings...\n"
. "$DOTFILES_DIR/osx/energy-saving.sh"
printf "Setup time machine settings...\n"
. "$DOTFILES_DIR/osx/time-machine.sh"
printf "Setup keyboard settings...\n"
. "$DOTFILES_DIR/osx/keyboard.sh"
printf "Setup trackpad settings...\n"
. "$DOTFILES_DIR/osx/trackpad.sh"
printf "Setup screen settings...\n"
. "$DOTFILES_DIR/osx/screen.sh"
printf "Setup dashboard settings...\n"
. "$DOTFILES_DIR/osx/dashboard.sh"
printf "Setup mision control settings...\n"
. "$DOTFILES_DIR/osx/mission-control.sh"
printf "Setup finder settings...\n"
. "$DOTFILES_DIR/osx/finder.sh"
printf "Setup dock settings...\n"
. "$DOTFILES_DIR/osx/dock.sh"
printf "Setup apps settings...\n"
. "$DOTFILES_DIR/osx/apps.sh"
printf "\n%sConfigure Firefox profiles...%s\n" "${cyn}" "${end}"
. "$DOTFILES_DIR/firefox/install-profile.sh"
printf "\n%sCreate XDG Base Directory layout...\n%s" "${cyn}" "${end}"
for __xdg_dir in "${XDG_CONFIG_HOME}" "${XDG_DATA_HOME}" "${XDG_STATE_HOME}" "${XDG_CACHE_HOME}"
do
if test -d "${__xdg_dir}"; then
printf "Directory %s%s%s already exist\n" "${cyn}" "${__xdg_dir}" "${end}"
else
printf "Create directory %s%s%s..." "${yel}" "${__xdg_dir}" "${end}"
mkdir -p "${__xdg_dir}"
check_status $?
fi
done
printf "\n%sSetting iTerm preference folder...\n%s" "${cyn}" "${end}"
defaults write com.googlecode.iterm2 PrefsCustomFolder "${XDG_CONFIG_HOME}/iterm2"
check_status $?
defaults write com.googlecode.iterm2 LoadPrefsFromCustomFolder -bool true
check_status $?
printf "\n%s#############################################%s" "${cyn}" "${end}"
printf "\n%s# #%s" "${cyn}" "${end}"
printf "\n%s# Mackup #%s" "${cyn}" "${end}"
printf "\n%s# https://github.com/lra/mackup #%s" "${cyn}" "${end}"
printf "\n%s# #%s" "${cyn}" "${end}"
printf "\n%s#############################################%s\n" "${cyn}" "${end}"
ln -sfv "$DOTFILES_DIR/.mackup.cfg" ~
ln -sfv "$DOTFILES_DIR/.mackup" ~
if ask "Do you want to restore Mackup backups now?" Y; then
mackup restore
fi
printf "\n%sInstall complete. Please, restart your computer%s\n" "${red}" "${end}"
if ask "Do you want restart computer now?" Y; then
sudo shutdown -r now
fi