-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
85 lines (71 loc) · 3.97 KB
/
setup.py
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
import sys
import os
import json
with open('./config.json') as configFile:
config = json.load(configFile)
################################################### System Settings ###################################################
if "osx" in sys.argv:
#print("[OSX]: Wallpaper")
#os.system('''osascript -e 'tell application "Finder" to set desktop picture to POSIX file "'''+config["OSXsettings"]["wallpaper_path"]+''''"''')
print("[OSX]: Screensaver")
os.system('''defaults -currentHost write com.apple.screensaver moduleDict -dict moduleName '''+ config["OSXsettings"]["screensaver_moduleName"]+'''path '''+ config["OSXsettings"]["screensaver_path"] +''' type 0''')
os.system("defaults -currentHost write com.apple.screensaver idleTime " + config["OSXsettings"]["screensaver_idleTime"])
print("[OSX]: Display Sleep")
os.system("sudo pmset -c displaysleep " + config["OSXsettings"]["displaySleep_charger"])
os.system("sudo pmset -b displaysleep " + config["OSXsettings"]["displaySleep_battery"])
print("[OSX]: Keyboard and Mouse/Trackpad")
os.system("defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int " + config["OSXsettings"]["trackpad_tapBehavior"])
os.system("defaults write -g com.apple.swipescrolldirection -bool " + config["OSXsettings"]["scrollDirection"])
os.system("defaults write -g InitialKeyRepeat -int " + config["OSXsettings"]["InitialKeyRepeat"])
os.system("defaults write -g KeyRepeat -int " + config["OSXsettings"]["KeyRepeat"])
os.system("defaults write -g ApplePressAndHoldEnabled -bool " + config["OSXsettings"]["ApplePressAndHoldEnabled"])
print("[OSX]: DOCK SETTINGS")
os.system("defaults write com.apple.Dock autohide-delay -float " + config["OSXsettings"]["dock_Autohide-delay"])
os.system("defaults write com.apple.dock show-recents -bool " + config["OSXsettings"]["dock_show-recents"])
os.system("defaults write com.apple.dock autohide -bool " + config["OSXsettings"]["dock_autohide"])
os.system("killall Dock")
else:
print("[OSX]: SKIPPING")
################################################### Install Homebrew ###################################################
if "installbrew" in sys.argv:
os.system('''/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"''')
else:
print("[installbrew]: SKIPPING")
################################################### Install Homebrew Packages ###################################################
if "brew" in sys.argv:
for b in config["brew"]:
os.system("brew install " + b)
else:
print("[brew]: SKIPPING")
################################################### Install Homebrew Cask Packages ###################################################
if "cask" in sys.argv:
for c in config["cask"]:
os.system("brew install --cask " + c)
else:
print("[cask]: SKIPPING")
################################################### Install Visual Studio Code Extensions ###################################################
if "code" in sys.argv:
for e in config["codeExtension"]:
os.system("code --install-extension " + e)
else:
print("[code]: SKIPPING")
################################################### Install AppStore Apps ###################################################
if "appStore" in sys.argv:
for a in config["appStore"]:
os.system("mas install " + a)
else:
print("[appStore]: SKIPPING")
################################################### Setup Dock Applicationsm###################################################
if "dock" in sys.argv:
os.system("dockutil --remove all")
print("[DOCK]: Starting Dock Setup")
for app in config["dockOrder"]:
os.system("dockutil --add " + app)
else:
print("[DOCK]: SKIPPING")
################################################### Runs other commands ###################################################
if "other" in sys.argv:
for other in config["other"]:
os.system(other)
else:
print("[other]: SKIPPING")