File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,3 +48,9 @@ clean: ## dotfiles のシンボリックリンクを削除する
4848.PHONY : upgrade
4949upgrade : # # 管理対象ツールを更新する
5050 @$(MISE_TASK ) dotfiles:upgrade
51+
52+ # # macOS ##
53+
54+ .PHONY : macos
55+ macos : # # macOS の defaults を適用する
56+ @$(MISE_TASK ) macos:defaults
Original file line number Diff line number Diff line change @@ -17,5 +17,6 @@ mise install
1717mise run zsh:refresh-completion
1818mise run nvim:treesitter
1919mise run fonts:install
20+ mise run macos:defaults
2021
2122prek install --overwrite --install-hooks
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # MISE description="macOS の defaults を適用する"
3+ set -euo pipefail
4+
5+ TASK_DIR=" $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " && pwd -P) "
6+ readonly TASK_DIR
7+ REPO_ROOT=" $( git -C " ${TASK_DIR} " rev-parse --show-toplevel) "
8+ readonly REPO_ROOT
9+ cd " ${REPO_ROOT} "
10+
11+ ./scripts/apply-macos-defaults.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ SCRIPT_DIR=" $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " && pwd) "
5+ readonly SCRIPT_DIR
6+ # shellcheck source=scripts/common.sh
7+ source " ${SCRIPT_DIR} /common.sh"
8+
9+ if ! is_macos; then
10+ skip " macOS 以外のため defaults の適用をスキップします"
11+ exit 0
12+ fi
13+
14+ info " macOS の defaults を適用します"
15+
16+ # Finder
17+ defaults write com.apple.finder AppleShowAllFiles -bool true
18+ defaults write com.apple.finder ShowPathbar -bool true
19+ defaults write com.apple.finder ShowStatusBar -bool true
20+ defaults write com.apple.finder FXPreferredViewStyle -string " Nlsv"
21+ defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
22+ defaults write com.apple.finder _FXShowPosixPathInWindowTitle -bool true
23+ defaults write com.apple.finder _FXSortFoldersFirst -bool true
24+
25+ # Global
26+ defaults write -g AppleShowAllExtensions -bool true
27+
28+ # Keyboard repeat
29+ defaults write -g InitialKeyRepeat -int 10
30+ defaults write -g KeyRepeat -int 2
31+
32+ # 長押しでアクセント記号メニューを出さず、キーリピートを有効化
33+ defaults write -g ApplePressAndHoldEnabled -bool false
34+
35+ # テキスト自動置換(コードを壊す系)を無効化
36+ defaults write -g NSAutomaticQuoteSubstitutionEnabled -bool false
37+ defaults write -g NSAutomaticDashSubstitutionEnabled -bool false
38+ defaults write -g NSAutomaticPeriodSubstitutionEnabled -bool false
39+ defaults write -g NSAutomaticCapitalizationEnabled -bool false
40+ defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false
41+
42+ killall Finder > /dev/null 2>&1 || true
43+
44+ success " macOS の defaults を適用しました(キーリピート系はログアウト後に反映)"
You can’t perform that action at this time.
0 commit comments