Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement app Exposé with accessibility since the CoreDock notification broke #1610

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

nriley
Copy link
Collaborator

@nriley nriley commented Nov 17, 2024

Obsoletes #1608.


@ctx.action_class("user")
class UserActions:
def dock_app_expose():
from pathlib import Path
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports should probably be at the file module level unless it's needed to break a circular import

Comment on lines 22 to 23
def dock_app_expose():
from pathlib import Path
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not something like this?

Suggested change
def dock_app_expose():
from pathlib import Path
def dock_app_expose(app: Optional[App]):
if app is None:
app = ui.active_app()

Than a user could choose to add:

<user.running_applications> window expose user.dock_app_expose(running_applications)

I've generally taken this pattern in my own scripts rather than hardcoding ui.active_app() inside of it; it makes the action more flexible (even if we don't ship this particular grammar in community, although I think it's useful)

Copy link
Collaborator Author

@nriley nriley Nov 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user.running_applications returns a str rather than a ui.App. But this works:

^window <user.running_applications>$:
    app = user.get_running_app(running_applications)
    user.dock_app_expose(app)

Seems OK?

nriley added a commit to nriley/talon_community that referenced this pull request Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants