Skip to content
Merged
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
6 changes: 3 additions & 3 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ let package = Package(
name: "MXSwipe",
platforms: [.macOS(.v26)],
dependencies: [
.package(url: "https://github.com/sparkle-project/Sparkle", exact: "2.9.4"),
.package(url: "https://github.com/mstallone/menuhub", exact: "0.2.0"),
.package(url: "https://github.com/mstallone/menuhub", exact: "0.3.0"),
],
targets: [
.executableTarget(
name: "MXSwipe",
dependencies: [
"SystemEvents",
.product(name: "Sparkle", package: "Sparkle"),
.product(name: "MenuHub", package: "menuhub"),
.product(name: "MenuHubSparkle", package: "menuhub"),
],
path: "Sources/MXSwipe",
swiftSettings: [.swiftLanguageMode(.v6)],
Expand Down
6 changes: 2 additions & 4 deletions Sources/MXSwipe/main.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import AppKit
import MenuHub
import MenuHubSparkle
import OSLog
import ServiceManagement
import Sparkle

let appName = "MXSwipe"

Expand All @@ -19,7 +19,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate {

private static let logger = Logger(subsystem: "com.mattstallone.mxmasterinput", category: "App")
private let session = MXMasterSession()
private let updater = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil)
private var hub: MenuHub?
private var connection: Task<Void, Never>?
private var retry: Task<Void, Never>?
Expand All @@ -41,7 +40,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {

func applicationDidFinishLaunching(_ notification: Notification) {
UserDefaults.standard.register(defaults: ["autoEnable": true])
hub = MenuHub(symbol: "computermouse") { self.section }
hub = MenuHub(symbol: "computermouse", updater: SparkleUpdater()) { self.section }
NSWorkspace.shared.notificationCenter.addObserver(self, selector: #selector(systemDidWake),
name: NSWorkspace.didWakeNotification, object: nil)
if isEnabled { connect() }
Expand Down Expand Up @@ -69,7 +68,6 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
.action(isEnabled ? "Turn Gestures Off" : "Turn Gestures On") { self.toggleEnabled() },
.separator,
.action("Open at Login", isOn: SMAppService.mainApp.status == .enabled) { self.toggleLogin() },
.action("Check for Updates…", isEnabled: updater.updater.canCheckForUpdates) { self.updater.checkForUpdates(nil) },
]
return MenuSection(header: header, items: items, isActive: status.isActive)
}
Expand Down
7 changes: 3 additions & 4 deletions Tools/make-readme-assets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ let barHeight: CGFloat = 24

/// The menu as MXSwipe shows it on its own, with the mouse connected.
@MainActor func makeMenu() -> NSMenu {
let mxswipe = Member(pid: 1, name: "MXSwipe", launched: Date(), yieldsIcon: false, revision: 0,
let mxswipe = Member(pid: 1, name: "MXSwipe", launched: Date(), yieldsIcon: false, checksForUpdates: true, revision: 0,
isActive: true, header: MenuHeader(title: "MX Master 4", detail: .battery(83)), items: [
.action("Turn Gestures Off") {}, .separator,
.action("Open at Login", isOn: true) {}, .action("Check for Updates…") {},
.action("Turn Gestures Off") {}, .separator, .action("Open at Login", isOn: true) {},
])
let menu = NSMenu()
MenuHub.populate(menu, with: [mxswipe], version: "0.3.0", target: nil)
MenuHub.populate(menu, with: [mxswipe], version: "0.3.2", canCheckForUpdates: true, target: nil)
return menu
}

Expand Down
Binary file modified assets/menu-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/menu-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.