Skip to content

Instantly share code, notes, and snippets.

@stephancasas
Created February 21, 2026 09:29
Show Gist options
  • Select an option

  • Save stephancasas/4645b5f524701060a532e7debd711e4f to your computer and use it in GitHub Desktop.

Select an option

Save stephancasas/4645b5f524701060a532e7debd711e4f to your computer and use it in GitHub Desktop.
macOS zsh utility for logging preference keys of a given process
logprefs () {
LOG_PROCESS="${*}"
log stream \
--level debug \
--style compact \
--predicate '((process == "'"$LOG_PROCESS"'") AND (subsystem == "com.apple.defaults") AND (eventMessage contains[cd] "for key")) AND NOT ((eventMessage contains[cd] "AppleLanguages") OR (eventMessage contains[cd] "cursorIsCustomized") OR (eventMessage contains[cd] "AppleReduceDesktopTinting") OR (eventMessage contains[cd] "reduceMotion"))' \
| perl -ne 'printf "%-70s %-70s\n", $1, $2 if /key (\S+) .*?Domain: ([^,]+)/'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment