Hacker News new | past | comments | ask | show | jobs | submit login
Yabai – A tiling window manager for macOS (github.com/koekeishiya)
302 points by CathalMullan 10 months ago | hide | past | favorite | 218 comments



Funny to see this at the top of HN after just having uninstalled Yabai. I used Yabai for about 6 weeks. I was so thrilled about having a proper tiling window manager for Mac. I invested a lot of time setting up skhd and fine-tuning my configuration for the most intuitive hotkeys. The problem ultimately, however, is that Yabai just doesn't work well enough. It'll regularly just lose track of windows altogether, which requires restarting Yabai. This and other bugs happened frequently enough that it outweighed the benefits of Yabai. I'd be more than willing to try another tiling window manager on Mac if there's one out there that truly works. Related, I started checking out Stage Manager and it's pretty bad in my experience - obviously it's the opposite of a keyboard driven TWM, but I'm willing to try anything that helps me maximize the limited screen space I have. I'm all ears if anyone has had better experiences with other tools on Mac.


You might try Magnet. It's $10 on the mac app store. I've had zero issues with it, and it has some problems sorted that other tools don't or haven't always, namely correctly tiling across monitors. I used to use Rectangle, which is open source and frankly pretty good but at the time I was using it had some warts. macOS' window management seems to not be entirely transparent. I don't know all the details, but this is my workstation. I need(ed) this to work now, and if it's a system that might change a bit over time or has some weird idiosyncrasies then I'm happily willing to pay a low one-time fee for a tool like this.


If you don't mind me asking, what are the warts? I'm always interested in improving the app.


One difference I've noticed is that with Magnet, if you have a window 'maximized' by dragging it into the top of the screen or pressing the shortcut for it, when you start dragging it down from the top of the screen to unmaximize it, it instantly returns to its original size, whereas with Rectangle it stays maximized for some time after you start dragging it which is pretty annoying.

Another thing is the way Magnet moves and resizes windows seems to create less visual 'flashing' than Rectangle's method, for instance Rectangle will resize, then move, then resize again when maximizing a window, which can create a really pronounced 'flashing' effect. That's not to say Magnet has no 'flashing' ever, there's certain situations where it does and to my understanding it seems necessary due to the limited nature of moving and resizing windows on macOS (I guess you have to do one then the other and can't both move and resize simultaneously?), but to me Magnet's methods often look visually better.

Rectangle is great though, I've switched to it from Magnet and these are just some minor gripes.


Good to know! I'm surprised that Magnet has any improvement over Rectangle in these areas, since Rectangle isn't really adding any overhead to the Accessibility API commands, but I'll have to investigate.


Rectangle Pro user here -- biggest frustration I've had is configuration. While the GUI is nice for seeing all the options and some basic stuff, when it comes to actually configuring App Layouts it's been a nightmare of clicking around. I went so far as to export my config so I could modify it with a text editor and then re-import it but the config itself includes serialized JSON as values so to accomplish what I wanted to I had to de-serialize the json, make the changes I wanted to, re-serialize it, then re-import it back into Rectangle, all while hoping I didn't mess up the re-serialization step. This ended up taking more time than if I had just painfully clicked through the interface.

Personally, I wish Rectangle had the option of storing configuration in a simple dot file in my home dir but I understand that would prevent syncing through icloud, which is a feature I imagine a lot of folks like. Barring that, I wish rectangle could export/import the configuration in a more editor friendly way so I could make these configuration changes much faster and more easily ensure consistency across settings.


Thanks for the feedback! I agree and have had some ideas for improving this - one of them being copy/paste and drag behavior where you could copy a selection in Rectangle Pro and paste it as prettified JSON in an editor, and vice-versa. The dot file idea is also one that I like - it's just a surprisingly large effort to "do it right". Making UI's for representing this complexity is kind of tricky, and what's there now is actually my first cut - something that I figured I would iterate on but haven't gotten the time together to do it.


Are you the Rectangle dev? I appreciate your work! How did you get into developing tools for macOS? Were you filling your own needs?


Glad you like my software! A long time ago, I had some RSI issues that were alleviated by using the Magic Trackpad, and this led me to create the Multitouch app[0] to add a bit more functionality to the Magic Trackpad. From there I wanted to add in window management, and ended up rewriting Spectacle as Rectangle. I feel really lucky to have people enjoying the things I've built!

[0]https://multitouch.app


You do great work!


I have had a quick look at Rectangle. I'm currently using Hammerspoon, but it has problems moving windows quickly and precisely, so I wanted to see if Rectangle does better.

The main thing missing for me is being able to use mouse buttons to move windows: I have a Kensington Expert Mouse and I use buttons 3 and 4 for some actions.

Actually, the built-in keyboard shortcuts for moving spaces with Mission Control have the same problem, so I have configured Hammerspoon to turn the mouse clicks into key presses. I suppose I could do the same thing with Rectangle, tho it's annoying to have to rely on multiple apps.


You know, honestly I don't recall. From what I do remember, I had checked the repo and I believe it was something you were working on but it was going to require a really big lift. I wanted to be very charitable with you in my above comment. I used Rectangle for a decent amount of time and overall it was pretty great. I only switched because of a time/money consideration, not because of a vote of no confidence, which is not something I can always say. Keep up the great work!


Rectangle has worked well for me in the past, but recently, it's been losing a lot of windows. I often have to restart Brave to get Rectangle to be able to control it again.


I've been using Magnet for years. It's simple and reliable.


Has anyone transitioned from moom to magnet?


Why would you pay for magnet when you can use rectangle, which is the same but open source? https://github.com/rxhanson/Rectangle


Magnet rocks. Very worth paying for. I hate using Macs without it


I love magnet as well, have used it probably most of the last few jobs I've worked. The hot keys can be a little tricky to learn at first but after that it's a snap (heh).


I just bought this, but I don't see an option for automatic tiling?


It can’t do automatic tiling, it’s a window snapping/resizing app


Actually, only $5.


I haven't had the same experience with Yabai. I've been using it happily and without issue since April, and I don't think I've had to restart it once.

Before Yabai I was using Amethyst, but like your experience with Yabai, I felt like it would suddenly stop working and needed to be restarted. Maybe your experience would be flipped.

https://github.com/ianyh/Amethyst


I tried amethyst but it was essentially useless to emulate an awesomewm or sway like experience.

