Instantly share code, notes, and snippets.
Last activeMay 18, 2025 01:56
Save NSExceptional/45faffa17b26e3064b66aa6a07b32abe to your computer and use it in GitHub Desktop.
Some macOS tweaks I wrote
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| // | |
| // Created by Tanner Bennett on 2022-09-22 | |
| // Copyright © 2022 Tanner Bennett. All rights reserved. | |
| // | |
| #import<AppKit/AppKit.h> | |
| %hookNSWindow | |
| - (void)setToolbarStyle:(NSWindowToolbarStyle)toolbarStyle { | |
| %orig(NSWindowToolbarStyleUnifiedCompact); | |
| } | |
| - (void)display { | |
| if (self.toolbarStyle != NSWindowToolbarStyleUnifiedCompact) { | |
| self.toolbarStyle = NSWindowToolbarStyleUnifiedCompact; | |
| } | |
| %orig; | |
| } | |
| - (BOOL)makeFirstResponder:(NSResponder *)responder { | |
| if (self.toolbarStyle != NSWindowToolbarStyleUnifiedCompact) { | |
| self.toolbarStyle = NSWindowToolbarStyleUnifiedCompact; | |
| } | |
| return%orig; | |
| } | |
| %end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| // | |
| // Created by Tanner Bennett on 2022-09-22 | |
| // Copyright © 2022 Tanner Bennett. All rights reserved. | |
| // | |
| #import<AppKit/AppKit.h> | |
| %hook AppController | |
| - (void)applicationDidFinishLaunching:(NSNotification *)notification { | |
| %orig; | |
| NSArray<NSMenuItem *> *items =NSApp.mainMenu.itemArray; | |
| if (items.count <7)return; | |
| // Hide "Bookmarks" and "Profile" so that the menu bar | |
| // doesn't spill over the notch when Chrome is open | |
| items[5].hidden =YES; | |
| items[6].hidden =YES; | |
| } | |
| %end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| // | |
| // Created by Tanner Bennett on 2022-12-10 | |
| // Copyright © 2022 Tanner Bennett. All rights reserved. | |
| // | |
| #import<AppKit/AppKit.h> | |
| // Don't ever pause my video when I switch apps or spaces | |
| %hook VideoPauseUtility | |
| + (BOOL)shouldPauseSendingVideo:(id)controller { | |
| returnNO; | |
| } | |
| %end | |
| // Allow resizing the window even smaller than normally allowed | |
| %hook VideoCallController | |
| - (void)_createWindowWithSize:(NSSize)size minSize:(NSSize)minSize { | |
| minSize =CGSizeMake(minSize.width /2.f, minSize.height /2.f); | |
| %orig; | |
| } | |
| %end | |
| %hookNSWindow | |
| - (void)setContentMinSize:(NSSize)minSize { | |
| minSize =CGSizeMake(670/2,420/2); | |
| %orig; | |
| } | |
| - (void)setMinSize:(NSSize)minSize { | |
| minSize =CGSizeMake(670/2,420/2); | |
| %orig; | |
| } | |
| %end |
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment