-
Notifications
You must be signed in to change notification settings - Fork 784
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
base: main
Are you sure you want to change the base?
Conversation
…on broke. Only works if the frontmost app has a dock icon.
apps/dock/dock.py
Outdated
|
||
@ctx.action_class("user") | ||
class UserActions: | ||
def dock_app_expose(): | ||
from pathlib import Path |
There was a problem hiding this comment.
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
apps/dock/dock.py
Outdated
def dock_app_expose(): | ||
from pathlib import Path |
There was a problem hiding this comment.
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?
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)
There was a problem hiding this comment.
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?
Co-authored-by: Phil Cohen <[email protected]>
for more information, see https://pre-commit.ci
Obsoletes #1608.