Switching to asahilinux was a *far* better solution. Not really sure what the use of macOS for me is when asahi exists now.


Is Asahi your daily driver on MBP?


Curious about this as well...I thought it wasn't quite there as a daily driver OS, but would be happy to be wrong ;-)


It's usable if you can live with some small annoying inconveniences last I tried. I can't remember if there were more inconveniences but what bugged me the most was that the touchpad was too sensitive compared to MacOS, it seemed to register accidental touches on the edges more and accidental taps were easier. I tried figuring out if this is fixable with libinput or hwdb but eventually gave up. Also the shortcuts with Command key are way more convenient than the ctrl ones but this probably is configurable somehow. Some Java programs had scaling issues but that can be configured to work properly. Battery life was a bit worse I think, this is with the GPU drivers and no video playback, just regular browsing. Oh and external monitor support isn't there, I do use this sometimes on MacOS.


Yes, absolutely.

Asahilinux >> MacOS

It's wonderful to use the M2 with incredible battery life and performance without having to have a subpar OS.


Can I ask: is setting up dual-boot trivial? I’d love to check it out but can’t ditch MacOS entirely.


The installation process sets it up to you. You'd have to do more work to not have dual-boot (unless there was a setting in the installer that I forgot).


AFAIK dual boot is currently the only way to use Asahi on Apple Silicon Macs.


Is there anything that doesn't work for you?


I'm not parent, but from my quick foray into (Fedora) Asahi on a Macbook Air M2, I at least noticed USB-C connection to my monitor and USB router behind it not working at all. There's something Mac-specific going on there, because from my x86-based linux laptop, this usually works fine.


same here! using yabai on my MacOS machines for about a year now, after being similarly disappointed with amethyst. Works pretty damn good for me, its a god send for me. It is part of the myriad of tweaks that make MacOS so damn good and unique to me.


Have you heard of Phoenix [1]? It seems relatively unknown but I actually found it to work better than Yabai in some ways. The gist is that it basically simulates a tiling wm and virtual desktops by internally tracking state. This also means it doesn't suffer from window animation delays when you switch "desktops" (since "desktops" are just hiding/unhiding windows). It's also highly hackable/extensible being written in JS. Spin2Win [2] is a config that's worked well for me.

[1] https://github.com/kasper/phoenix

[2] https://github.com/nik3daz/spin2win

That said, it seems there are no perfect solutions. At work where I can't really be futzing around with window management config I basically just use Raycast + hotkeys and try to keep everything inside maximized application windows. This means using Arc browser (tabbed), iTerm (tabbed), VS Code (with native tabs), etc mapped to cmd+1, cmd+2, cmd+3...Not much "tiling" going on but at least everything is pretty keyboard friendly.


Does this allow using the mouse? Maybe not common amongst tiling window users but I like to just drag a window over another to swap them or resize one window from the frame and have the other tiles adjust accordingly. So far it seems only Amethyst and Yabai do this, but if Phoenix internally tracks the states of windows (position, etc.) then this should be feasible to write code for without relying on Mac's windowing api?


Yeah if I recall correctly there is support for the mouse and doing all the kinds of things you usually use mouse for in tiling wm setups.


Phoenix requires a little more futzing around than Yabai, but I like it much better. I had tried Yabai and had to switch back to Phoenix because of all the problems stated here about Yabai.

It’s fewer bells and whistles out of the box, but it works well.


I think I had come across Phoenix briefly, but never took it for a spin. Thanks for the recommendation, I'll definitely take a look.


> I'd be more than willing to try another tiling window manager on Mac if there's one out there that truly works

Hello, AeroSpace author speaking :)

I'd be happy if you could try AeroSpace (it's and i3-like window manager for macOS) and report me back if it loses track of windows.

https://github.com/nikitabobko/AeroSpace

The architecture of AeroSpace is that on every user input that may change window configuration (new window created, window moved, window resized, new app launched, etc), AeroSpace runs the same idempotent operation (I call it "refresh session") that tries to detect new window, checks all invariants, re-layouts windows, etc.

