Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

@NSExceptional
Last activeMay 18, 2025 01:56
    • Star(0)You must be signed in to star a gist
    • Fork(0)You must be signed in to fork a gist
    Save NSExceptional/45faffa17b26e3064b66aa6a07b32abe to your computer and use it in GitHub Desktop.
    Some macOS tweaks I wrote
    • 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>
    %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
    //
    // 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 {
    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

    [8]ページ先頭

    ©2009-2025 Movatter.jp