How to never show bar in full screen [duplicate]

Solution 1:

  • Save the following AppleScript to a file named fullscreen.scpt:

    use framework "AppKit"
    use scripting additions
    
    repeat with runningApp in current application's NSWorkspace's sharedWorkspace's runningApplications()
        if runningApp's isActive()
            set frontApp to (localizedName of runningApp) as text
            exit repeat
        end if
    end repeat
    
    tell application "System Events"
        tell process frontApp to set isFullScreen to value of attribute "AXFullScreen" of first window
        if frontApp = "Finder"
            tell process frontApp to set value of attribute "AXFullScreen" of first window to not isFullScreen
        else if isFullScreen
            do shell script "lsappinfo setinfo -app " & quoted form of frontApp & " ApplicationType=Foreground"
            tell process frontApp to set value of attribute "AXFullScreen" of first window to false
    
            (*fix to make sure the menu bar is not stuck*)
            delay 0.42
            tell application "Finder" to activate
            tell process frontApp to set frontmost to true
        else
            do shell script "lsappinfo setinfo -app " & quoted form of frontApp & " ApplicationType=UIElement"
            tell process frontApp to set value of attribute "AXFullScreen" of first window to true
        end if
    end tell
    
  • From terminal, compile it to an application with the following command:

    osacompile -o "/Applications/Full Screen.app" fullscreen.scpt
    
  • Open the Full Screen.app's Info.plist (e.g. vim '/Applications/Full Screen.app/Contents/Info.plist') and add the following to the dict:

        <key>NSUIElement</key>
        <true/>
    
  • Add Full Screen.app as an exception in System Preferences > Security & Privacy > Privacy > Accessibility.

  • Launch Automator and create a new Service.

  • Change "Service receives" to "no input in any application".
  • Add a Library > Utilities > Launch Application action.
  • Configure the action to launch the previously created Full Screen application.
  • Save the service as Full Screen and close Automator.
  • On System Preferences > Keyboard > Shortcuts > Services, scroll down to the bottom of the list and the just created Full Screen service should be listed there. Associate an unique Command shortcut for it, like Shift+Command+\ or Command+F11 for example.

This creates a shortcut to cause an application to enter full screen while removing the menu bar, or to exit full screen bringing the menu bar back. It provides an alternative full screen shortcut!

For application-specific full screen launchers, check my other answer.

Caveats

There may be some disadvantages and/or misbehavior using this approach:

  • It works by setting ApplicationType=UIElement, which causes the application icon not be added/highlighted in the Dock and make the application inaccessible via Command+Tab. The Command+Tab issue was reported in comments, I didn't notice it since I mostly use the Mission Control overview to change between full screen applications.
  • It may not behave as expected for some specific applications, I've noticed issues with the Activity Monitor application (which is generally not used full screen anyway) and there's a report on Chrome, which I didn't try since I use Firefox and it works great.

Solution 2:

The menu bar can NOT be hidden on command whenever you like to due to limitations in Mac OS X. Apple can do this in their own programs but they have NOT made it possible for other developers in Mac OS X. One of the reasons being that Apple Menu sits on the Menu bar and is helpful if the application becomes unresponsive or if the user needs to log off /shutdown the machine.

There is an application called Menu Eclipse which lets you change the Menu Bar behaviors(except for hide it).