The "refresh session" performs all the mentioned steps regardless of the user input nature (it doesn't matter whether the window is moved, or a new app is launched)

I believe that this architecture may lose windows only if the macOS API returns invalid data.

I have been using AeroSpace for quite a while myself and I'm happy with it


Just tried it and my initial impressions are hugely positive. The main things missing that I frequently use like wrap around for focus and assigning applications to specific workspaces already have open issues that you've engaged on too!

I've been using i3 for over a decade now and hate using any computer that doesn't have it, been trying to find a suitable substitute for my work mac for ages. Amethyst, rectangle, magnet, yabai, each had its own problems. The virtual workspace idea is genius and solves some of the biggest issues with those alternatives. This is by far the closest thing to i3 on mac I've seen. Thank you so much for making this.

My suggestion: open up a way to take donations to the project, and/or sell a packaged version on the mac app store. I'd be happy to pay good money for this.


Very cool, looks great. Seems to hew pretty closely to i3 from what I could tell in the demo video. Will definitely give this a try. Thanks for your work on this!


The demo looks pretty nice! I'll be trying this out over the weekend and report any issues. Thanks for building this!


After trying yabai, Amethyst, and many others, I landed on hammerspoon.org + https://github.com/miromannino/miro-windows-manager a few years ago and haven't looked back. I couldn't live on a Mac without hammerspoon tbh.


Yeah I'm using hammerspoon & miro too with this basic binding:

```

hs.window.animationDuration = 0.2 spoon.MiroWindowsManager:bindHotkeys({ up = {hyper, "up"}, right = {hyper, "right"}, down = {hyper, "down"}, left = {hyper, "left"}, fullscreen = {hyper, "f"} })

```

Works well enough for years.


Can you share your config please? Trying to get a better idea of what's possible and how to get started. Thanks


My full hammerspoon config is a mix of things I've collected/written over the years, but the Miro-specific section is simply:

  -- window management
  hs.loadSpoon("MiroWindowsManager")
  -- set to 0.x for animation, 0 for none
  hs.window.animationDuration = 0.3

  spoon.MiroWindowsManager:bindHotkeys({
    up = { hyper, "k" },
    down = { hyper, "j" },
    left = { hyper, "h" },
    right = { hyper, "l" },
    fullscreen = { hyper, "f" },
    nextscreen = { hyper, "n" }
  })


try hammerspoon. it isn't a tiling window manager, per se - it's more of an all-purpose desktop extension framework. it is fully customizable, has a well-documented API, and a large community.

for window arrangement the hs.grid component is plenty for me. see an example: https://www.youtube.com/watch?v=nRJ0477KFp8


Hammerspoon is literally the only thing I miss from leaving macOS.

If I ever have to go back, it'll be one of the first things I install again.



I use the PaperWM spoon, a port of the Gnome thing.

It does not make sense to me to use a "normal" tilling wm that automatically messes up windows' dimensions without asking me

I just need the windows to be automatically put side by side:

[1] https://github.com/mogenson/PaperWM.spoon

[2] https://github.com/paperwm/PaperWM


Check out https://github.com/agzam/spacehammer if you're using Hammerspoon.


There's also somewhat similar extension for Hammerspoon: https://github.com/FryJay/MenuHammer/


I use hammerspoon with https://github.com/miromannino/miro-windows-manager...it's a great tiling experience.


Do you have a config example I can look at that demonstrates how to set this up?


I've used Yabai for about three years now, it generally only forgets windows or specifically their states if you use the swipe multi tasking features. However when this happens I have a keybind and Skhd command which quickly restarts the daemon [1] and fixes the windows.

It takes a little while to get used it, but Yabai is now an app I can't live without.

1: launchctl kickstart -k "gui/${UID}/homebrew.mxcl.yabai"


I have the exact same setup, I have to maybe restart the service 2-3x a week. Unsurprisingly, outlook is often the culprit of needing to restart the service

# Reload yabai ctrl + shift + alt -r : launchctl kickstart -k "gui/${UID}/homebrew.mxcl.yabai"


This may not be what you’re looking for, but I use Mizage’s Divvy on Mac & Windows and configure Gnome to match on Linux. It can be keyboard or mouse driven — I exclusively use custom keyboard shortcuts.


I used to use Divvy (and have a paid copy), but I've moved to Rectangle which also does everything I need and is open source. It doesn't have the same "drag" mouse capabilities that Divvy does, but I don't end up using that too often.


I've also been using Divvy since as long as I can remember but it hasn't been updated in 4 years, looks like abandonware.


So basically, it's below the "Reliability*Utility" threshold (that's my term for the drastic dropoff in usefulness of a product/service/person when their reliability goes from 100% to 90% or lower) That's too bad. Maybe some unit tests (historically notoriously difficult to implement with GUI's) would help that dev.

Fleshing my concept out on a whim (since I am surprised I can't find another reference to this idea online!) with the help of ChatGPT (yes, it can do this now!), it looks like this equation would capture this concept:

U(r)=Umax ⋅e^(−k(100−r)^n)

where the total perceived Utility of a product/service/trusted person, given r=reliability percent (out of 100), is the maximum Utility times e to the (-k(100-r)^n), where k and n are tweakable based on the given product/service/person but which I want to assign values of 0.03 and 1.5 to, respectively, after plotting it.


> So basically, it's below the "Reliability*Utility" threshold (that's my term for the drastic dropoff in usefulness of a product/service/person when their reliability goes from 100% to 90% or lower)

Useful concept, that's exactly it.


That was my experience also especially the past year. I do programming and design and it seems many apps twist the ui api to do things that you can't naturally do in the interface and so Yabai, completely oblivious to it, will try to manage it and you have elements disappearing or appearing too large/small, behind other elements, etc. Even if you create exceptions, it seems things sometimes slip through the crack or start behaving unexpectedly. Flipping between native tabs for instance start throwing the tiling off for some apps that I use.

Yabai used to be pretty solid and usable, but I think with the author not using a Mac for his daily and with all the updates to the OS that he has to keep track of (and how some windowing Mac api are still blackboxed or not reliant to build logic atop of) it's only a matter of time before it gets into a poorer state.


I've certainly run into my problems with Yabai and have had to work through different versions to solve problems. It's certainly not perfect still but I've found a pretty stable workflow for me. I would certainly recommend turning off anything that's not nessiary like window borders. After that you'll need special configuration for a couple problematic apps (Chrome for me), and lastly some custom behavior using the events to get the exact behavior I want. I have had to debug and look at logs to figure out my problems..


Rectangle is absolutely great


Rectangle seems nice, but not quite what I'm looking for. I want automatic tiling. I'm not looking to just move some windows around with shortcuts. I want to be able to have predefined arrangements and automatic tiling, etc. Rectangle is similar to SizeUp which I've used. Good for what it is, but still want a true tiling window manager.


I had a similar experience. I find the default windowing experience on Macs to be miserable and so I was excited to jump in to a tiling WM, but Yabai was a pain to configure relative to linux tiling managers and was not reliable.


https://github.com/ianyh/Amethyst

This is what I used for years. Sadly I'm back in Windows land these days due to work.


I‘m using Windows again as well (just loving the crap-/bloatware for corporate vpn, syncing powerpoint templates, group policies etc.) which is why I made a small window manager in AutoHotkey:

https://github.com/imawizard/MiguruWM

The wiki also contains a list of other window managers for Windows one might want to check out.


Nothing out there quite works like i3 because they all politely ask the actual window manager to set the position/size of windows. i3 controls the position and size of windows.


I just use Grid, it already has shortcuts (I don't like that Yabai doesn't) and it's pretty easy to get used to.


Why wouldn't apple allow to remove all animations when switching desktops, without disabling SIP?

https://apple.stackexchange.com/questions/434555/can-you-com...

Native keyboard shortcuts are there for all to use to switch desktops, but the fading in/out animations that last around 1s completely prevent fast desktop switches as is so useful in i3/sway.


You might want to check out AeroSpace :) https://github.com/nikitabobko/AeroSpace

AeroSpace reimplements workspaces by emulating them. https://github.com/nikitabobko/AeroSpace/blob/main/docs/guid...

The result is that workspace switching is instant, and disabling SIP is not required

Note: I'm the author of AeroSpace


This is awesome.


When I looked this up on an apple support forum, the replies were all basically: "Why would you want to disable this feature? Apple designers know better than you, go back to Windows"


They're not wrong. When you buy an Apple product and try to customize it you're not doing what it's made for. It's like trying to use a golf club to hit a baseball.


this is one of my biggest annoyances about macOS. I actually want to keep the vast majority of animations, the only one I want gone is the desktop transition, because it feels so jarring.

