miseでmacOSのDefaultsを管理する

公開

miseは開発で使うツールの管理を行うものと思っていたら、いつの間にか色々なことができるようになっていた。その一つにmacOSのDefaultsの設定がある。

https://mise.jdx.dev/bootstrap/macos-defaults.html

こういうのってシェルスクリプトで書いていたけど、miseで管理できた方がメンテしやすいのでよい。

miseの設定ファイルの config.toml に設定を記述する。

[bootstrap.macos.dock]
autohide = true
orientation = "left"
tilesize = 48
show_recents = false

[bootstrap.macos.finder]
show_all_files = true
show_pathbar = true
preferred_view_style = "list"

[bootstrap.macos.keyboard]
key_repeat = 2
initial_key_repeat = 15
press_and_hold = false

[bootstrap.macos.trackpad]
tap_to_click = true

[bootstrap.macos.defaults]
"com.apple.finder" = { AppleShowAllFiles = true }

設定したら、以下のコマンドを実行して現在の設定と比較する。

mise bootstrap macos defaults status

問題なければ、念のためDry Runする。

mise bootstrap macos defaults apply --dry-run

設定を反映するには、--dry-run を外して実行する。

mise bootstrap macos defaults apply

おわりに

miseはなんでもできていいね。