feat(yabai): update
Add 10th workspace Add `get_menu_bar_height` objc program
This commit is contained in:
parent
22ccaedc94
commit
26cafb1599
7 changed files with 148 additions and 45 deletions
|
@ -0,0 +1,21 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main() {
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSRect screenRect = [[NSScreen mainScreen] frame];
|
||||
NSRect visibleRect = [[NSScreen mainScreen] visibleFrame];
|
||||
|
||||
// Show the menu bar temporarily to get its height
|
||||
[NSMenu setMenuBarVisible:YES];
|
||||
|
||||
CGFloat menuBarHeight = screenRect.size.height - visibleRect.size.height;
|
||||
printf("%d\n", (int) menuBarHeight);
|
||||
|
||||
// Hide the menu bar again
|
||||
[NSMenu setMenuBarVisible:NO];
|
||||
|
||||
[pool drain];
|
||||
return 0;
|
||||
}
|
||||
|
||||
// vim: ft=objc :
|
Loading…
Add table
Add a link
Reference in a new issue