Either make the transition instant, or bring back the old behavior where the dock and desktop remain static during the slide animation.


I've been using Yabai + skhd for years, and found the benefits far outweigh the issues. 99% of the time it's fine, and for the 1% I just disable it temporarily.

Killer feature for me (apart from windows automatically being resized to fit, which is great), is ctrl+i to switch to screen i, and ctrl+shift+i to move the current window to screen i. I tend to have 2 windows max per screen, and use Yabai to flit between screens / flit windows to different screens.

(I used i3 on Linux prior to setting up Yabai, and configured shortcuts to be similar to i3.)


In my personal experience, tiling window managers only work when you have a lot of screen real estate. I tried using yabai on a 13 inch m2 air, but I ended up going back to my normal workflow of just alt tabbing between windows. Most apps don’t let you see enough content when they are tiled (because of gui elements such as sidebar etc). I do love the “focus on hover” feature of yabai though. I wish macOS had that natively.


I've been using Amethyst for multiple years on only the builtin display as well.

I think the key here is to use multiple desktops (or are they called workspaces?). If I'm working on a single screen I constantly have 10 desktops open, with a quite consistent setup between them (e.g. first desktop is fullscreen browser, second screen is 3-5 tiled terminals, ...). All the applications I'm "actively" using are usually on the first 2-4 desktops with a lot of screen real estate for each of them.

What really helps here is assigning one of the screen corners as a hot corner that goes to Expose mode where you can switch between screens, as well as assigning shortcuts for switching between desktops and moving windows between them (the moving windows shortcuts are usually part of your window manager). Selecting "Reduced Motion" in the accessibility settings also helps by speeding up the desktop switching animations.


I have the same problem.

I would love a tiling manager that allowed you to "full screen" the app into the tile of your choice.

By that, I mean the app would snap to the edges and lose all the chrome that is normal present. So your browser window, for instance, would lose the borders and url bar until you moused to the top of the tile.


Not a tiling window manager, but the arc browser does this very well.


I really want https://material-shell.com/ for MacOS

it was perfect for using a single monitor

kinda like a deterministic alt+tab, you set up the layout of "workspaces" and they're always in the same place

you can also pin windows to always open in the same place, so you basically can have persistent layouts that you create while using them (not like powertools where you have to set up the layouts to use them later)

I keep getting annoyed at alt+tab because I accidentally clicked on another window and now the order is messed up


I'm still bitter about macOS removing 2D "workspaces". When I was on a 13" I could work just fine by having my browser in the center of 3x3, code to the right, chat down, DB browser left, and I can't remember what I put "up". I vaguely remember using the "diagonals" for something, maybe TweetDeck or similar?

It was _so_ much better than just a 1D list of workspaces. I could get to any of my main 5 spaces with 1-2 key presses max. I've completely ignored spaces since they took that away especially since I think it reorders them automatically or something like that? I have zero desire for "smart spaces" or anything like that. I want deterministic. Now I just run multiple monitors and I'm happy with that but I miss the 2D grid for spaces on just a laptop.


On a 27” monitor running at 2560x1440 1x/2x tiling is better than on a small screen, but it still winds up awkwardly sizing windows from time to time. In most cases I find it easier to just let windows overlap, which results in the same information visibility but lets windows retain proper sizing.

I could see tiling working if I lived in minimal-chrome apps like Terminal and Sublime, but I don’t, and so floating with occasional tiling works better for me.


I used to use i3 on a ThinkPad x220 and agree that they are less useful on small screens.

My experience is that they are also just productivity theater. You feel more productive with the snazzy shortcuts but its very rare for the bottleneck in a workflow to be window management. Most people probably lose more time overall managing their config files and looking up the shortcuts they forgot.


You can use a separate utility named “AutoRaise” to get autoraise and autofocus functionalities without having to rely on yabai for these. https://github.com/sbmpost/AutoRaise



Is this not normal? No offense but this sounds like saying “in my personal experience cleats are only useful when running.” Well duh :p


Do you not use a monitor at a desk?


No, I work on an m2 MacBook Air with a trackpad and the built in keyboard


Are you mobile, usually?


I have been using Yabai for two years now and am very happy. For me, it's stable and you can script almost anything by using event reactors.

Yabai also makes working with a 15" display much more productive imho. For example, I can effortlessly and nearly instantaneously switch between browser and coding spaces by pressing hyper + w / hyper + c (I'm using Karabiner Elements to map capslock to hyper).

Since it's a common misconception, you do NOT need to disable SIP if you don't care about some features (noticeably, disabling those nasty space switch animations). For an overview of features that require SIP to be partially disabled:

https://github.com/koekeishiya/yabai/issues/1863

Also in general, the wiki on GitHub is very well-written.


If you come from i3 you'll probably find Aerospace[1] to be more what you're after.

[1]https://github.com/nikitabobko/AeroSpace


Thank you for recommending this. Time for round three of attempting a tiling setup on my mac (after Amethyst and Yabai disappointed).


Same path I took. I'm liking Aerospace so far. I just snagged the "i3-like" config from their docs and it feels like home. Not quite as snappy as i3, but very workable.


I have tried amethyst and yabai. I stuck with yabai but I'll gladly try another option. will definitely have a look at aerospace!


This is great, thank you!


Yabai is an interesting japanese word with several distinct composite meanings. https://www.alexrockinjapanese.com/what-does-yabai-mean-in-j...

Here it is being used in one context at a beatbox battle between then World Beatbox champion Alexinho and the super innovative Soso. https://youtu.be/OjbYK4rujB0?si=SIn-uNHlh2KexsXc Yabai shout is at 3m23s


It also seems wholly unrelated to anything about this app though, which is a shame, because as someone who knows Japanese, I'm not likely to install something called "yabai" in the same vein that I'm not going to install something called "whoa" or "ohshit". Hopefully that puts me in the minority.


As a Japanese, I just feel that "ah a foreigner adopt a weird word for a product again" and install without worrying.


What is it with Mac app developers and bad Japanese names, I wonder?


I love yabai and use it every day. It’s the only Mac OS is tolerable for me vs Linux with a WM.

I am sad though that you lose a good chunk of functionality without disabling SIP, which isn’t allowed for work devices


Yabai, and chunkwm before it, and kwm before that, are probably the most important pieces of software that fundamentally changed how I interact with computers.

I moved over from macOS to Windows and WSL full time back in 2020 and eventually ended up writing my own tiling window manager for Windows, which I never would have done had I not had the experience of using yabai on macOS.

