-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·117 lines (100 loc) · 5.25 KB
/
install.sh
File metadata and controls
executable file
·117 lines (100 loc) · 5.25 KB
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
#!/bin/zsh
set -e
DOTFILES_DIR="$HOME/.dotfiles"
if [ ! -d "$DOTFILES_DIR" ]; then
echo "Error: Dotfiles directory not found at $DOTFILES_DIR"
echo "Please clone the repo to $DOTFILES_DIR first."
exit 1
fi
# Install xCode cli tools
if ! xcode-select -p &>/dev/null; then
echo "Installing commandline tools..."
xcode-select --install
echo "Waiting for Xcode CLI Tools installation to complete..."
until xcode-select -p &>/dev/null; do
sleep 5
done
echo "Xcode CLI Tools installed."
else
echo "Xcode CLI Tools already installed."
fi
# Install Brew
if ! command -v brew &>/dev/null; then
echo "Installing Brew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Brew already installed."
fi
brew analytics off
sudo softwareupdate --install-rosetta
# Prompt to log in to App Store (required for mas)
echo "Please make sure you are logged in to the App Store (required for mas installs)."
echo "Press Enter to continue..."
read -r
# Install apps via Brewfile
echo "Installing apps..."
brew bundle install --file="$DOTFILES_DIR/Brewfile"
# Install lua packages
echo "Installing Lua packages..."
luarocks install luasocket
luarocks install luasec
luarocks install dkjson
# macOS Settings
echo "Changing macOS defaults..."
defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.spaces spans-displays -bool false # one space per display
defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0.4
defaults write com.apple.dock "mru-spaces" -bool "false" # do not sort spaces by recently uses
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false # disable animations for opening/closing windows
defaults write com.apple.LaunchServices LSQuarantine -bool false # turn off the "Application Downloaded from Internet" quarantine warning
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
defaults write NSGlobalDomain _HIHideMenuBar -bool true
defaults write NSGlobalDomain AppleHighlightColor -string "0.65098 0.85490 0.58431"
defaults write NSGlobalDomain AppleAccentColor -int 1
defaults write com.apple.screencapture location -string "$HOME/Desktop"
defaults write com.apple.screencapture disable-shadow -bool true
defaults write com.apple.screencapture type -string "png"
defaults write com.apple.finder DisableAllAnimations -bool true
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowMountedServersOnDesktop -bool false
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
defaults write com.apple.finder ShowStatusBar -bool false
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder _FXSortFoldersFirst -bool true
defaults write com.apple.finder CreateDesktop -bool false
defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool YES
defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 5
defaults -currentHost write -globalDomain NSStatusItemSpacing -int 0
# Install custom keyboard layout system-wide
echo "Installing custom keyboard layout..."
KEYLAYOUT_SRC="$DOTFILES_DIR/custom/us_international_wo_deadkeys.keylayout"
KEYLAYOUT_DEST="/Library/Keyboard Layouts/us_international_wo_deadkeys.keylayout"
if [[ ! -f "$KEYLAYOUT_DEST" ]] || ! cmp -s "$KEYLAYOUT_SRC" "$KEYLAYOUT_DEST"; then
sudo install -m 644 -o root -g wheel "$KEYLAYOUT_SRC" "$KEYLAYOUT_DEST"
echo "Keyboard layout installed."
else
echo "Keyboard layout already up to date."
fi
# Set custom layout as the only enabled input source (removes system default USInternational-PC)
defaults write com.apple.HIToolbox AppleEnabledInputSources -array \
'<dict><key>InputSourceKind</key><string>Keyboard Layout</string><key>KeyboardLayout ID</key><integer>16383</integer><key>KeyboardLayout Name</key><string>U.S. International w/o dead keys</string></dict>' \
'<dict><key>Bundle ID</key><string>com.apple.CharacterPaletteIM</string><key>InputSourceKind</key><string>Non Keyboard Input Method</string></dict>' \
'<dict><key>Bundle ID</key><string>com.apple.PressAndHold</string><key>InputSourceKind</key><string>Non Keyboard Input Method</string></dict>'
defaults write com.apple.HIToolbox AppleSelectedInputSources -array \
'<dict><key>InputSourceKind</key><string>Keyboard Layout</string><key>KeyboardLayout ID</key><integer>16383</integer><key>KeyboardLayout Name</key><string>U.S. International w/o dead keys</string></dict>' \
'<dict><key>Bundle ID</key><string>com.apple.PressAndHold</string><key>InputSourceKind</key><string>Non Keyboard Input Method</string></dict>'
killall Finder
killall SystemUIServer
# SbarLua
(git clone https://github.com/FelixKratz/SbarLua.git /tmp/SbarLua && cd /tmp/SbarLua/ && make install && rm -rf /tmp/SbarLua/)
# Copying and checking out configuration files
echo "Planting Configuration Files..."
rcup -v
# Start Services
echo "Starting Services (grant permissions)..."
brew services start felixkratz/formulae/sketchybar