Codify

macos-settings

A reference page for the macos-settings resource

The macos-settings resource manages common macOS system preferences using the built-in defaults command. It covers mouse, keyboard, trackpad, and Dock settings — everything you need to reproduce your preferred system configuration on a new Mac.

Parameters

All sections and their sub-keys are optional. You only need to declare the settings you want to manage.

mouse

ParameterTypeDefaultDescription
naturalScrollingbooleantrueScroll content in the natural direction (content follows finger). When false, uses the traditional scroll direction.
accelerationbooleantrueEnable mouse acceleration. When false, the cursor moves at a fixed speed regardless of how fast the mouse is moved.
speednumber (0–3)1.5Mouse tracking speed. Higher values make the cursor move farther per physical movement.

keyboard

ParameterTypeDefaultDescription
keyRepeatinteger6Rate of key repeat while a key is held. Lower = faster (1 is fastest; 120 effectively disables repeat).
initialKeyRepeatinteger68Delay before key repeat begins (in ticks). Lower = shorter delay (10 minimum).
pressAndHoldbooleantrueWhen true, holding a key shows the accent character picker. When false, the key repeats instead.
fnKeysAsStandardKeysbooleanfalseWhen true, the F1–F12 keys act as standard function keys; press Fn to trigger special actions (brightness, volume, etc.).
keyboardNavigationbooleanfalseWhen true, enables Tab-based focus navigation in system dialogs (equivalent to "Keyboard navigation" in System Settings).

trackpad

ParameterTypeDefaultDescription
speednumber (0–3)1.5Trackpad tracking speed. Higher values make the cursor move farther per swipe distance.

dock

ParameterTypeDefaultDescription
position"left" | "bottom" | "right""bottom"Position of the Dock on screen.
iconSizeinteger (16–128)48Dock icon size in pixels.
autohidebooleanfalseAutomatically hide and show the Dock when the cursor moves near the screen edge.
hoverDelaynumber0.2Seconds to wait before the Dock appears when hovering near the screen edge. Set to 0 for instant reveal.
animationSpeednumber0.5Duration in seconds of the Dock slide-in/out animation. Set to 0 to disable the animation entirely.
showRecentsbooleantrueShow recently opened apps in a dedicated section of the Dock.
minimizeEffect"genie" | "scale" | "suck""genie"Window minimize animation style.

macOS defaults mapping

The table below shows the underlying defaults key used for each friendly parameter name.

SectionParameterDomainKey
mousenaturalScrollingNSGlobalDomaincom.apple.swipescrolldirection
mouseaccelerationNSGlobalDomaincom.apple.mouse.linear (inverted)
mousespeedNSGlobalDomaincom.apple.mouse.scaling
keyboardkeyRepeatNSGlobalDomainKeyRepeat
keyboardinitialKeyRepeatNSGlobalDomainInitialKeyRepeat
keyboardpressAndHoldNSGlobalDomainApplePressAndHoldEnabled
keyboardfnKeysAsStandardKeysNSGlobalDomaincom.apple.keyboard.fnState
keyboardkeyboardNavigationNSGlobalDomainAppleKeyboardUIMode (0/2)
trackpadspeedNSGlobalDomaincom.apple.trackpad.scaling
dockpositioncom.apple.dockorientation
dockiconSizecom.apple.docktilesize
dockautohidecom.apple.dockautohide
dockhoverDelaycom.apple.dockautohide-delay
dockanimationSpeedcom.apple.dockautohide-time-modifier
dockshowRecentscom.apple.dockshow-recents
dockminimizeEffectcom.apple.dockmineffect

Example usage

Common macOS preferences

codify.jsonc
[
  {
    "type": "macos-settings",
    "os": ["macOS"],
    "mouse": {
      "naturalScrolling": true
    },
    "keyboard": {
      "keyRepeat": 2,
      "initialKeyRepeat": 15,
      "pressAndHold": false
    },
    "dock": {
      "position": "left",
      "iconSize": 36,
      "autohide": true,
      "showRecents": false
    }
  }
]

Non-Apple keyboard setup

codify.jsonc
[
  {
    "type": "macos-settings",
    "os": ["macOS"],
    "mouse": {
      "naturalScrolling": false,
      "acceleration": false
    },
    "keyboard": {
      "fnKeysAsStandardKeys": true
    }
  }
]

Trackpad speed only

codify.jsonc
[
  {
    "type": "macos-settings",
    "os": ["macOS"],
    "trackpad": {
      "speed": 2.5
    }
  }
]

Notes

  • This resource is macOS only and has no effect on Linux.
  • No software installation is required — defaults is a built-in macOS command.
  • Dock settings take effect immediately (the Dock is automatically restarted). Other settings typically take effect the next time you open an application or after logging out.
  • When the resource is removed from your configuration, all managed settings are reset to their macOS system defaults using defaults delete.
  • Changes to fnKeysAsStandardKeys may require a full system restart to take effect.
  • The keyRepeat and initialKeyRepeat values use macOS internal tick units, not milliseconds. Smaller values produce faster key repeat.

On this page