I don't think it's a exaggeration to say that my experience with this one piece of software completely changed my trajectory as a software developer for the better.


Hey, Amethyst dev here. Love seeing this on the front page.

I’ve seen a few comments mention it here and there, but I’m swooping in with my semi-regular reminder that you don’t need to disable SIP to use yabai. It’s a great bsp window manager out of the box, with some optional—and admittedly very cool—extra features that require maneuvering around SIP.

(Also, minor apology to Amethyst users because I haven’t managed to get much time to work on it recently.)


I've always wondered why people enjoy tiling window managers. Personally I don't really grasp it. If I work with a lot of papers and documents on a desk, I don't "tile" them, I keep them sort of organically in front of me.

And whatever app I need to use should ideally be straight in front of me. But that's just me, maybe I haven't had a proper tiling experience yet and thus I haven't seen the light.


For me, it's less that I want to "tile" windows, than that I want whichever one I'm using to be fullscreen and distraction-free.

I don't like visual clutter. If I'm using a program, I want it to be the only thing on my monitor. But sometimes I want to keep more than one program open, or even be switching between them. Tiling window managers let me give each program its own full screen, and quickly switch between them with a keyboard command. I love it.

And then there's the exception that proves the rule: Sometimes I do want to have two programs on the same screen, side-by-side. An example would be Vim in the left 2/3rds of my screen (where I am programming), and then a browser with some documentation on the right 1/3rd. Obviously tiling managers also support this case, and I prefer them here too vs. mousing around windows into place (which still tends to leave behind windowing chrome and other visual clutter).

That reminds me of another reason: I prefer keyboard to mouse. I've learned good form and technique for keyboard use, which let me use it frequently and for long periods while avoiding injury. But I just can't figure out a way to use a mouse or trackpad that isn't harmful, were it repeated enough (a vertical mouse goes a long way though).

Tiling managers let me do everything using keyboard (unless the "tiled" programs themselves require mouse), whereas traditional windowing managers pretty much require mouse. I find it both more ergonomic and much faster using the keyboard.


I switched to i3 years ago for the workspace management. I can spread different workspaces across my monitors with easy commands and full control. Every OS and linux distro I've tried has inferior workspace management compared to i3. Tiling is secondary for me.


If you need to work on 2+ apps simultaneously it makes sense, just like if you were copying text from one document to another on your desktop you would put them next to each other.


I find your argument strange. Any windowing system can put two windows next to each other.


macOS has the ability to put windows side-by-side.


I'll have to try this out. Currently use Amethyst + Hammerspoon scripts for my window tools. Like others in this thread, Amethyst occasionally loses track of all windows and requires a restart (esp after monitor (dis)connection).

Amethyst does a decent job at the layouts I care about.

I primarily use AwesomeWM in linux on my personal computers which has the amazing super key drag/resizing behavior for windows. I use Hammerspoon to replicate this behavior[0][1] and it works quite well.

Eventually I want to replace Amethyst and just do everything in Hammerspoon as it seems quite plausible to do window layouting with it. Will give Yabai a try as well in the meantime.

[0]: https://github.com/RingOfStorms/setup/blob/master/home/confi... [1]: https://share.joshuabell.link/ezgif-1-ef0d3e0728.gif


I use Yabai on my work laptop and I'm not very impressed. Maybe I've just been spoiled by my Linux setup, which has had years of tuning, but it feels like a poor imitation of a tiling wm. I get that OS X makes it harder to fully control the experience the way you can under X, but still..


Interesting. I've been using Rectangle for MacOS and it's worked fine so far for me. Will keep this in mind if I ever want to switch.


Coming from i3wm on Linux, I cannot use macOS without yabai. So glad that this exists!


Completely agree. It has its faults; but paired with skhd [1] it makes the mac usable for me.

1. https://github.com/koekeishiya/skhd


I have used Yabai + skhd previously solely to allow me to "cycle" my virtual desktops. Disabling SIP to make this happen was always a fun challenge on my work Macbook. Is there an alternative at this point in time?


Personally I only see the benefit of tiling for terminals. And in macOS, iTerm2 performs tiling perfectly. I just swipe to my iTerm workspace with tiled terminals and tab between other apps that are fullscreen.


For anyone looking to dip their toes into Yabai and tiling windows, I recommend the following setup. Enable full tiling only on a couple workspaces. Desktop 1 can remain in floating layout, just as though you’d never installed Yabai in the first place. Then tile Desktop 2 and as many others as you want.

The one other tip I have is to have an easy hotkey for toggling full screen mode. Toggling an app into full screen mode doesn’t lose its tiled position or create a new desktop the way native Mac full screen mode does, which is especially helpful when working on a smaller monitor.


I usually have too many windows open (upwards of 20). And yabai tries to tile all of them. Is there any way to say "have a maximum of 3 windows horizontally and but for the left most tile, split vertically into two if needed"?


https://www.hammerspoon.org/ is amazing. Not quite the same as Yabai but I cant live without it!


You can configure Hammerspoon so a hot key combination puts a window in a defined section of the screen. For example, I use Ctrl+Alt+H to put the current window in the left half of the screen, Ctrl+Alt+L for the right half, Ctrl+Alt+Enter for full screen, etc. This makes arranging your windows very fast.

Full config: https://github.com/twpayne/dotfiles/blob/21d0edcebaeebf0d90e...


I use Magnet for that. But could probably put those key combinations into my hammerspoon config.


I have an alpha guide I wrote on scripting macOS with Hammerspoon if anyone's interested! There's probably some editing issues and I've been meaning to move it to the actual domain/clean it up to release, but it's got good info in it now:

https://learn-hammerspoon-0x8080.netlify.app/

I have a chapter on window management as part of the guide.


Phoenix [0] is another option in this space if you want to write JS/TS instead of Lua. I just commented about it here [1].

[0] https://github.com/kasper/phoenix

[1] https://news.ycombinator.com/item?id=38487077


Integrating hammerspoon as the keybinding manager for yabai is a perfect match. You can treat yabai as an api for window management, and script some pretty cool things, like sending the current window to a new space, and either keeping focus or not, swapping windows, all kinds of fun stuff.


Personally I've been so hooked to Raycast it's taken over my tiling manager needs too now.


I love Raycast for this too. For new and current Raycast users who haven't seen this capability, you have to enable the Window Management extension.

