Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
build-and-test:
runs-on: macos-14
steps:
- uses: actions/checkout@v4

- name: Build
run: |
xcodebuild \
-scheme Hummingbird \
-configuration OpenSource \
build \
CODE_SIGN_IDENTITY="-" \
DEVELOPMENT_TEAM=""

- name: Test
run: |
xcodebuild \
-scheme Hummingbird \
-configuration Test \
test \
CODE_SIGN_IDENTITY="-" \
DEVELOPMENT_TEAM=""
58 changes: 25 additions & 33 deletions Hummingbird.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = HB;
LastUpgradeCheck = 1200;
LastUpgradeCheck = 1600;
ORGANIZATIONNAME = finestructure;
TargetAttributes = {
65CF01611F229C34002259F2 = {
Expand Down Expand Up @@ -545,7 +545,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 13.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
Expand All @@ -563,14 +563,14 @@
GCC_PREFIX_HEADER = "Hummingbird/Hummingbird-Prefix.pch";
INFOPLIST_FILE = "Hummingbird/Hummingbird-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 3.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "co.finestructure.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Hummingbird;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG COMMERCIAL";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 5.9;
WRAPPER_EXTENSION = app;
};
name = Test;
Expand All @@ -583,21 +583,19 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = A42K5AU657;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = HummingbirdTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "TEST COMMERCIAL";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 5.9;
};
name = Test;
};
Expand Down Expand Up @@ -645,7 +643,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 13.0;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
};
Expand All @@ -663,13 +661,13 @@
GCC_PREFIX_HEADER = "Hummingbird/Hummingbird-Prefix.pch";
INFOPLIST_FILE = "Hummingbird/Hummingbird-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 3.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "co.finestructure.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Hummingbird;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = RELEASE;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 5.9;
WRAPPER_EXTENSION = app;
};
name = OpenSource;
Expand All @@ -682,20 +680,18 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = A42K5AU657;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = HummingbirdTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "RELEASE COMMERCIAL";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 5.9;
};
name = OpenSource;
};
Expand All @@ -707,21 +703,19 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = A42K5AU657;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = HummingbirdTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG COMMERCIAL";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 5.9;
};
name = Debug;
};
Expand All @@ -733,20 +727,18 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = A42K5AU657;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = HummingbirdTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "RELEASE COMMERCIAL";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 5.9;
};
name = Release;
};
Expand Down Expand Up @@ -800,7 +792,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 13.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
Expand Down Expand Up @@ -850,7 +842,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 13.0;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
};
Expand All @@ -868,14 +860,14 @@
GCC_PREFIX_HEADER = "Hummingbird/Hummingbird-Prefix.pch";
INFOPLIST_FILE = "Hummingbird/Hummingbird-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 3.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "co.finestructure.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Hummingbird;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG COMMERCIAL";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 5.9;
WRAPPER_EXTENSION = app;
};
name = Debug;
Expand All @@ -892,13 +884,13 @@
GCC_PREFIX_HEADER = "Hummingbird/Hummingbird-Prefix.pch";
INFOPLIST_FILE = "Hummingbird/Hummingbird-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 3.3.0;
PRODUCT_BUNDLE_IDENTIFIER = "co.finestructure.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Hummingbird;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "RELEASE COMMERCIAL";
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 5.9;
WRAPPER_EXTENSION = app;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1600"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion Hummingbird/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import os
import UserNotifications


@NSApplicationMain
@main
class AppDelegate: NSObject, NSApplicationDelegate {

@IBOutlet weak var statusMenu: NSMenu!
Expand Down
1 change: 1 addition & 0 deletions Hummingbird/CGEvent+ext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import CoreGraphics


extension CGEvent {
Expand Down
4 changes: 3 additions & 1 deletion Hummingbird/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ struct Links {
static let retrieveLicenseKey = URL(string: "mailto:%22Hummingbird%20Help%22%3csas+hb-help@finestructure.co%3e?subject=Lost%20license%20key&body=I've%20lost%20my%20license%20key%20%F0%9F%98%9E.%20Could%20you%20please%20send%20it%20again%3F"
)!

static let securitySystemPreferences = URL(fileURLWithPath: "/System/Library/PreferencePanes/Security.prefPane/")
static let accessibilitySettings = URL(
string: "x-apple.systempreferences:com.apple.settings.PrivacySecurity.extension?Privacy_Accessibility"
)!

static func gumroadTip(size: TipSize) -> URL {
URL(string: "https://gum.co/hb-tip-\(size.rawValue)?wanted=true")!
Expand Down
6 changes: 3 additions & 3 deletions Hummingbird/Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ func showAccessibilityAlert() {
alert.informativeText = """
Hummingbird requires Accessibility permissions in order to be able to move and resize windows for you.

You can grant Accessibility permissions in "System Preferences" → "Security & Privacy" → "Privacy" → "Accessibility".
You can grant Accessibility permissions in "System Settings" → "Privacy & Security" → "Accessibility".

Click "Help" for more information.

"""
alert.addButton(withTitle: "Open System Preferences")
alert.addButton(withTitle: "Open System Settings")
alert.addButton(withTitle: "Help")
switch alert.runModal() {
case .alertFirstButtonReturn:
NSWorkspace.shared.open(Links.securitySystemPreferences)
NSWorkspace.shared.open(Links.accessibilitySettings)
case .alertSecondButtonReturn:
NSWorkspace.shared.open(Links.hummingbirdAccessibility)
default:
Expand Down
18 changes: 8 additions & 10 deletions Hummingbird/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,15 @@ enum LogLevel: String {


private func _log(_ level: LogLevel = .default, _ message: StaticString, _ args: CVarArg...) {
if #available(OSX 10.14, *) {
let type: OSLogType
switch level {
case .default: type = .default
case .debug: type = .debug
case .info: type = .info
case .error: type = .error
case .fault: type = .fault
}
os_log(type, message, args)
let type: OSLogType
switch level {
case .default: type = .default
case .debug: type = .debug
case .info: type = .info
case .error: type = .error
case .fault: type = .fault
}
os_log(type, message, args)
}


Expand Down
1 change: 1 addition & 0 deletions Hummingbird/Modifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import CoreGraphics


protocol Kind {
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ brew tap finestructure/Hummingbird
brew install finestructure/hummingbird/hummingbird
```

Hummingbird has been tested on macOS 10.14 Mojave and 10.15 Catalina but it should run on earlier macOS versions as well (macOS 10.11 or higher).
Hummingbird requires macOS 13 (Ventura) or later. It has been tested on recent macOS releases including Apple Silicon Macs.

## Usage

- After launching, Hummingbird is accessible via a menu bar item:

<img src="assets/docs/menu-expanded.png" width="320">

- However, on first use you will need to grant permissions for Accessibility Access. This is required so Hummingbird can move and resize windows. You will see an alert directing you to System Preferences:
- However, on first use you will need to grant permissions for Accessibility Access. This is required so Hummingbird can move and resize windows. You will see an alert directing you to System Settings:

<img src="assets/docs/accessibility-alert.png" width="573">

- In System Preferences / Security & Privacy / Privacy, please authenticate and make sure the entry for "Hummingbird" under "Accessibility" is checked as indicated below.
- In System Settings → Privacy & Security → Accessibility, please authenticate and make sure the entry for "Hummingbird" under "Accessibility" is checked as indicated below.

<img src="assets/docs/sytem-preferences-accessibility.png" width="780">

Expand Down