I'm trying to programmatically (shell) control MacOS auto-hide feature of menu bar, but could not find working solution.
For controlling manu bar auto-hide on regular desktop I can use AppleScript similar to this:
tell application "System Events"
set autohide menu bar of dock preferences to true
end tell
To control full screen window I found that there is AppleMenuBarVisibleInFullscreen from -globalDomain
.
defaults read -globalDomain AppleMenuBarVisibleInFullscreen
This setting is changing indeed by system preferences application, but changing it with CLI does not work at all. Menu bar in fullscreen application does not seem to be affected at all. I tried like that:
defaults write -globalDomain AppleMenuBarVisibleInFullscreen -bool true
Am I missing some preference refresh call or changing wrong property? I would like to avoid clicking through system preferences using AppleScript.