https://www.raycast.com/extensions/window-management


Related, I was avoiding hotkeys in Raycast for a longtime but they help a lot: https://www.youtube.com/watch?v=VBgVaQscIWg


Window management becomes a whole other thing with really large monitors. I recently got a UHD 43" and to make the most of it I designed a custom grid but struggled to find an optimal solution. BetterSnapTool with custom snap zones works but is a bit clunky. Lasoo has the exact imagined solution I wanted (keystroke > grid representation appears at mouse pointer > drag window size) but doesn't yet support custom grids. I've requested the feature but not exactly hopeful.

I could see that yabai could be a solution but haven't committed to a proper setup.

Anyone else using a single large monitor? FancyZones on Windows (PowerToys feature) looks pretty good, but I got sick of autoupdate BS random driver breaks (common linux thing) and went full mac.

My custom grid for 4K 43" snap zones in case anyone's interested: - diagram: https://imgur.com/a/axTw1tI - 3840x2160 1:1 grid: https://imgur.com/a/pUSoafG


I still use Moom with keyboard shortcuts


I would love to do this and maybe move back to MacOS but ... this seems like a lot of faffing about for something that was not designed to be done and something that is constantly at risk of being nerfed by some future update or security thing such as Apple disabling the SIP disablement ability or something along those lines.

But in Linux the choose-your-own-adventure that is the pluggable desktop model is that something like sway or i3 or other tiling window manager or a plugin for Gnome for example is much more in line with how the system was meant to be used and is very much not trying to shoehorn something in if any of that makes sense.

Of course the dev(s) that put this together and it's other projects are hackers in the truest form and their efforts are to be applauded. I'll continue to show them praise but keep using i3/sway on Linux for the time being. (funny enough tiling window managers was why I left MacOS for Linux.)


My personal favorite app/software in this space is Phoenix [0]. It's more of a "build your own tiling/window manager" but I find it enjoyable to work with. I have my config written in TS and then I just run `tsc` to compile to JS which it uses.

