What does HackerNews think of yabai?
A tiling window manager for macOS based on binary space partitioning
https://github.com/koekeishiya/yabai
For instance requires SIP to be disabled.
Apparently this is possible with yabai (https://github.com/koekeishiya/yabai), but it requires disabling system integrity protection which I am personally uncomfortable with.
You could also check out hammerspoon[3] and see if there are any sample configurations that could do directional focus.[4]
[1]: https://github.com/koekeishiya/yabai
[2]: https://github.com/koekeishiya/yabai/wiki/Commands#focus-win...
[3]: https://github.com/Hammerspoon/hammerspoon
[4]: https://github.com/Hammerspoon/hammerspoon/wiki/Sample-Confi...
Don't raise on click: if you can remember to cmd-click, this mostly works, even with right-clicking. The window receives the click and doesn't raise.
Point to focus: you can get this with yabai [0]; note that it recommends disabling SIP (and keeping it disabled) so that it can install some hooks into Dock.app, but you don't need to do that if you only want focus-follows-mouse.
select/single-click paste: you can get pretty far with hammerspoon (hs.eventtap to notice mouse drags, double-, and triple-clicks, and then use hs.uielement to get the text that is selected), but it's handicapped by apps that don't play nicely with accessibility (browsers and electron apps in particular come to mind). [1] has an alternate way which notices selections as above and then uses hs.eventtap to send synthetic cmd-c keydown/keyup events, but I haven't tried it.
edit: now that I think about it, I think you might be able to do the don't-raise-on-click behavior with hammerspoon as well, by capturing click events, checking their `mouseEventWindowUnderMousePointer` property (see [2]), and if that is not the window that is currently focused, block that event and send a synthetic copy with cmd- added (and if cmd- is already in the mod mask, treat it as "I want to raise that window" and do the opposite -- block the event, copy it and remove the cmd- modifier, and post that synthetic event)
[0] https://github.com/koekeishiya/yabai [1] https://github.com/Hammerspoon/hammerspoon/issues/2196#issue... [2] https://www.hammerspoon.org/docs/hs.eventtap.event.html#prop...
The windows with this parent process go here thing can be solved easily, and can even be done as a one-liner with yabai. Example of moving all the windows of Sublime Text to display 2:
yabai -m query --windows | jq '.[] | select(.app == "Sublime Text") | .id' | xargs -I '{}' -- yabai -m window '{}' --display 2
It can even be automated by adding a rule in ~/.yabairc (although that might be undesirable as it will always be enforced even if you want to move the window manually): yabai -m rule --add app="Sublime Text" label="sublime-display-2" display=2
Yabai can also resize the window to whatever size you want, or move it to a specific space, and it can even do that based on the window title.It has this much power because it uses macOS's private APIs from SkyLight.framework (the macOS window and display manager): https://github.com/koekeishiya/yabai/blob/master/src/misc/ex...
I wonder how they compare?
Installing yabai involves some fishy tinkering with system integrity protection and giving screen recording permission for some functionalities, which doesn't bother me while at my personal PC but is kinda troublesome for a work machine.
Also, does it include some sort of workspace style virtual monitors? Like i3 does for linux.
In this case I would love if it allowed me to load custom workspaces on boot, which is such a pain to get working on i3[2]. (I'm not sure if yabai handles workspaces).
1. https://github.com/koekeishiya/yabai 2.https://wiki.archlinux.org/title/I3 section 5.3.2 for example
If you install yabai[0] with its scripting addition, you can configure hotkeys to change spaces with no animations. It's pretty powerful, and I have specific keybinds[1] to do things such as transition to a space with a specific application running.
[0]: https://github.com/koekeishiya/yabai
[1]: https://github.com/worm-emoji/dotfiles/blob/140c9fd614ebfc54...
I personally gave up on Spaces completely because of this. Now I just have everything on a single space, and move through apps instantly using my rcmd app (https://lowtechguys.com/rcmd)
I'm the developer and have the same exact use case: viewing one window at a time on a single space, instantly switching between them.
I used to map those hotkeys manually using Karabiner, skhd or BTT before, but I figured a semi-dynamic tool might fit this better.
Another thing that's useful for me is using yabai (https://github.com/koekeishiya/yabai) with its Stack layout, which automatically maximizes any window (with or without padding if you want)
Basically:
brew install yabai
Then add this in ~/.yabairc yabai -m config layout stack
Then start yabai and add it to launch automatically at login: brew services start yabai
There are other options like making some animation speeds faster (so fast that the animation is almost imperceptible) and disabling some animations in Finder. The Cocktail utility can do it, and it can be done from the terminal too.
I'm not 100% sure this is up to date, but it might be: https://osxdaily.com/2015/01/06/make-the-window-resizing-ani...
The main one is basically like this:
defaults write -g NSWindowResizeTime -float 0.003
Plus there are some more similar things you can set in `defaults`. (What the Cocktail utility is is a GUI that captures knowledge about a bunch of these settings into a convenient tool. There are other utilities like this afaik? BetterTouchTool maybe? idk.)Then there's something called yabai which is a 'window management utility', but afaik it goes a lot deeper than other similar programs for macOS - it can disable animations and do some more stuff up to the point that you need to (partially) disable SIP to be able to make full use of it. Haven't tried but it does seems to be very worthwhile. https://github.com/koekeishiya/yabai
You've actually stumbled upon the least configurable components of macOS: the Window Manager, and the Desktop Environment.
On Linux you can choose your own, and you have so many different paradigms. I still miss i3 wm..
On macOS you don't have this choice, and you have to use apps to get to the workflow you need.
I was a Windows power user for a few years, and now I use both Linux and macOS daily since 6 years ago. In the end, I feel more productive on macOS nowadays, mostly because there are many quality apps to get anything I want done, I don't have to worry that basic OS function will stop working when I update some dependency, and there are some macOS-native features that really improved my workflow.
For example I didn't know how useful Live Text would be until the first time I noticed that Command-F search in Safari also searches text in images, or when I double clicked on a phone number and I could just call it with my iPhone (which was in another room) but keep talking from the MacBook.
I can't even imagine how I would do that on Linux (surely doable, but nothing beats "already done and usable"), and it's just one of many features like that.
I will end with some more software recommendations: yabai for window management (https://github.com/koekeishiya/yabai) and skhd for hotkeys (https://github.com/koekeishiya/skhd)
They are more Linux-like, using config files, free and easy to forget they aren't native.
Slightly related: I feel it's worth spreading the word about yabai [1], a tiling window manager for MacOs. I've been using it for >1 year, to get an i3 like experience, and find that it makes using MacOs very pleasant.
Issues in the article are somewhat addressed:
> Focus Follow Mouse
Can do this with yabai
> Always on top windows
Can do this with yabai
> Window snapping
Can do this with yabai
The way I use it: I have 9 desktops, and can switch between them via the keyboard (ctrl+). Can move apps from one desktop to another via keyboard commands. Apps are automatically resized to fit. Can move apps around on screen via keyboard commands.
Inspired by Mitchell Hashimoto's VMWare setup[0]. I setup my own computer in such a way, I now have the best of both worlds. Developing on a linux machine, where I can control everything if I wanted (down to the OS) and the ease of Notes/iMessages whenever I need it.
Window management is a pita because of internal APIs and the fact that Apple doesn't cater to people that actually care about these tools. Check out Yabai[1] which btw requires you to disable SIP (System Integrity Protection) if you want to use its full potential.
Instead you can run NixOS and choose your favourite window/tiling manager (i3).
Package manager: I still run Nix but I am not that happy with it. Either I need to spend some more time or look for an alternative. One of the problems is the ability to easily pin older versions.
[0] - https://www.youtube.com/watch?v=ubDMLoWz76U&t=359s&ab_channe... [1] - https://github.com/koekeishiya/yabai
[1] https://github.com/koekeishiya/yabai
I've been eyeing yabai [0] for a while. It requires system integrity protection to be disabled. I initially misread it as being fully disabled, but it turns out once whatever extensions are injected, protection can be reenabled. Excited to try it once it's got a Monterey version.
As far as window management, I use contexts for my switcher, rectangle for hotkey-based window management, and stay for automated per-app & per-display window management
There's also alternate window managers for OSX such as Yabai or Amethyst
I use the basic feature set so it works well on my work laptop (no need to disable SIP).
Yet with all of this effort I still went back to linux after a year (Arch with Qtile and Gnome). What really killed macos for me was the fact that animations could not be disabled entirely and everything felt like it's behind several ms of a delay. I work on the move so I don't have the luxury of multi-screen setup so switching between programs, workspaces and windows is the most important part of my workflow - it just drove me nuts.
Now I run simple Lenovo yoga laptop with arch+qtile+gnome and honestly, my performance at work at least doubled. That's my anecdote anyway.
1 - https://github.com/koekeishiya/yabai
I switched to it after having some issues with rectangle sending some of my windows into the abyss (way outside of the screen) which forced me to kill the app and restart it to get it back. But if Rectangle works for you that's good too, it's probably easier to configure.
It uses a messaging passing API to interface with a local service, so it's completely programmable and can be integrated with something like skhd [2]
1: https://github.com/koekeishiya/yabai
2: https://github.com/koekeishiya/skhd
My skhdrc setup: https://pastebin.com/5GT8yiGK
There's also this: https://github.com/koekeishiya/yabai, but I haven't tried it out because of the disclaimer: "You acknowledge that you understand the potential risk that may come from disabling arrow_upper_right System Integrity Protection on your system"
This is so much my issue. I love i3wm, it's been a revolution for how I work. I never really understood the "desktop" concept with overlapping windows very much, and i3 works at an abstraction that is very close to how I imagine my desktop. I keep stacks of windows open in an arrangement that might be bizarre to anyone except me, but when I look at it it's 90% how I want it to be, a place no other WM/DM has ever gotten.
But I also don't want to deal with linux any more. Please don't sealion me with "but linux works fine for me!" here, but using linux feels like death by a thousand frustrations. Most recently I had to alias pulseaudio -k to pk because pulseaudio got out of whack so often I got used to killing it. That, plus I can't live with Ctrl-based shortucts anymore: I get serious pinky and wrist fatigue from a full day's work on linux. I can't be bothered to work around an entire missing staircase, so I switched back to macOS, where even if the WM isn't as good I can live with it.
(Incidentally, have you heard of yabai[1] / amethyst[2]? They're tiling WMs for macOS. I've been thinking of trying both out for a while now but I can't spare the time.)
1: https://github.com/koekeishiya/yabai/ 2: https://github.com/ianyh/Amethyst
- https://www.reddit.com/r/unixporn/comments/jupmda/aquayabai_...
- https://www.reddit.com/r/unixporn/comments/mvuplf/yabaimacos...
Its called Yabai (+ skhd): https://github.com/koekeishiya/yabai
That is, you can have a tilin WM today with all the advantages of running MacOS.
- No focus-follows-mouse (there used to be 3rd party plugins but those seem to be gone now)
- While basic split screen tiling works and you can set up a global kb shortcut to move windows to left/right of the screen, Firefox seems to completely ignore those
- If you're running multiple displays macos for some reason always picks the most awkward display to open new windows in
- I really miss being able to grab and resize windows using a modifier key like in XFCE
All of these things can be done with yabai https://github.com/koekeishiya/yabai
i3 sounds like a dream window manager to me, but in the meantime while I use Mac OS (& Windows), I've been using yabai, which is heavily inspired by i3 but limited by Mac OS.
I did come close however...there's a hidden gem called Yabai[0] (formerly chunkwm) by koekeishiya on GitHub. For anyone looking for as close to i3 functionality as possible in MacOS, Yabai is definitely it. I'm really surprised I don't see more people recommend it as the developer has done an excellent job trying to bring the i3 experience to Mac.
I have also been using skhrdc (same maintainer I believe) for key bindings and it’s an absolute blast.
https://github.com/koekeishiya/yabai
I used to use BetterTouchTool and Stay to do this, but after a co-worker tipped me off on yabai+skhd, I've been extremely pleased and rarely have to think about window placement (took me a while to get the config "just right", of course).
I haven't tried it on Big Sur, but because of the way yabai can assign windows to spaces, I don't believe you'd face this issue.
[1] https://github.com/ianyh/Amethyst [2] https://github.com/koekeishiya/yabai [3] https://github.com/Hammerspoon/hammerspoon
I've even managed to get Windows-style window management working in my config.
Yabai is actually the second iteration of tiling windows that koekeishiya has made and it's super well developed.
If that's the main reason, how about yabai on Mac? https://github.com/koekeishiya/yabai
> The primary function of yabai is tiling window management; automatically modifying your window layout using a binary space partitioning algorithm to allow you to focus on the content of your windows without distractions. Additional features of yabai include focus-follows-mouse, disabling animations for switching spaces, creating spaces past the limit of 16 spaces, and much more.
I haven't used i3, so I don't know if yabai mirrors the i3 experience, but it's a very nice programmable keyboard-centric tiling wm for macOS.
[0]https://github.com/koekeishiya/yabai [1]https://github.com/koekeishiya/skhd
Just to piggyback on your interest:
My comments were more in the way of evangelizing Plasma (iirc KDE is the company, Plasma is their DE product), to share awesome features that I'd love to see generalized on all platforms.
In searching for a productive DE, provided you only want GUI config on the user side and can learn to juggle between 3-4 settings panels, Plasma beats them all.
Defaults are very close to Windows 10 (rather the other way around historically but whatever), with a touch of Linux twist here and there (magnet sides, feature-rich title bar menu, etc.)
The more advanced stuff is only necessary to maximize X (real estate, aesthetics, shortcut-driven controls...), some of it becomes invaluable over time.
I strongly encourage you to spend some time with KDE's Plasma, it's inspiring regarding the 'desktop paradigm' insofar as we just want to refine, not disrupt it (familiarity is a good thing for users imho).
There are a couple of automatic tiling window managers for MacOS, the most notable being Yabai (https://github.com/koekeishiya/yabai) and Amethyst (https://github.com/ianyh/Amethyst).
Yabai doesn't handle window switching on its own but it can use SKHD (https://github.com/koekeishiya/skhd) or any other application that can bind terminal commands to keyboard shortcuts such as Hammerspoon (https://www.hammerspoon.org) or BetterTouchTool (https://folivora.ai) or even Keyboard Maestro. The commands are context-aware of spaces and the placement of windows on the x-y plane so you can move between windows relative to their position on the screen.