Skip to content

Instantly share code, notes, and snippets.

@NSExceptional
Last active May 18, 2025 01:56
Show Gist options
  • Save NSExceptional/45faffa17b26e3064b66aa6a07b32abe to your computer and use it in GitHub Desktop.
Save NSExceptional/45faffa17b26e3064b66aa6a07b32abe to your computer and use it in GitHub Desktop.
Some macOS tweaks I wrote

macOS tweaks

  • Make toolbars in AppKit compact where possible
  • Hide useless menu bar items in Chrome
  • Minor fixes to FaceTime.app
//
// Created by Tanner Bennett on 2022-09-22
// Copyright © 2022 Tanner Bennett. All rights reserved.
//
#import <AppKit/AppKit.h>
%hook NSWindow
- (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
//
// 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
//
// 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 {
return NO;
}
%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
%hook NSWindow
- (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 free to join this conversation on GitHub. Already have an account? Sign in to comment