I have one hotkey I hit to put all my windows where I want them (aware of which setup I'm plugged into, home, laptop-only, remote office) on various monitors and then I have hotkeys to arrange/resize/move my windows around.

The best part is if there is something I want to do I can just add it (add a modifier or a new hotkey combo). After having that freedom it's hard to consider using anything off-the-shelf even though many of them are quite good from what I can tell.

[0] https://github.com/kasper/phoenix


Is there any app that has the ability to 'lower' the focus of a window on mac? E.g. on Ubuntu I used to be able to 'lower' a window's focus by middle-clicking on the title bar, i.e. hide the window behind other open windows (without minimizing it). I really miss that feature on mac.


As a long time XMonad user who had to switch to a mac at a new job, I first used chunkwm and then yabai. Yabai's requirement to disable SIP was a problem, and so I finally switched to Amethyst a year ago and have been quite happy with it. It gives me pretty much everything I missed from XMonad.


I'm still using Slate, with a .dmg that was built nearly a decade ago and by some miracle continues to work. I pray that each new OS update won't be the one to break it, because I really don't want to migrate the config for ten years of muscle memory to something new...


I didn't realize Slate was that old! I've only been using it for about... 8 years...

Jokes aside, I love Slate's programmability. I configured mine to behave like WinSplit Revolution, since that's what I was used to.


I like to keep the right 10% or so visible so I can see (and manipulate) the first column of file icons on my desktop behind my otherwise maximized/tiled apps. I haven’t been able to find a window manager that can handle this customization.


Amethyst[0] has options for screen padding.

[0]: https://ianyh.com/amethyst/


Thanks!

Are you a fan of hobos?


You may have already considered this, but dragging desired folders into the last section of the dock accomplishes some of the same things.


I spent more than a year bending over backwards with tools like Amethyst, but ultimately it was too much of a hassle and I ended up going back to my Thinkpad. The ecosystem on MacOS just costs more and never _quite_ works for customizability


The associated hotkey daemon used by yabai from the same author is equally as useful

https://github.com/koekeishiya/skhd


I've tried Yabai multiple times but always bounced off. It's just a little too buggy, a little too opinionated. I've never found a window management system I've actually truly liked. On Linux, I've tried em all, and though in theory I love tiling window managers, but for me automatic tiling with the option to go floating on a per-window basis just ultimately ends up annoying me -- I prefer the reverse. On Windows, PowerToys/FancyZones is as close to my preferred method as possible, but then I'm, you know, using Windows.

This past week I've come up with what is I think my perfect, dream solution:

- Caps Lock is tapped for Escape, held for Cmd+Ctrl+Opt (i.e. "Hyper" or whatever). I'm a Neovim user, so Caps Lock has been mapped to Escape forever already.

- Tapping both Shift keys simultaneously engages Caps Lock for the rare times in which I actually need it.

- Window snapping is handled entirely with Hammerspoon. I have commands for absolute positions (e.g. half, one third, two thirds, quarters), but also can define grids and call them with key commands, and then use another command to snap all windows or just the focused window to the nearest grid box.

It's all defined with code, and thus lives with my dotfiles, and is just a `brew install` and symlink away from totally setting up on a brand new machine.

Also, I set my tmux prefix to Control+p, which I map to Command in my iTerm profile. So, opening up a new tmux "window" (i.e. tab) is Command+t. Navigating to the next "window"/tab is Control+Tab. And so on. Basically it just feels like a browser. This way, whether I switch terminals, or am ssh-ing into a machine, as long as I have my tmux config, those key commands are set.

It's an amazing setup, can't recommend it enough.


All I want (for christmas) is an 'Always on top' opton for windows on macos.

I'd pay real actual money, as I suspect would many others.


Piqued my interest so I just went looking, this relatively recent reddit thread lists a few relevant options: https://www.reddit.com/r/mac/comments/q1pgos/keep_a_window_o...

I hope one works out!


BetterTouchTool works, but it's not pretty - rounded corners end up with blue backgrounds and windows shrink slightly when defocussed.

No joy with the rest.



I wish I had the ability to toggle PiP for any open window, while I am in full screen mode. For instance, I have both Chrome and Emacs side by side full screen and I can use a hotkey to drop down my iTerm window over both of them. (Basically like a Quake terminal but that feature is specific to iTerm).


I am pretty happy with Swish (https://highlyopinionated.co/swish/) Use can make gestures to snap/tile windows. Pretty cool when you have a trackpad or Magic Trackpad worth the $12


I have used yabai for a long time now and never had any big issue. It's a set up once and forget solution and honestly I'm surprises I don't see more comment like that. One thing for sure: you got to give it a fair shot to really appreciate what it does to your user experience.


Everyone in my company uses a company provided macbook, but I use my own Windows Desktop. When presenting stuff to my boss, I'll use windows shortcuts for tiling windows (Win + Arrow keys) and my boss said that's the one feature he thinks is missing from macOS that Windows is really good at


Another bit is that Explorer's Save File modal does autocomplete for file names, which has the side effect of immediately alerting you that a file name is already in use before you submit, but is also massively helpful when you're naming consecutive downloads with a naming pattern.

That latter case would be supercharged if Finder supported this on macOS as the global text edit bindings are more ergonomic for me than those shared between Windows and Linux.


Reading the issues with Yabai losing windows and needing a restart..

Rectangle is another oss option: https://github.com/rxhanson/Rectangle

I bought Moom long before rectangle came out, both are pretty decent.


Has anyone tried this with complex layouts (e.g. 4 monitor tie fighter)? My main issue is window state is lost due to race conditions in the display identification logic, though I haven't tried dared a Sonoma upgrade yet which contains compositor upgrades


I guess that I just rely on MacOS layout, however random and not great, and use Moom with some hotkeys to handle the exceptions where I want 2 or 3 windows in a specific state.

I did try Yabai and Amethyst for a bit, but the overhead was a bit too much to handle.

What am I missing?


For those who want to support open platforms, there are also tiling window managers for Linux and *BSD.

I find XMonad is most effective for me. I sometimes also use i3wm (and there's also Sway, for Wayland). There are a few others.


Are there recommended 3rd party enhancing apps for cmd-tab?

I'm looking for something that shows all windows for an app, per app, and maybe doesn't switch the app to finder when you cancel the cmd-tab


I use AltTab [0] for this. I find using a mac without it horrendous.

[0]: https://alt-tab-macos.netlify.app/


oh wow, you can have multiple "alt-tabs" and set what they show

thanks for the link!


Witch? It's been a while since I used it.


Is there an auto-tiling window manager that just enforces tiling without using keyboard shortcuts? Like if I drag a window with mouse, it snaps it in a tile.

I think I saw this in popOS. Does yabai support this?


Tbh if there was an app that would allow me to move between spaces on all my monitors at once, instead of each monitor to be done one by one, then that would be sufficient for my needs.


There's a setting for that.

I don't remember it but something like separate spaces for displays.


Is it working now? I used for about half a year until MacOS Sonoma when it breaks and I had enough. MacOS is just not built for customization, it's frustrating.


ShiftIt still working basically fine for me after a decade:

https://github.com/fikovnik/ShiftIt


I cannot use my mac without Yabai because the forced transition delay between spaces is extremely annoying for me.


This still requires disabling SIP, I see. That's just not an option for me.

(I have done quite a bit of research and testing on these, and keep using a mixture of Moom and Phoenix - here's my full list: https://taoofmac.com/space/apps/window_managers )


It seems to work just fine with SIP enabled. I just switched and it seems to be a lot better than Amethyst. Amethyst had a lot of issues with focus follows mouse and dropdown dialogs that seems to just work with Yabai

Seems like SIP is only needed for system dialogs etc so has the same limitations as Amethyst


Only for a limited subset of features. All the window management works with SIP.


magnet is where it's at.


I've been using Yabai for 2+ years now, super happy that it exists!


everytime I get a new computer it takes me 5 seconds to remember that I can't live without sizeup.

But I can never remember the name of the app because it's just ctr-opt-cmd-left in my head.


I hope there will be support for current Sonoma versions soon


Good job by Åsmund Vikane and the rest of the team.


Just for the sake of correctness, it’s not a window manager but a window management utility which extends the macOS window manager.


it's either yabai or amethyst. some may find amethyst more user friendly


Just use Hammerspoon


Lol just use Linux already


I like rectangle [0]. It fits my needs well enough without requiring disabling SIP. I especially like the “repeated key presses resize a window on the same side” feature, so I can get cycle the size of the window on the right side of the screen from 1/2->1/3->2/3 easily. I miss i3 sometimes and this ain’t an identical replacement but it gets the job done! Turns out I don’t move my windows all that often anyways.

[0]: https://rectangleapp.com/


Just wanted to point out that disabling SIP is not required to use most of yabai's window management features. You do lose some features[0] but I've found the only ones I really care about is focusing spaces, and you can create keyboard shortcuts for that in System Settings.

[0]: https://github.com/koekeishiya/yabai/wiki/Disabling-System-I...


I want to echo this as well. I use a 2nd tool to help me add additional i3-like keyboard shortcuts as well (I have the ability to "stack" windows with Alt-S and rotate through them with Alt-J and Alt-K).

It's called skhd https://github.com/koekeishiya/skhd

I forgot where the script for the stacking is. I can look that up separately, but I'm on mobile atm.


Please post it if possible. I couldn’t figure out the stacking API, and I miss that feature from i3.


Here it is. There is no visualization of the stack, which apparently Stackline in the other comment supports, but I don't tend to need that. Just being able to move between the windows is good enough for me.

https://github.com/koekeishiya/yabai/issues/203#issuecomment...


They may be referring to stackline https://github.com/AdamWagner/stackline

I've used it in the past, it was very aesthetically pleasing but did not work consistently enough for me to use day to day.


That’s good to know, thanks for clarifying that!


I similarly find something like Yabai a bit too heavy-handed for my needs, and instead prefer Moom[0].

I find that I only need tiling occasionally, and for that Moom excels since it doesn’t add any new key shortcuts to memorize and is only ever visibly present when hovering your cursor over a window’s green button. Its Aero Snap equivalent is optional and turned off by default too, which is great for me (I trigger Aero Snap’s proposed-window-resize animations unintentionally often enough that they get to be irritating).

[0]: https://manytricks.com/moom/


Moom is one of my main tools and I have used it for years. It is one of the first things I put on my Mac. I use it constantly to move windows around, lay things out for work, and move things between desktops. I can't recommend it enough.


Moom fan here too. I got as far in the readme for Yabai where it says you need another utility just to set keyboard shortcuts and decided to stick with what I know and love.


I find rectangle actually preferable to tiling, which I've tried on my linux boxes. Rectangle has the benefits of keeping the application-defined sizes (e.g. the terminal when opened up is 80x20 instead of whatever space is available on the screen) and playing nicely with the system defaults (like command-tab, command-~ to cycle through applications and windows). I find if I ever end up using a public or someone else's device, it's easier to cope; I'm not as helpless without rectangle as I was when I got used to a tiling WM muscle memory.

And the name of Yabai -- which translates to "danger" -- never sounded appealing to me to introduce into my device.


The name Yabai can also be used in a positive sense to mean "great", and is particularly common among young people. Source: https://web-japan.org/trends/buzz/bz0510.html


As a relatively young Japanese speaker, can confirm, it can be either bad or good in context as slang. The comparison to English “wicked” makes sense - could be like “whoa, that’s really uncool/dangerous/awful” or it could mean “whoa, that’s amazing! Sick!” Probably library author is going for the latter!


From what I understand, a more direct analogue to "danger" is "abunai". The word "yabai" almost seems to be usable as a generic intensifier, like many English speakers might use the s-word. (I'm extremely far from fluent, though, so take my observations with a pile of salt.)


Been using Rectangle pretty much as long as I've had my 14" M1 Pro - excellent FOSS that holds up extremely well against paid alternatives! Little to no customization necessary for a very well-executed window management experience. I did change one or two of the shortcuts to be one-handed (namely Restore window, to CTRL+OPT+R), but overall the shortcuts seem really well thought out.

I might have to grab the Pro version because they really deserve the support.

I like it so much that I wish I had the same muscle-memory for similar shortcuts on Windows (I believe PowerToys FancyZones can be set up to snap a window to a given zone or zones with hotkeys, but it's not something I've dug into yet).


It's amazing, makes MacOS usable when using big displays, I tried to use Yabai on my work macbook but couldn't install it due to SIP and work environment restrictions


You don’t need to disable SIP


Rectangle and Spectacle before it are really great for managing window placement and sizing. I wouldn't use a mac without it.

But I don't use a mac anymore. I use linux desktops and there's just nothing quite like Rectangle. For a long while, I used a tweaked fork of pygrid. These days I use wayland compositors and don't have a good option. I've been meaning to hack something together to work with floating windows on Hyprland but I never get around to it.

Someday I'd like to write something that does placement and sizing like Rectangle but snaps adjacent window edges together. Like if I have a bottom left window that's 1/3rd screen width and assign a new window to bottom right 1/3rd width, the bottom left would get resized to 2/3rd wide to fill the void. If I place a new window at bottom middle 1/3rd, the bottom left would get resized back to 1/3rd. If I resized bottom middle to 1/2 width, then the bottom left and right would each be resized to 1/4 width.

Hyprland has a plugin system that I believe would let me do this (someone has created an i3-like tiling plugin) but I don't have the skills or motivation to learn c++.


I still just use Spectacle. Still works, has never in years given me any trouble whatsoever—zero jank, never crashes, just works—so haven’t bothered to switch. Being able to get its behavior with same key-combos on any other OS I might seriously use, with similar perfect levels of stability and reliability, is now table-stakes for me.


If you’re willing to use GNOME (and, I believe, KDE Plasma) you can set up keybindings that are a reasonable approximation to Rectangle. That’s what I did before i3 or on machines that can’t have i3 for odd reasons.


+1 for rectangle. was using spectacle before.


This is the feature that makes rectangle for me. 95% of my use case is just cycling windows sizes (1/3 - 1/2 - 2/3) snapped to either side of my screen with '[' and ']' as shortcuts. Works wonderfully on both my ultrawide and 13" mba screen.


I miss rectangle the most after switching from macOS to Linux. Ironically I end up using the mouse more on Linux because I haven’t found a similar solution for window sizing keyboard shortcuts.


sway, i3, bswm, awesomewm, so many tiling window managers on Linux that you don't need the mouse for. There's even tiling making it's way into Gnome and KDE with the former having some good extensions and the latter just baking it in and getting better with every release.


One thing I really don't like about rectangle (and maybe MacOS in general) is that you can't easily multi-key hotkeys with regular keys. So for example CMD + Right Arrow + Up Arrow for upper-right tiling. This is simple/trivial with PowerToys on windows. But you can use Karabiner Elements to create a simulation of this using keypress delays. I use Karabiner + BetterTouchTools to accomplish the same functionality since I'm already running it for other reasons.


Doesn't this always force delays? If I have CMD + Right Arrow assigned to some other function, the system will have to wait to make sure the Up Arrow isn't coming soon before dispatching the Right Arrow function. Of course we want the delay short, but that makes the multi-key shortcut less reliable.

I haven't tried it, but the tradeoffs don't sound great to me. Only allowing multiple modifier keys avoids all of these timing issues. You seem to be comfortable with it, but I think most users would trigger a lot of spurious inputs.


It does force delays and your concerns are legitimate. All I will say is that in practice I've never actually noticed any kind of conflict or problem when the delay is on the order of 500ms.


It’s not really an issue. I have one of these hot keys set up and what it does is when I hit ⌘→ it will tile in the right half and when I go to hit ↑ it will then shrink to the upper quarter.


Fantastic app. Thanks for sharing. Already love it after 2 minutes.


This sounds similar to BetterSnapTool, which I have been using happily for several years.


Raycast does the same, but I don't like it.

I like to have margins between my windows, so almost all window tiling / snapping managers just make me feel cramped.


The Window Manager in Raycast has a gap option: https://manual.raycast.com/window-management

"Customize your workspace - set a gap around the window edge between 0px to 128px."


Nice! And there's cycling too now.


I also use it and the free version is plenty for my needs


Rectangle is free and open source software, there are no strings attached that I know of


There is pro version you can buy if you want to support the dev and get a few extra features.

https://rectangleapp.com/pro

Rectangle makes much more sense to me on Mac than a tiling window manager like yabai. I tried to use it but it just felt kludgy and I went back to Rectangle. Suits my needs just fine.


On the occasions I'm using MacOS, this is what I reach for too. It works quite well, I agree.


Cool thing: you can set a window gap too.

Discovered the setting this week, my desktop looks so aesthetic now.


> It fits my needs well enough without requiring disabling SIP.

This is not a requirement for yabai.


Second this! I am using rectangle pro and it's fantastic.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: