Skip to content

Add switch-windows-yabai extension #20133

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

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

Conversation

rsnullptr
Copy link

@rsnullptr rsnullptr commented Jun 29, 2025

Description

  • Extension to leverage Raycast to use Yabai on a new way to switch windows
  • Allows of windows and app switching
  • Leverages yabai for several usages like: disperse windows of screens, move windows to screens

Screencast

Screenshot 2025-06-29 at 22 34 26 Screenshot 2025-06-29 at 22 34 44 Screenshot 2025-06-29 at 22 34 57

Checklist

- added guidelines to gitignore
- added missing app icons
- changes shortcuts for move and disperse commands.
- close raycast on already focused window selection
- move window to display
- move window to display
- refined search
- added applications list
- lint
- using fuse for query
- improvements
- fix readme
- fix linter
- fix linter
- disperse windows to specific displays working
- disperse windows working across all screens
- changed toaster message
- fix lint
- fix lint
- first alpha version
- aggregate app windows in one space
- aggregate app windows in one space
- close window working with list refresh
- close window working
- ordered by usage
- working extesnion. still drafting.
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Jun 29, 2025
@raycastbot
Copy link
Collaborator

Congratulations on your new Raycast extension! 🚀

You can expect an initial review within five business days.

Once the PR is approved and merged, the extension will be available on our Store.

- fix lint
- fix tsc errors
@rsnullptr rsnullptr marked this pull request as ready for review June 29, 2025 21:42
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

New extension that enhances Yabai window management with advanced window switching, display management, and space control capabilities through Raycast interface.

  • Needs yabai path preference similar to existing yabai extension in package.json for consistent configuration
  • Core functionality in src/switch-windows-yabai.tsx provides fuzzy search and window management with Fuse.js integration
  • Implementation includes display management features in src/display-actions-yabai.tsx for dispersing and moving windows across screens
  • Code uses showToast for error handling but should be updated to use showFailureToast from @raycast/utils for consistency
  • Some dependency versions in package.json need updating to align with Raycast's requirements

11 files reviewed, 4 comments
Edit PR Review Bot Settings | Greptile

Comment on lines +113 to +115
if (!displays || displays.length <= 1) {
return <Action title="Move to Another Display (Only 1 Available)" onAction={() => {}} />;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Empty onAction handler for single display case. Should show a toast or feedback to user instead of silently doing nothing

Comment on lines +326 to +328
} catch {
/*ignore, error will be thrown*/
}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Empty catch block should at least log the error. Current comment suggests error will be thrown but it's actually being silently swallowed.

Suggested change
} catch {
/*ignore, error will be thrown*/
}
} catch (error) {
console.error("Failed to focus first space:", error);
}

}

// Step 4: Disperse each window to its corresponding space
for (let i = 0; i < windows.length - 1; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Loop condition windows.length - 1 leaves out the last window. Should be just windows.length.

Suggested change
for (let i = 0; i < windows.length - 1; i++) {
for (let i = 0; i < windows.length; i++) {

@@ -0,0 +1,44 @@
# Yabai Window Switcher for Raycast
Copy link
Contributor

Choose a reason for hiding this comment

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

style: The title should match exactly with package.json's 'title' field ('Switch Windows (yabai)')

Suggested change
# Yabai Window Switcher for Raycast
# Switch Windows (yabai)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new extension Label for PRs with new extensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants