FelixKratz / SketchyBar

A highly customizable macOS status bar replacement
https://felixkratz.github.io/SketchyBar/
GNU General Public License v3.0
6.23k stars 94 forks source link

Kill Menu Bar #294

Closed jaden-falls closed 1 year ago

jaden-falls commented 1 year ago

Is there anyway that I could kill the menu bar itself so it won't appear again? I'm willing to change any system files

FelixKratz commented 1 year ago

This has been discussed here: #281 and here: #229

The solution in #281 includes inserting a global mouse move event tap, such that the menu bar is not notified of the mouses proximity.

Generally, the problem with the system menu bar on macOS is that it is drawn directly from the WindowServer, such that it is not possible to just kill the process as then no windows at all would show.

We interface with the WindowServer via the SkyLight framework and there are some functions that modify the behavior of the system menu bar, however, not all of them can be called from any application and might need elevated port rights only the system has (i.e. a code injection into some authorized system process would be required to call these functions successfully).

Some functions can be called from sketchybar directly (these are private and undocumented functions found by looking at the binary code of the SkyLight framework):

extern CGError SLSSetMenuBarVisibilityOverrideOnDisplay(int cid, int did, bool override);
extern CGError SLSSetMenuBarAutohideEnabled(int cid, bool enabled);

but as you can see those are not really helpful for completely disabling the bar.