Skip to content

Commit 06f692e

Browse files
committed
macos: add macos setup
1 parent b127e5f commit 06f692e

File tree

7 files changed

+2907
-8
lines changed

7 files changed

+2907
-8
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
ansible
2-
SCRATCHPAD
2+
SCRATCHPAD.md

alacritty/alacritty.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
window:
2-
opacity: 0.85
2+
opacity: 0.90
33
env:
44
TERM: xterm-256color
5-
#font:
6-
# normal:
7-
# family: FiraCode Nerd Font Mono
5+
font:
6+
normal:
7+
family: Monaco
8+
size: 12

app/com.visualstudio.code/vscode-linux-keybindings.json

Lines changed: 2694 additions & 0 deletions
Large diffs are not rendered by default.

lf/lfrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ map <c-b> mark-remove
6464

6565
map gh cd ~
6666
map gv cd ~/dev
67-
map gd cd ~/docs
68-
map gD cd ~/downloads
67+
map gd cd ~/Documents
68+
map gl cd ~/Downloads
6969
map gm cd ~/media
7070

7171
## 3/settings
@@ -88,7 +88,7 @@ map D set info
8888

8989
# commands
9090

91-
cmd extract ${{
91+
cmd ex ${{
9292
set -f
9393
case $f in
9494
*.tar.*) tar xavf $f;;

macos/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# macOS Setup
2+
3+
* System Settings
4+
5+
Finder
6+
Sidebar
7+
Show items
8+
Recents
9+
Documents
10+
Downloads
11+
$user
12+
Spotlight
13+
Search results
14+
Applications
15+
System Settings
16+
Keyboard Shortcuts
17+
Mission Control
18+
Move left a space = Ctrl-Cmd-Down
19+
Move right a space = Ctrl-Cmd-Up
20+
Switch to Desktop 1-4 = Opt-1-4
21+
Modifier Keys
22+
Control key = Globe
23+
Globe key = Control
24+
25+
* Firefox
26+
27+
Config
28+
- browser.cache.disk.enable = false
29+
- browser.cache.memory.capacity = 65536
30+
- dom.ipc.processCount = 2
31+
- dom.ipc.processCount.webIsolated = 2
32+
- gfx.webrender.all = true
33+
- media.av1.enabled = false
34+
- media.hardware-video-decoding.force-enabled = true
35+
Extensions
36+
- Firefox Multi-Account Container
37+
- h264ify
38+
- uBlock Origin

macos/config.fish

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
if status is-interactive
2+
# Commands to run in interactive sessions can go here
3+
eval "$(/opt/homebrew/bin/brew shellenv)"
4+
fish_add_path "$HOME/.cargo/bin"
5+
fish_add_path "$HOME/Library/Python/3.10/bin"
6+
set -gx JAVA_HOME "$(/usr/libexec/java_home -v 11)"
7+
set -gx NODE_CLUSTER esprit
8+
set -gx NODE_SERVICE_IP 127.0.0.1
9+
end

macos/setup.sh

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
#!/usr/bin/env bash
2+
3+
apps=(
4+
# internet
5+
firefox
6+
google-chrome
7+
# office
8+
libreoffice
9+
# utils
10+
appcleaner
11+
rectangle
12+
zerotier-one
13+
# dev
14+
android-studio
15+
intellij-idea-ce
16+
visual-studio-code
17+
)
18+
19+
appstore=(
20+
# iMovie
21+
408981434
22+
)
23+
24+
dev=(
25+
# lang
26+
go
27+
node
28+
openjdk
29+
30+
# ops
31+
ansible
32+
fabric
33+
podman
34+
qemu
35+
terraform
36+
# tools
37+
cmake
38+
git-delta
39+
maven
40+
ninja
41+
sbt
42+
tig
43+
tokei
44+
wrk
45+
)
46+
47+
utils=(
48+
bat
49+
exa
50+
fd
51+
fish
52+
fzf
53+
glow
54+
htop
55+
lf
56+
lnav
57+
mas
58+
micro
59+
ncdu
60+
rclone
61+
ripgrep
62+
tealdeer
63+
telnet
64+
)
65+
66+
install_apps() {
67+
brew install --cask "${apps[@]}"
68+
}
69+
70+
install_appstore() {
71+
mas install "${appstore[@]}"
72+
}
73+
74+
install_dev() {
75+
brew install "${dev[@]}"
76+
}
77+
78+
install_utils() {
79+
brew install "${utils[@]}"
80+
}
81+
82+
config_system() {
83+
sudo systemsetup -settimezone "America/New_York" > /dev/null
84+
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
85+
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
86+
}
87+
88+
config_user() {
89+
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null
90+
91+
# System
92+
defaults write NSGlobalDomain AppleLanguages -array "en-US"
93+
defaults write NSGlobalDomain AppleLocale -string "en_US"
94+
# Appearance
95+
defaults write NSGlobalDomain AppleInterfaceStyle -string "Dark"
96+
# Enable subpixel font rendering on non-Apple LCDs
97+
# Reference: https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501
98+
defaults write NSGlobalDomain AppleFontSmoothing -int 1
99+
# Dock
100+
defaults write com.apple.Dock autohide -bool true
101+
defaults write com.apple.Dock autohide-delay -float 0.1
102+
defaults write com.apple.Dock autohide-time-modifier -float 0
103+
defaults write com.apple.Dock show-process-indicators -bool true
104+
defaults write com.apple.Dock wvous-bl-corner -int 1
105+
defaults write com.apple.dock wvous-bl-modifier -int 0
106+
defaults write com.apple.Dock wvous-br-corner -int 13
107+
defaults write com.apple.dock wvous-br-modifier -int 0
108+
defaults write com.apple.Dock wvous-tl-corner -int 2
109+
defaults write com.apple.dock wvous-tl-modifier -int 0
110+
defaults write com.apple.Dock wvous-tr-corner -int 1
111+
defaults write com.apple.dock wvous-tr-modifier -int 0
112+
# Finder
113+
defaults write com.apple.finder _FXSortFoldersFirst -bool true
114+
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
115+
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
116+
defaults write com.apple.finder NewWindowTargetPath -string "file:///${HOME}/";
117+
defaults write com.apple.finder QuitMenuItem -bool true
118+
defaults write com.apple.finder ShowPathbar -bool false
119+
defaults write com.apple.finder ShowStatusBar -bool false
120+
# Keyboard
121+
defaults write com.apple.HIToolbox AppleFnUsageType -int 0
122+
# Trackpad/Mouse
123+
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
124+
defaults write NSGlobalDomain com.apple.trackpad.scaling -float 1.5
125+
# Shortcuts
126+
defaults write NSGlobalDomain NSUserKeyEquivalents -dict \
127+
Cut "^x" \
128+
Copy "^c" \
129+
Paste "^v" \
130+
Undo "^z" \
131+
Redo "^\$z" \
132+
"Select All" "^a"
133+
defaults write org.mozilla.firefox NSUserKeyEquivalents -dict \
134+
"New Tab" "^t" \
135+
"New Window" "^n" \
136+
"Close Tab" "^w" \
137+
"Find in Page..." "^f"
138+
}
139+
140+
config_reset() {
141+
defaults write com.apple.dock persistent-apps -array
142+
}
143+
144+
main() {
145+
case "$1" in
146+
install-apps) install_apps ;;
147+
install-appstore) install_appstore ;;
148+
install-dev) install_dev ;;
149+
install-utils) install_utils ;;
150+
config-system) config_system ;;
151+
config-user) config_user ;;
152+
config-reset) config_reset ;;
153+
*) echo "Invalid action ${1}!"; exit 1 ;;
154+
esac
155+
}
156+
157+
main $*

0 commit comments

Comments
 (0)