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

Possible solution for detecting App Exposé and Windows Exposé signals and spaces reordering #2026

Closed
roelvangils opened this issue Dec 26, 2023 · 4 comments
Labels
suggestion Request for new feature or some form of enhancement

Comments

@roelvangils
Copy link

roelvangils commented Dec 26, 2023

I'm writing a little script that listens for an event for when you enter and exit Mission Control (and then does something).

I use this:

yabai -m signal --add event=mission_control_enter \
    action='(do something)'

yabai -m signal --add event=mission_control_exit \
    action='(do something else)'

These work well, but I have two additional requests:

  1. I want to distinguish between "App Exposé" mode, which displays windows from the current application only, and "Windows Exposé" mode, which provides an overview of all open windows grouped by application.

  2. I am also seeking a method to detect when a space thumbnail is moved (dragged to another position) in "App Exposé" mode. Currently, there is no spaces_reordered event available (although it may be added in the future, @koekeishiya?). Is there an alternative approach?

@roelvangils roelvangils changed the title Possible solution for detecting App Exposé and Windows Exposé modes and spaces reordering Possible solution for detecting App Exposé and Windows Exposé signals and spaces reordering Dec 26, 2023
@koekeishiya
Copy link
Owner

yabai already knows the difference between app expose, window expose and mission control, but does not propagate that information through the signal (I didn't think it would matter to the user, but I guess I was mistaken). It should be trivial to either add an environment variable to inform how mission control was activated, or create separate signals.

I do not know of any way to track when spaces themselves are reordered, so that problem I can't fix.

@roelvangils
Copy link
Author

It should be trivial to either add an environment variable to inform how mission control was activated, or create separate signals.

Ah, that is good to know! May I officially suggest it as a feature request? 🙂

@koekeishiya koekeishiya added the suggestion Request for new feature or some form of enhancement label Jan 2, 2024
@koekeishiya
Copy link
Owner

yabai -m signal --add event=mission_control_enter action="echo \$YABAI_MISSION_CONTROL_MODE"
yabai -m signal --add event=mission_control_exit action="echo \$YABAI_MISSION_CONTROL_MODE"

Possible values present when entering and exiting mission-control:

show-front-windows # app expose    / default swipe-down gesture
show-all-windows   # window expose / default swipe-up gesture
show-desktop       # reveal desktop

koekeishiya added a commit that referenced this issue Jan 3, 2024
@koekeishiya koekeishiya added addressed on master; not released Fixed upstream, but not yet released and removed addressed on master; not released Fixed upstream, but not yet released labels Jan 3, 2024
@roelvangils
Copy link
Author

Thanks, that's great! 😁 Now I can fix my script that position my Spaces labels below the thumbnails when in Windows Exposé mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Request for new feature or some form of enhancement
Projects
None yet
Development

No branches or pull requests

2 participants