Native Instant Space Switching on MacOS
45 points by Arch
45 points by Arch
I use Aerospace's spaces functionality and despite it being a tiling window manager, this is the feature I use the most.
I've been running desktop Linux for 20+ years, both home and work... not exactly a tiling window person, but for all that time I've run wmaker, blackbox, openbox, or in more recent decades kwin configured to act pretty much like the former options — most apps maximized most of the time and hotkeys for "switch to desktop", "send window to desktop", "send window to other monitor", etc.
But not too long ago I started a new job, and while they didn't exactly say no to me running Linux, I would be the only person there not using a Mac, and some of their dev tooling is built specifically for Mac, so clearly that wasn't the smart way to go. Plus the whole "they give me a 16-inch MBP" thing. So, I'm a Mac user now.
Most things were really not difficult at al to adapt to, especially with homebrew installed and a few choice tools symlinked into place, except for the window management. It mystified me when I first encountered System 7, and it hasn't started making more sense at any point since then. Fortunately, there's Aerospace. It works well, it's customizable enough that I can make it compatible with my muscle memory, and maybe I tile windows just a little bit more than I did before... even on my Linux machine.
You probably know this, but there has to be some difference in window management because Mac apps can exist with no windows. So cmd-tab switches apps, cmd-backtick switches windows within an app, and what’s missing is switching windows ignoring app boundaries. But there’s more to it. On anything but MacOS, I am annoyed because there’s only switching windows ignoring app boundaries, nothing to switch apps as a unit or to switch windows limited to the current app, my windows get all interleaved, and I can’t find anything.
because Mac apps can exist with no windows.
I wish I could fix that bug somehow. I want that disabled, it doesn't make sense for my work and only makes things annoying. I know it may make sense for for some people, but I'd love to at least have an option for "last window gone closes the app'
It's not a bug, it's just different. MacOS leaves it up to the app to decide what makes sense to do when you close the last window. Lots of apps have one window and automatically Quit themselves if you close it (e.g., System Settings). A few have a preference to make them work that way.
This dates back to Mac System 0.9 where quitting an app was a huge deal (20 seconds of floppy disk grinding as you returned to the Finder) but semantically it still makes sense, why quit the whole process just because you closed a window? Windows went the other way, and as a result Microsoft had to implement all sorts of caching in Office so it doesn't actually have to fully relaunch Word when you close a document and open another one.
Oh, and of course this also relates to the other unique MacOS UI feature, the menu bar being attached to the screen rather than the window. So you don't have to find and relaunch the app to make a new document, the New command is still there.
I get that it can be a feature for some people, but for me it's a behaviour I never want and it only adds work - it's indistinguishable from a bug.
why quit the whole process just because you closed a window?
So you don't see it in the alt-tab list anymore.
Well, as with so many other things, if you try to impose a different model on the system than the one it's designed around, it's never going to work the way you expect. It's kind of like getting annoyed because vim doesn't have Emacs keybindings or because Go doesn't have inheritance.
It's still in the cmd-tab (not alt-tab) list because the app is still running, and that's a list of apps. If you want the app to go away, just Quit the app.
I know this isn't a particularly satisfying answer if you use a lot of apps where you're constantly closing the last window (which makes me curious as I very seldom do that and I would suspect we use similar apps…).
Or like being annoyed that Emacs doesn't have Vim keybindings, but thankfully the system is flexible enough that you can change that. Or like being annoyed that Go doesn't have generics, and them being added in a complicated way many years later when it would have been easier to have them from the start...
Well, my point was just that Emacs not having vim keybindings, or Go not having inheritance or generics, aren't "bugs". Those things are perfectly consistent with how the tools were designed, as is cmd-tab.
But I'm totally on board with wanting more customizability — fortunately other branches of this thread are pointing to some potential fixes for that on both sides of the UI divide!
The big difference there is that I can choose Emacs or something else; I can also work around go, or sometimes use something else. If I'm in a work environment and get a Mac, I get to complain into the void (can't even create a custom desktop in a sip protected system) - there's no option to turn it off and the behaviour has only downsides for me, so... I'm sticking with the bug description. Even on windows I can replace parts of (OpenShell) or all of the desktop if I really don't like something.
To satisfy curiosity, I'm constantly running into this with Finder, Preview, some music player, some video player, Activity Monitor, and probably a few others becoming "the next cmd-tab window" (I know it's not alt, you know what I mean), when I'm completely done with it already.
I use AltTab which adds the ability to cycle through windows ignoring app boundaries. Got it mapped to Cmd+Tab as I never want to see the native Tahoe switcher with its near-invisible selection highlight.
Ooh thanks! Now does anyone have the opposite thing for Windows? (Particularly the Cmd-backtick equivalent.)
Yeah, I've encountered that. Close an app's last window, and then switch back to it later on, and... nothing happened? Oh wait, my menu bar is different.
Windows actually tried to create the system you want back in the early 90s, with Alt-Tab to switch between apps and Ctrl-Tab to switch between an app's windows in MDI. But MDI wasn't exactly popular and when Windows 95 switched to the "document-oriented" model, Ctrl-Tab kind of got hung out to dry. Although you might find that it cycles between browser tabs, which are, after all, just MDI reincarnated.
Some Linux desktops also endeavor to give the experience you want, with questionable success. But perhaps that's why I like desktops (spaces) so much: they create that same hierarchy in a different way, if you give each app its own desktop and have a key or keys to navigate between windows on a given desktop, whether that's an Alt-Tab being desktop-local, or tiling directional navigation, or whatever.
Spaces are great and I use them to separate "contexts" (e.g., personal, job, project).
The problem there is that on MacOS there's apparently no API to stick a window to a space, just an entire app. You can read the many-page Chrome bug about this to see the frustration (though for some reason iTerm can do it). Whenever I let Chrome upgrade, it takes five minutes to get its windows redistributed to their correct spaces.
Right, which is why Aerospace ignores native spaces entirely and fakes everything itself :)
Of all the layouts a "tiling window manager" could provide, what I use the most is:
That's it. That's all the tiling I need.
Same here. On MacOS, may I recommend Rectangle. Been using it for years with shortcuts for full, vertical halves, and vertical thirds/two-thirds, and it’s exactly all I need.
if anyone's interested in instant space switching for 3-finger swipe in < 200 lines of C: https://github.com/joshuarli/iss
the default behavior is doubly frustrating:
prefers-reduced-motion on browsers (the second part is completely valid)currently i've just decided to accept the fade-in/out animation. i don't really mind the browser behavior too much.
This is why I still use i3 as my primary workstation =P
I have a macbook for some things but the list is growing shorter.
I appreciate this blog post. ✨ I basically went through what the OP did. I've just been coping until using KDE Plasma recently and seeing how fast (and configurable) switching is. Me, being impressed while understanding that KDE is not at the pinnacle of the embracing tiling or configurability.
InstantSpaceSwitcher does not require disabling Security Integration Protection; it works by simulating a trackpad swipe with a large amount of velocity.
I haven't tried it out yet, but this is so clever! Looks like it mostly boils down to a few calls to CGEventPost().