diff --git a/apps/dock/dock.py b/apps/dock/dock.py index 5b31a79bbb..740113594a 100644 --- a/apps/dock/dock.py +++ b/apps/dock/dock.py @@ -1,5 +1,6 @@ from talon import Context, Module, actions, clip, ui from pathlib import Path +from typing import Optional ctx = Context() mod = Module() @@ -14,17 +15,17 @@ class Actions: def dock_send_notification(notification: str): """Send a CoreDock notification to the macOS Dock using SPI""" - def dock_app_expose(): - """Activate app Exposé using the macOS Dock item for the frontmost app""" + def dock_app_expose(app: Optional[ui.App] = None): + """Activate macOS app Exposé via its Dock item (for the frontmost app if not specified)""" @ctx.action_class("user") class UserActions: - def dock_app_expose(app: Optional[App]): + def dock_app_expose(app=None): if app is None: app = ui.active_app() - app_name = Path(ui.active_app().path).stem + app_name = Path(app.path).stem dock_items = ui.apps(bundle="com.apple.dock")[0].children.find( AXSubrole="AXApplicationDockItem", AXTitle=app_name, max_depth=1 )