Skip to content

Instantly share code, notes, and snippets.

@grapswiz
Last active October 25, 2023 15:45
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grapswiz/60b8f20e661d04fbc9e1 to your computer and use it in GitHub Desktop.
Save grapswiz/60b8f20e661d04fbc9e1 to your computer and use it in GitHub Desktop.
Initial setup for Mac
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "robotsandpencils/made"
brew "anyenv"
brew "ffmpeg"
brew "git"
brew "git-lfs"
brew "graphviz"
brew "jq"
brew "mackup"
brew "mas"
brew "nkf"
brew "zsh-completions"
brew "robotsandpencils/made/xcodes"
cask "alfred"
cask "bettertouchtool"
cask "clipy"
cask "discord"
cask "docker"
cask "font-hackgen"
cask "font-hackgen-nerd"
cask "font-ipaexfont"
cask "google-chrome"
cask "google-cloud-sdk"
cask "google-japanese-ime"
cask "hammerspoon"
cask "insomnia"
cask "iterm2"
cask "jetbrains-toolbox"
cask "karabiner-elements"
cask "kindle"
cask "macdown"
cask "notion"
cask "slack"
cask "virtualbox"
cask "visual-studio-code"
cask "zoom"
mas "Affinity Designer", id: 824171161
mas "Microsoft Remote Desktop", id: 1295203466
mas "MindNode", id: 992076693
mas "OmmWriter", id: 412347921
mas "Pomy", id: 1422640635
mas "The Unarchiver", id: 425424353
#!/usr/bin/env zsh
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
# Two finger horizontal swipe
# 0 = Swipe between pages with one finger
# 1 = Swipe between pages
# 2 = Swipe between full screen apps with two fingers, swipe between pages with one finger (Default Mode)
defaults write com.apple.driver.AppleBluetoothMultitouch.mouse MouseTwoFingerHorizSwipeGesture -int 1
# Dock
defaults write com.apple.Dock showhidden -bool YES
defaults write com.apple.dock static-only -boolean true
defaults write com.apple.dock autohide -boolean true
# Keyboard
## Remap Caps Lock key to Control
keyboardid=$(ioreg -n IOHIDKeyboard -r | grep -E 'VendorID"|ProductID' | awk '{ print $4 }' | paste -s -d'-\n' -)'-0'
defaults -currentHost delete -g com.apple.keyboard.modifiermapping.${keyboardid}
defaults -currentHost write -g com.apple.keyboard.modifiermapping.${keyboardid} -array-add '<dict><key>HIDKeyboardModifierMappingDst</key><integer>2</integer><key>HIDKeyboardModifierMappingSrc</key><integer>0</integer></dict>'
# Finder
## 全ての拡張子のファイルを表示する
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
## 不可視ファイルを表示する
defaults write com.apple.finder AppleShowAllFiles YES
## フォルダを開くときのアニメーションを無効にする
defaults write com.apple.finder AnimateWindowZoom -bool false
## 名前で並べ替えを選択時にディレクトリを前に置くようにする
defaults write com.apple.finder _FXSortFoldersFirst -bool true
# Menu bar
## Show battery percentage
defaults write com.apple.menuextra.battery ShowPercent -string "YES"
defaults write com.apple.menuextra.battery ShowTime -string "NO"
## Date
defaults write com.apple.menuextra.clock DateFormat -string "M\\U6708d\\U65e5(EEE) H:mm:ss"
defaults write com.apple.menuextra.clock FlashDateSeparators -bool false
defaults write com.apple.menuextra.clock IsAnalog -bool false
## Screencapture
defaults write com.apple.screencapture location ~/Pictures/screenshots/
# Security & Privacy
## General: Allow applications downloaded from = Anyware
sudo spctl --master-disable
defaults write com.apple.screencapture location ~/Pictures/screenshots
# Kill affected applications
for app in Finder Dock SystemUIServer; do killall "$app" >/dev/null 2>&1; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment