-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInitConfig.sh
325 lines (255 loc) · 7.88 KB
/
InitConfig.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
#!/bin/bash
## Florent DUFOUR
### My automated software installation after a clean install (for macOS Sierra)
#----------------------------------------------------------------
## Software to install:
declare -a brew=(
'cairo'
'ccat'
'duti'
'exiftool'
'ffmpeg'
'fish'
'groovysdk'
'hugin'
'hunspell'
'gcc'
'git'
'mas'
'maven'
'node'
'pandoc'
'pandoc-citeproc' # Because life is too short
'python3'
'trash'
'tree'
'youtube-dl')
declare -a cask=( # Some casks need it to be installed beforehand
'xquartz' # Some casks rely on xquartz as a dependency: has to be first
'appcleaner'
'atom'
'boostnote'
'chromium'
'clipy'
'coconutbattery'
'cryptomator'
'dropbox'
'eclipse-ide'
'evernote'
'flux'
'font-latin-modern'
'font-open-sans'
'github' # Formerly 'github-desktop'
#'goofy'
'gpg-suite'
'grammarly'
'iina'
'imagej'
'inkscape'
'intellij-idea-ce'
'iterm2'
'java8'
'mactex-no-gui' # That's heavy!
'macvim'
'marp'
'meld'
'onyx'
'processing' # Uh!
'rocket'
'scenebuilder'
'skype'
'spectacle'
'texstudio'
'touchbarserver'
'transmission'
'typora'
'wwdc'
'zotero'
'1password')
declare -a npm=(
'p5-manager')
declare -a apm=(
'atom-beautify'
'atom-live-server'
'autocomplete-java'
'close-on-left' # Kind of a necessity...
'dark-flat-ui'
'emmet'
'highlight-column'# Change style for line: automatic color is 284b6f
'highlight-line' # Change color to #284b6f
'highlight-selected'
'language-applescript'
'linter'
'linter-htmlhint'
'linter-javac'
'linter-jscs'
'linter-jshint'
'linter-jsonlint'
'linter-markdown'
'linter-shellcheck'
'linter-stylelint'
'linter-ui-default'
'minimap'
'outlander-syntax'
'p5xjs-autocomplete'
'todo-show' #Yes!
'wordcount'
'zen')
declare -a mas=( # We prefer not to use `mas lucky`. The app id is more reliable.
'937984704' # Amphetamine
'1229643033' # Am I online
'641027709' # Color Picker
'1033480833' # Decompressor (Because someone will someday send you a .rar ...)
'409183694' # Keynote
'576338668' # Leaf
'715768417' # Microsoft remote desktop
'409203825' # Numbers
'409201541' # Pages
'439654198') # Simple mind
declare -a pip=(
'cairosvg'
'jupyter'
'livereload'
'matplotlib'
'pandas') # Comes along other useful libraries such as numpy
#----------------------------------------------------------------
## Install homebrew:
echo -e '\n\tINSTALLING HOMEBREW\n'
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#----------------------------------------------------------------
## Setup:
echo -e '\n\tTAPPING\n'
brew tap homebrew/cask
brew tap homebrew/cask-versions
brew tap homebrew/cask-fonts
#----------------------------------------------------------------
## Loop through the installs:
echo -e '\n\tMESSING WITH INSTALLS\n'
# Install casks first (some brews may rely on casks. ex: maven needs java7+ to be installed beforehand)
for c in "${cask[@]}"
do
echo -e "> Installing cask $c \n"
brew cask install "$c";
done
# Install brews
for b in "${brew[@]}"
do
echo -e "> Installing brew: $b \n"
brew install "$b";
done
# Install node packages
for n in "${npm[@]}"
do
echo -e "> Installing node $n "
sudo npm install -g "$n"
done
# Install atom packages
atom # Open atom for the first time so the apm command is made available
sleep 30 # Wait for atom to be launched
for a in "${apm[@]}"
do
echo -e "> Installing atom libraries $a"
apm install "$a"
done
# Install app from mac app store
mas signin --dialog [email protected] # Displays a dialog box to login
for m in "${mas[@]}"
do
echo -e "> Installing Mac app store Apps $m"
mas install "$m"
done
# Install python packages
for p in "${pip[@]}"
do
echo -e "> Intalling python libraries"
pip3 install "$p"
done
#----------------------------------------------------------------
## GUI:
echo -e '\n\tMESSING WITH OTHER CONFIGS\n'
### Wallpapers
destination='/Library/Desktop\ Pictures' #(For macOS Sierra)
curl http://512pixels.net/downloads/macos-wallpapers/10-5.png -o 'Leopard.png'
curl http://512pixels.net/downloads/macos-wallpapers/10-6.png -o 'Snow-Leopard.png'
sudo mv Leopard.png "$destination/Leopard.png"
sudo mv Snow-Leopard.png "$destination/Snow-Leopard.png"
osascript -e 'tell application "System Events" to set picture of every desktop to ("/Library/Desktop Pictures/Leopard.png" as POSIX file as alias)'
### Hot corners
sudo osascript SetHotCorners.scpt # The AppleScript has to be in the same directory
### Finder prefs
defaults write com.apple.finder AppleShowAllFiles TRUE # Show hidden files
#----------------------------------------------------------------
## Shell:
### Spelling with hunspell
sudo mkdir /Library/Spelling
# English dictionary
sudo curl -o /Library/Spelling/en_US.aff https://raw.githubusercontent.com/wooorm/dictionaries/master/dictionaries/en-US/index.aff
sudo curl -o /Library/Spelling/en_US.dic https://raw.githubusercontent.com/wooorm/dictionaries/master/dictionaries/en-US/index.dic
# French dictionary
sudo curl -o /Library/Spelling/fr_FR.aff https://raw.githubusercontent.com/wooorm/dictionaries/master/dictionaries/fr/index.aff
sudo curl -o /Library/Spelling/fr_FR.dic https://raw.githubusercontent.com/wooorm/dictionaries/master/dictionaries/fr/index.dic
### Fish shell
fishPath=`which fish`
echo $fishPath | sudo tee -a /etc/shells # Add Fish to the list of supported shells
chsh -s $fishPath # Make fish the default shell
#----------------------------------------------------------------
## vim:
### ultimate vim rc
# git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
#sh ~/.vim_runtime/install_awesome_vimrc.sh
#----------------------------------------------------------------
## Configuration:
#TODO: Activate & configure fire wall
### Atom configuration
apm disable welcome
#TODO: activate scroll past end
### Copy and source configuration resources
cp ./Resources/bashrc ~/.bash_profile # For bash shell
cp ./Resources/bashrc ~/.config/fish/config.fish # For fish shell #TODO: create an alias to stay up to date
cp ./Resources/latexmkrc ~/.latexmkrc
cp ./Resources/groovy_profile ~/.groovy/groovy_profile
cp ./Resources/IINAConfig.conf /Library/Application Support/com.colliderli.iina/input_conf/MyConfig.conf
cp ./Resources/itermProfile.json ~/Library/Application Support/iTerm2/DynamicProfiles/MyConfig.json
chmod +x ./Resources/compressPDF
cp ./Resources/compressPDF /usr/local/bin/compressPDF
### Lightroom presets
sudo cp -r ./Resources/Lightroom-presets /Users/florent/Library/Application Support/Adobe/Lightroom/Develop Presets/User Presets
#----------------------------------------------------------------
## Default settings:
### Set default applications (using duti and inline applescripting)
duti -s "$(osascript -e 'id of app "Typora"')" md all
duti -s "$(osascript -e 'id of app "Chromium"')" html all
declare -a iinaFormats=(mp3 mp4 m4a mkv avi webm mov) #Add other formats here
for format in "${iinaFormats[@]}"
do
duti -s "$(osascript -e 'id of app "IINA"')" $format all
done
declare -a macvimFormats=(txt log dat sh fasta mgf f90 f95 srt csl bib bbl aux sty scala cson) #Add other formats here
for format in "${macvimFormats[@]}"
do
duti -s "$(osascript -e 'id of app "macvim"')" $format all
done
declare -a decompressorFormats=(rar) #Add other formats here
for format in "${decompressorFormats[@]}"
do
duti -s "$(osascript -e 'id of app "Decompressor"')" $format all
done
declare -a imagejFormats=(tif tiff) #Add other formats here
for format in "${imagejFormats[@]}"
do
duti -s "$(osascript -e 'id of app "imagej"')" $format all
done
#----------------------------------------------------------------
## Clean and reboot:
read -p "Remove cached packages/images now ? (Y/N): " remove
if [ $remove = 'Y' ] || [ $remove = 'y' ]
then
rm -rf "$(brew --cache)"
brew cleanup
fi
echo -e '\n\tREBOOTING\n'
read -p "Reboot now ? (Y/N): " reboot
if [ $reboot = 'Y' ] || [ $reboot = 'y' ]
then
sudo shutdown -r now "Rebooting. Installation completed!";
fi