Power Users Guide
Advanced workflows for getting the most out of macprefs.
Integration with Dotfiles
Section titled “Integration with Dotfiles”Recommended: GNU Stow Integration
Section titled “Recommended: GNU Stow Integration”Use GNU Stow to manage your macprefs config as a symlink alongside other dotfiles:
# Dotfiles structure with stow packages~/.dotfiles/├── Brewfile # Include: brew "jmcombs/macprefs/macprefs"├── install.sh # Main setup script├── zsh/ # Stow package for shell config│ └── .zshrc├── git/ # Stow package for git config│ └── .gitconfig└── macprefs/ # Stow package for macprefs config └── .config/ └── macprefs/ └── macos-config.json # Your curated preferencesBrewfile entry:
tap "jmcombs/macprefs"brew "jmcombs/macprefs/macprefs" # Fully qualified tap/formula name requiredinstall.sh integration (add after stow deployment):
#!/bin/bashset -e
# Deploy dotfiles with stowstow zsh git macprefs
# Apply macOS preferencesMACPREFS_CONFIG="$HOME/.config/macprefs/macos-config.json"
echo "Applying macOS system preferences..."if command -v macprefs &> /dev/null; then if [ -f "$MACPREFS_CONFIG" ]; then # Interactive mode - user reviews and confirms each setting macprefs apply --config "$MACPREFS_CONFIG" else echo "Warning: macprefs config not found at $MACPREFS_CONFIG" fielse echo "Warning: macprefs not installed. Run: brew install jmcombs/macprefs/macprefs"fi
# Prompt for reboot (some settings require it)echo ""echo "Some macOS preference changes require a reboot to take effect."read -p "Would you like to reboot now? (y/N): " reboot_choiceif [[ "$reboot_choice" =~ ^[Yy]$ ]]; then sudo shutdown -r nowfiBasic Dotfiles Integration
Section titled “Basic Dotfiles Integration”For simpler setups without stow:
# In your dotfiles repository~/.dotfiles/├── .zshrc├── .gitconfig├── macprefs.json # Your curated preferences└── setup.shsetup.sh:
#!/bin/bashset -e
echo "Applying macOS preferences..."if command -v macprefs &> /dev/null; then macprefs apply --config ~/.dotfiles/macprefs.jsonelse echo "macprefs not installed. Run: brew install jmcombs/macprefs/macprefs"fi
echo "Restarting affected services..."killall Dock Finder SystemUIServer 2>/dev/null || trueAdvanced: Modular Configuration
Section titled “Advanced: Modular Configuration”Split your config for different contexts:
~/.dotfiles/├── macprefs/│ ├── base.json # Core preferences (always applied)│ ├── personal.json # Home Mac additions│ └── work.json # Work Mac additions└── setup.shApply based on context:
macprefs apply --config ~/.dotfiles/macprefs/base.jsonmacprefs apply --config ~/.dotfiles/macprefs/personal.json # or work.jsonPartial Configurations
Section titled “Partial Configurations”Create focused configs for specific use cases instead of one monolithic file:
{ "version": "1.0", "domains": { "com.apple.dock": { "autohide": true, "orientation": "left", "tilesize": 48 } }}{ "version": "1.0", "domains": { "com.apple.finder": { "AppleShowAllExtensions": true, "ShowPathbar": true, "FXPreferredViewStyle": "Nlsv" } }}{ "version": "1.0", "domains": { "NSGlobalDomain": { "AppleKeyboardUIMode": 3, "com.apple.keyboard.fnState": true } }}Apply specific configs as needed:
macprefs apply --config dock.jsonmacprefs apply --config keyboard.jsonDomain Discovery
Section titled “Domain Discovery”Find which domain controls a specific preference:
# List all available domainsmacprefs list
# List keys in a specific domainmacprefs list --domain com.apple.dock
# Inspect current values for specific keysmacprefs inspect --domains com.apple.dock --keys autohide,tilesize,orientationComparing State
Section titled “Comparing State”Before applying, always preview changes:
# Summary viewmacprefs plan --config my-prefs.json
# Detailed view of all changesmacprefs plan --config my-prefs.json --verboseRollback Strategy
Section titled “Rollback Strategy”If something goes wrong after applying:
# Rollback to the previous state (Free tier)macprefs rollback
# Rollback to a specific run (Pro+ only)macprefs rollback --run-id 2026-01-04T10-30-00Snapshots are automatically created before each apply and stored in:
~/Library/Application Support/macprefs/runs/
Discovering Keys via defaults
Section titled “Discovering Keys via defaults”The native defaults command is useful for exploring preferences:
# Read all values for a domaindefaults read com.apple.dock
# Read a specific keydefaults read com.apple.dock autohide
# Export entire domain to stdoutdefaults export com.apple.dock -Community Resources
Section titled “Community Resources”- macOS Defaults — Curated database of macOS preference keys with descriptions and examples