Useful macOS defaults: Menu Extras
com.apple.menuextra.* domains control the small icons in the right side of the menu bar. On older macOS versions (before Ventura), these were the main way to manage menu bar items.
How menu extras work
Each menu bar icon is a separate "menu extra". They live at /System/Library/CoreServices/Menu Extras/ and have a .menu extension. The system tracks which ones are loaded and visible.
On macOS Ventura and later, most menu extras moved into Control Centre, managed by com.apple.controlcenter. The old menuextra domains still work for some items.
Clock settings
Show seconds in the menu bar clock:
defaults write com.apple.menuextra.clock ShowSeconds -bool trueUse a 24-hour clock:
defaults write com.apple.menuextra.clock Show24Hour -bool trueUse an analogue clock face:
defaults write com.apple.menuextra.clock IsAnalog -bool trueShow the day of the week:
defaults write com.apple.menuextra.clock ShowDayOfWeek -bool trueShow the date:
defaults write com.apple.menuextra.clock ShowDate -int 1Values for ShowDate:
0= when space allows1= always2= never
Flash the time separators (the colon blinks each second):
defaults write com.apple.menuextra.clock FlashDateSeparators -bool trueSet a custom date and time format using Unicode date format patterns:
defaults write com.apple.menuextra.clock DateFormat -string "EEE d MMM HH:mm:ss"Common patterns:
EEE= short day name (Mon, Tue)d= day of monthMMM= short month name (Jan, Feb)HH= hour in 24-hour formatmm= minutesss= seconds
After changing clock settings:
killall SystemUIServerBattery
Show battery percentage in the menu bar:
defaults write com.apple.menuextra.battery ShowPercent -string "YES"On newer macOS versions, this lives in the Control Centre domain instead:
defaults -currentHost write com.apple.controlcenter BatteryShowPercentage -bool trueBluetooth
Show the Bluetooth icon in the menu bar:
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.bluetooth" -bool trueRearranging menu extras
You can rearrange menu bar icons by holding Command and dragging them. You can remove most third-party ones by Command-dragging them off the menu bar.
System icons like the clock, Control Centre, and Spotlight cannot be removed.
Read current settings
defaults read com.apple.menuextra.clock
defaults read com.apple.menuextra.battery
defaults read com.apple.systemuiserverNotes
The split between com.apple.menuextra.* and com.apple.controlcenter can be confusing. As a rule: on macOS Monterey and earlier, use menuextra domains. On Ventura and later, use controlcenter for most items, but menuextra.clock still works for clock settings.
Enjoyed this post?
Well, you could share the post with others, follow me with RSS Feeds and/or send me a comment via email.
Tags
Category:
Tags:
Year: