Home
> Mac administration, Mac OS X > Programmatically hiding and unhiding the menubar in El Capitan
Programmatically hiding and unhiding the menubar in El Capitan
As my colleague @quovadimus82 has previously documented, OS X El Capitan includes a new option for showing and hiding the menubar.
This option is available in System Preferences, in the General preferences.
It is also possible to use the defaults command to set the menubar’s behavior. Here’s how you can set the menubar to be hidden and unhidden using defaults:
To hide:
defaults write NSGlobalDomain _HIHideMenuBar -bool true
To show:
defaults write NSGlobalDomain _HIHideMenuBar -bool false
Once run, logout and log back in to see the change in behavior. Alternatively, you can run the following command as the logged-in user to restart Finder and show the changes:
killall Finder
Categories: Mac administration, Mac OS X
Hello Rich,
Thanks for your wonderful blog. Nearly every Mac Sys Admin has used your site at least once.
I like this write up, but am curious if its possible to decrease the delay so the menu bar appears instantly, just like its possible with the dock like so:
defaults write com.apple.dock autohide -bool true && defaults write com.apple.dock autohide-delay -float 0 && defaults write com.apple.dock autohide-time-modifier -float 0 && killall Dock
Thanks again
Alan
Agreed Alan, have you found any way to reveal the menu bar faster with a terminal code? Thanks!!
I wish there was a way to mouse over the top bar and it reveals and sticks, and mouse over again and it disappears and stays disappears until you repeat the same. I like that I can hide it, but when I reveal it I want it to stay. I know I could do this Terminal commands, but I’ll love to be able to do it with a flick of the cursor to the top bar.
Trying to figure out a way to deploy this to the built-in Guest User in macOS. From what I have researched, may not be possible. Using JAMF Pro.
Tried on Catalina but doesn’t seem to work smoothly. However this Applescript method works by toggling the setting on/off and does it neatly in the background without need to kill Finder (I don’t want to mess up with open Finder windows).
https://ryan.warner.codes/hide-show-mac-menu-applescript/
You could check for the state of the setting first to decide if it’s on or not if you need so with:
defaults read NSGlobalDomain _HIHideMenuBar