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 true
Use a 24-hour clock:
defaults write com.apple.menuextra.clock Show24Hour -bool true
Use an analogue clock face:
defaults write com.apple.menuextra.clock IsAnalog -bool true
Show the day of the week:
defaults write com.apple.menuextra.clock ShowDayOfWeek -bool true
Show the date:
defaults write com.apple.menuextra.clock ShowDate -int 1
Values 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 true
Set 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 SystemUIServer
Battery
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 true
Bluetooth
Show the Bluetooth icon in the menu bar:
defaults write com.apple.systemuiserver "NSStatusItem Visible com.apple.menuextra.bluetooth" -bool true
Rearranging 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.systemuiserver
Notes
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: