iTranslated by AI
Adjusting the Spacing of macOS Menu Bar Extras and Status Menus
I will summarize the method for adjusting the spacing of menu bar extras / status menus located on the right side of the macOS menu bar.
(Since both names are used interchangeably, I've included both, but I will refer to them as "menu bar extras" from here on.)

Notch Problem
Particularly when using a MacBook with a notch, the center of the menu bar is divided by the notch. This causes an issue where, if many menu bar extras exist on the right side, items starting from the left end become hidden behind the notch. While one might expect a way to display these hidden items, the OS does not provide such a consideration, resulting in a compromised user experience.
Currently, no fundamental solution to this problem exists.
There are methods to hide or expand/collapse them using Bartender-like apps.
(Note: Bartender has currently been sold by the original developer to another party, and there are concerns regarding its development and management.)
- https://icemenubar.app
- https://matthewpalmer.net/vanilla/
- https://github.com/dwarvesf/hidden/
- https://github.com/Mortennn/Dozer/
- https://www.ortisoft.de/en/accessmenubarapps/
Preference Keys for Adjusting Spacing
A "hidden" key for setting the item spacing of menu bar extras has been discovered, and by using this, it is now possible to reduce the spacing from the user side.
NSStatusItemSpacingNSStatusItemSelectionPadding
You can set any value using the defaults command.
defaults -currentHost write -globalDomain NSStatusItemSpacing -int 10
defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 6
NSStatusItemSpacing sets the distance between items. Personally, I feel that about 10 is just right.
NSStatusItemSelectionPadding sets the width of the highlight (padding) while the menu is expanded. Since some say the minimum value is around 6, I thought 6 would be a good choice for the time being in terms of appearance.
To apply the settings, you need to restart the OS or log out and log back in. Restarting SystemUIServer will not reflect the changes.
Spacing 10 / Padding 6

NSStatusItemSpacing=10, NSStatusItemSelectionPadding=6
Setting NSStatusItemSpacing to 10 results in a slightly crowded look, but it fits nicely while avoiding the notch. If you want to narrow the gap, a range of 8–12 seems appropriate.
I set the selection padding to 6.
Spacing 8

NSStatusItemSpacing=8
With NSStatusItemSpacing=8, it becomes even more crowded.
Spacing 1

NSStatusItemSpacing=1
Setting NSStatusItemSpacing to 1 makes it extremely tight. This is a matter of preference, but I felt it lacked visual balance, so I didn't think it was necessary to go this far.
Padding 20

NSStatusItemSelectionPadding=20
Setting NSStatusItemSelectionPadding to 20 expands the highlight horizontally.
How to Reset
You can restore the system default state by deleting the settings themselves and then logging out and back in or restarting.
defaults -currentHost delete -globalDomain NSStatusItemSpacing
defaults -currentHost delete -globalDomain NSStatusItemSelectionPadding
Check Current Values
defaults -currentHost read -globalDomain NSStatusItemSpacing
defaults -currentHost read -globalDomain NSStatusItemSelectionPadding
Related Information
Discussion