
Show HN: Alt-tab-macos – Windows-style alt-tab on macOS - lwouis
https://github.com/lwouis/alt-tab-macos
======
greggman2
I have never enjoyed the distinction between apps, app windows, and in app
windows. 25 years of alt+tab/Ctrl+tab/cmd+tab and I still can never switch to
the thing I want. My mind is stuck on one hotkey that I want to mean "switch
back to the last thing I was looking at" but that doesn't work because if the
last thing was another app or another tab or window in the same program then I
would need a different key. My brain doesn't want to have to remember that. it
just wants "back to the last active thing" whatever that thing was.

this bite me every day for 25 years . example on desktop. I switch tabs by
clicking a tab. want to back to the last tab. I do the "one" action (cmd-tab)
and get a different app instead of the last tab. so it's cmd-tab again and
then click the tab. Sometimes I press cmd-tab multiple times before my brain
realizes I need to click a tab.

I'm often switching between editor (or 2), terminal, browser, and apps so this
idea that I have to always no the exact state I'm and deliberately consciously
pick one of 3 different key combos to switch seems crazy to me.

The same thing happens on mobile. swipe up and pick previous window is my
action to get back to the previous thing so when I want to switch back to the
previous tab I always without fail by swiping up and then curse that the
device didn't do what I want and instead I need to click the "display tabs
icon". Again I'll be juggling multiple apps so the fact that the thing I want
"go back to last thing" is inconsistent always mean the ux is failing me

~~~
evrydayhustling
Amen. OS app/window distinction sucks because the OS doesn't really know what
users experience as an app. We might have a dozen apps open inside chrome, or
the same IDE configured for two massively different tasks.

Now that users juggle not just multiple apps and windows, but tabs and
accounts and devices, the OS should stop pretending it's privy to our workflow
- or give us a better way to configure it.

~~~
greggman2
I agree the OS doesn't know what the app is doing with it's tabs/windows but
the OS could mandate that it tell the OS a list of things the user should be
able to switch to and design the API in such a way that we'd get a LRU
behavior.

I can dream haha.

Just tried turning on tab support in Witch but AFAIK it can't do LRU so it's
not helpful (T_T)

------
donatj
Do people know about CMD+Tilde to switch windows within an app? CMD+Tab to the
App and Tilde to the Window? It’s not mentioned in the READMEs description of
how macOS tab switching works, so I’m curious if the author knows.

~~~
lwouis
Author here.

I'm familiar with this. I have rebinded these, but basically I use them
everyday for _tab_ switching, for example within 1 chrome window, of within 1
terminal window.

The reason I made this window-switcher is that sometimes I have something I
know I opened a while ago, but I don't want to think about which app holds it,
then use the macOS app-switcher (command-tab) to switch to that app, then
select the tab/window (with the mouse, or by cycling alt-`).

I want a big mosaic with my windows, and instantly identify and focus on that
window I remember the visual traits of.

macOS offers exposé for that purpose, but it is unfortunately not keyboard
operable. Also I prefer the Windows approach of having a the thumbnails on a
timeline so my eyes have some references instead of scanning the whole screen
every time with exposé.

~~~
pazimzadeh
I love your app, but unfortunately Control+Tab is the same shortcut used
system-wide to move between tabs. Could you add the ability to choose a custom
shortcut?

~~~
savolai
+1 for this. Now my browser experience is broken. Or is there a way to remap
tab switching shortcut in firefox? Seems silly to do that though.

Actually, alt+tab seems to do nothing on my macOS. Why not use that? I'd
actually have the same shortcuts as on windows, which I also use.

I'd also love to adjust the delay. Seems very slow now.

Otherwise, this is beautiful.

~~~
pazimzadeh
Alt+tab would be amazing.

------
dvcrn
I’ve been using hyperswitch [0] for ages which does something like that. The
killer feature for me is to hide windows that are not on my current desktop. I
have virtual spaces for social and chats and really don’t want to ever see
these windows when I’m on my programming space

0: [http://www.bahoom.com/hyperswitch](http://www.bahoom.com/hyperswitch)

~~~
lwouis
Author here.

I drew inspiration from HyperSwitch. Unfortunately, it is no longer maintained
and is not free or OSS software, so I couldn't take over.

Specifically, I wanted to improve on some points:

* visual clarity * size of the thumbnails * size of the app icons

It's a shame it's not on github because the customization available through
the preferences is great, and the product is great overall. It's one of those
projects where I'm guessing the author is making no money and could release
the code without any loss. He just probably forgot about it, unfortunately

~~~
some_developer
I applaud this, I really do.

I'm also worried about HyperSwitch. When I converted to OSX half a decade ago,
coming from Windows, this was the one app which I needed to be able to say "I
can use this machine".

I can't comprehend how people otherwise can organize their things; it's just
not my thing.

Also Tilde-Tab is the killer; Windows really missed out here.

I looking for a replacement for the same reason: the uncertainty of the future
of this app.

The author seems to keep it alive, but it has (or had?) timebombs and once a
year the author had to release a new patch version due to this.

I tried contact the author to throw money at it, to make sure I can have this
as long as I use OSX, but he didn't really respond to that.

However, what can I say, I still prefer HyperSwitch (HS).

\- HS is much faster "coming up", this is essential for me. I want to quickly
use this. Basically I configured HS to be instant, no delay. I can live with
the flashes, actually doesn't really bother me \- HS supports CMD-Tab and
Tilde-Tab; I need both. And in practice they work amazingly well for me. Tile-
Tab is when I _strictly_ need to jump between in-app windows. CMD-Tab can do
both, in fact. Jump between apps or within the same apps window.

Also CTRL-Tab hurts to hit combined with TAB.

Anyway, this was on my mind for some time and there was nothing where I could
mention it to similar thinking people so I already apologize if this seems
inappropriate as a feedback for the hard work you put into it!

thanks

~~~
lwouis
No worries, I appreciate your enthusiasm! I think all your feedback is
addressed within this ticket: [https://github.com/lwouis/alt-tab-
macos/issues/8](https://github.com/lwouis/alt-tab-macos/issues/8)

Subscribe to it to follow its implementation ;)

------
temporallobe
I used to think I needed a third-party app for window switching in macOS,
until I discovered Command + ` (back-tick) shortcut- which switches between
windows of the sane app. Now I use it combination with Command + Tab and my
workflow is so much easier. In fact, I wish Windows had this feature
sometimes, but I do think Windows’ window switching is better and more
intuitive.

~~~
davidmurdoch
I don't use Mac, but do use Windows. This sounds like Windows' Alt+Tab
(switches windows/apps) vs Ctrl+Tab (switches between tabs of an app). Is it
not the same?

~~~
lwouis
* alt-tab on Windows is for finding a window within all apps. This is the one I cloned for macOS

* alt-` on macOS or ctrl-tab on Windows is to cycle between tabs/windows of the current app

* command-tab on macOS is to cycle between apps (the app will then elect which window to present the user)

------
rubyn00bie
I'm excited to give this a try, though I wonder if there's a way to replace
command tab with it instead of control tab.

This little bit of UX is seriously one of those things you notice in Windows,
if you're primarily a Mac user, and go "holy shit, I'm missing out." Windows
10, faults aside, actually does have some pretty clever UI/UX in spots that I
really wish Apple would just "steal," because it (MacOS) sort of feels like a
one-button-hockey-puck-mouse sometimes.

~~~
K0SM0S
Wait until you discover some basic features of KDE or Gnome (especially the
former) on Linux then. Using KDE, both MacOS and Windows 10 feel like it's
2009 all over again, by comparison. I just don't understand why MS and Apple
don't steal the best stuff, it's literally 'free' as in beer, and so much more
important to a good UX compared to the slew of useless features both these
commercial vendors keep on piling up...

Things like per-window or per-app settings:

\- borderless

\- opacity

\- default an app to a virtual desktop, position and size, even sub-types of
windows (e.g. when you want children to appear in some designated place)

\- a few well-placed magnets (sides, center, other windows) to quickly resize
'perfectly' (my OCD loves it haha)

\- activities (more like a meta-organization, so powerful when switching
tasks/context like home / work / hobby / etc.

\- custom shortcuts for anything (any of the above, launch any app, optionally
with command-line options)

and so much more...

~~~
lwouis
For many of the things you list, you may want to have a look at
[https://github.com/koekeishiya/chunkwm](https://github.com/koekeishiya/chunkwm)

~~~
K0SM0S
Interesting! The active project (rewrite) moved here apparently:
[https://github.com/koekeishiya/yabai](https://github.com/koekeishiya/yabai)

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).

------
ken
Despite the readme ("Fast"!), it's pretty sluggish for me. Mission Control is
instantaneous, and this takes 1-2 seconds to display.

It also doesn't seem to support any form of drag-n-drop, which is (IMHO) the
huge advantage of the Mac's command-tab and Mission Control. I can drag
anything to anywhere, even if I'm not seeing its eventual target yet. Nor does
it seem to support command-H/Q, or play well with Spaces.

It's cool that you made your own switcher, but in terms of everyday usability,
this feels like it gives up a dozen features of the built-in one I use a
hundred times a day, in exchange for one nifty new feature (view all windows +
keyboard control).

~~~
lwouis
> it's pretty sluggish for me

Did you take into account the 200ms that's purposefully added? The behavior of
alt-tab on windows is also: if you press fast (within 200ms) you don't get a
UI but the switch will happen. After holding alt for > 200ms, the UI is
displayed. Taking that into account, does the UI display after a delay
significantly longer than 200ms? Please open a ticket if it does, with your
hardware specs.

> It also doesn't seem to support any form of drag-n-drop

That's a great idea! Please open a ticket

> Nor does it seem to support command-H/Q, or play well with Spaces.

There are 2 tickets opened currently for these 2 things. Hopefully they get
implemented soon

~~~
mizaru
>if you press fast (within 200ms) you don't get a UI but the switch will
happen

I always get the UI, no matter how fast I press the keys (W10 1903). This may
have been different on previous versions.

~~~
userbinator
XP and 98SE (I just started a VM to check) also don't have any delay, so I
suspect that those who are seeing one are just experiencing some natural
sluggishness rather than a deliberate delay.

------
etaioinshrdlu
I also like Hyperdock:
[https://bahoom.com/hyperdock](https://bahoom.com/hyperdock)

It makes the Dock have windows 7 style window previews. I don't know what I'd
do without it. Perhaps cry.

~~~
Gimpei
Also does snapping, which I can't live without.

------
nikivi
I use [https://contexts.co](https://contexts.co) for app switching as it
supports fuzzy searching windows

~~~
lwouis
I considered using something like this, but as I explained in another comment
([https://news.ycombinator.com/item?id=21254984](https://news.ycombinator.com/item?id=21254984)),
I think visual matching beats other approaches. I think the few seconds it
takes to think about which app owns the window, or what text could match the
window, will be longer that directly looking and visually recognizing your
window. Again, this opinion is not supported by research. You may want to
experiment on yourself. It is also not only about speed but the comfort of
each work-flow may differ for different people.

------
bpye
This is pretty awesome. Every time I end up using a Mac (normally someone
else's) I always struggle with the multitasking experience. This looks a lot
more familiar.

------
lbotos
It's an "old" feature, but I use "hot corners" -> mission control to switch
windows: [https://simplymac.com/enjoying-hot-corners-on-your-
mac/](https://simplymac.com/enjoying-hot-corners-on-your-mac/)

I usually use cmd-tab when I want to close down windows for the day.

~~~
jdkram
You can press Q while using cmd tab to quit that app entirely without leaving
the cmd tab interface, which is a fast way of cleaning up at the end of the
day / when project switching.

(apologies if this was _precisely_ what you referring to, but commenting in
case you meant you then closed each app individually with cmd q, then returned
to the cmd tab interface)

A few other shortcuts for cmd tab: [http://osxdaily.com/2009/11/17/secrets-of-
the-command-tab-ma...](http://osxdaily.com/2009/11/17/secrets-of-the-command-
tab-mac-application-switcher/)

And on the off chance anyone reading this in Windows is also jonesing for a
shortcut for closing lots of apps quickly:

Ctrl alt tab: opens persistent app switcher Ctrl w: closes the current program

------
monkin
Isn't just faster to use built in `ctrl + arrow` keys to manage this? You can
also change shortcut.

~~~
k__
Is this a way to switch between multiple windows of one app?

~~~
thomaslkjeldsen
Shortcut to cycle through multiple (non-minimized) windows of one app, in
either direction:

cmd + <

cmd + >

~~~
thelittleone
I tried these with MacOS Mojave and with Firefox having multiple windows open
(not minimized).

Cmd + < opened up a new preferences tab on FF. Cmd + > did nothing.

~~~
thomaslkjeldsen
Ah, the shortcut for this is keyboard layout specific:
[https://apple.stackexchange.com/questions/193937/shortcut-
fo...](https://apple.stackexchange.com/questions/193937/shortcut-for-toggling-
between-different-windows-of-same-app)

------
allworknoplay
I use Witch by ManyTricks for this. I refused to get a mac until someone told
me about it — I find switching to a program first and then to the correct
window totally insane.

Witch is very configurable and pretty performant — once in a while it feels
sluggish but generally it’s quite good.

Interested to try this too!

~~~
PunksATawnyFill
That's Apple for you. They should have abandoned the dumb one-menu-for-all-
apps idea with the OS X transition, but nope. That would entail learning.

Then again, they DID implement Command-Tab app switching from Windows... but
managed to screw it up by not restoring the app from a minimized state when
you switch to it.

~~~
zapzupnz
All I read is "blah blah blah it's not exactly the same as Windows".

~~~
allworknoplay
I'm sorry, you think not wanting to hit a large number of extra keys to go
different app => desired window, or to have to navigate a chaotic mission
control view with a mouse is just a "not exactly the same as windows"
complaint?

This entire thread exists because of people who want mac os to have a better
window switching pattern.

~~~
zapzupnz
Actually, I was referring to this bit:

> but managed to screw it up by not restoring the app from a minimized state
> when you switch to it.

"Screw up" is interesting wording. The implication is that macOS has a fault
in it because its window management is (a) app-based and (b) therefore doesn't
automatically unminimise _every_ window belonging to that app.

Imagine you had several windows minimised for a given app, switched to that
app, and they all automatically swam back out of the Dock all in the name of
emulating Windows.

Yeah, people might want a different window management system that isn't app-
based, but that doesn't make the current system a "screw up" for not perfectly
emulating other systems to which one may be more accustomed — namely Windows.

Just because people aren't familiar with it or don't see the benefits in it,
nothing is "screwed up" because there isn't a slavish mimicry of the way
Windows does things.

There _are_ those of us, believe it or not, who understand the macOS way of
doing things and vastly prefer it. Yeah, we might not have the most valuable
input in this discussion, but that still doesn't mean the macOS way is a
"screw up".

That's the point I'm making.

------
SomeHacker44
How great it would be if you could replace command-tab instead of adding
control-tab? Neat idea, although I do prefer the command-tab, hold command,
hit Q or M or H, continue holding command and hitting tab again, etc., of
macOS standard switcher.

~~~
lwouis
Author here.

> replace command-tab instead of adding control-tab

Currently there is no UI to customize hotkeys. I have a ticket to frame work
that can be done here: [https://github.com/lwouis/alt-tab-
macos/issues/8](https://github.com/lwouis/alt-tab-macos/issues/8)

However, you can switch keys in the code and get this working today. In
`Application.swift` at line 16, replace

    
    
      let metaKey = 0x3B
      let metaModifierFlag: NSEvent.ModifierFlags = .control
    

with

    
    
      let metaKey = 55
      let metaModifierFlag: NSEvent.ModifierFlags = .command
    
    

I tested, and it overrides the default macOS app-switcher, so no need to use
something like Karabineer Elements which is what I use to disable the default
app-switcher in addition to add the new control-tab hotkey shortcut.

> I do prefer the command-tab, hold command, hit Q or M or H, continue holding
> command and hitting tab again

You can already hit control-tab then hold, and cycle with tab or shift-tab.
What's missing is the option to hit Q/M/H.

I have a ticket to frame work that can be done here, inspired by the creative
UI of another app called WindowSwitcher: [https://github.com/lwouis/alt-tab-
macos/issues/9](https://github.com/lwouis/alt-tab-macos/issues/9)

~~~
bluetidepro
Sorry, I don't use Xcode often. I made the change in the code you provided
above in Xcode. But now, how do I export/build the app to then drag that into
my "Applications" folder with this version of the app, where it uses command-
tab?

EDIT: Google helped me out! If anyone else runs into the same thing, you do
the dropdown in Xcode: Product > Archive > Distribute App (blue button) >
"Copy App", and then that generates a folder with the newly created .app
wherever you save it.

------
aasasd
I'm using HyperSwitch that has the same feature, only on alt-tab. But! It also
replaces the cmd-backtick shortcut with a similar overlay for the current
app's windows. I find that great, because the native Mac order of switching
windows is bonkers, while HyperSwitch employs the last-used order.

The alt-tab feature in HS also has a flaw: if you switch to an app via the
dock icon (or possibly by clicking on one of its windows), _all_ windows of
that app become ‘recently used’ in the alt-tab menu. I'm guessing this might
be a behavior of MacOS, and that you might run into the same problem.

~~~
lwouis
> The alt-tab feature in HS also has a flaw: if you switch to an app via the
> dock icon (or possibly by clicking on one of its windows), all windows of
> that app become ‘recently used’ in the alt-tab menu. I'm guessing this might
> be a behavior of MacOS, and that you might run into the same problem

I'll test this, thanks for the heads up! Windows recently used order comes
from the OS in my current implementation (I'm not spying on the whole system
and keeping track; the OS is giving me a list of most-recent first windows).
That may indeed affect my app too

------
gonzalocasas
Oh ppl, you don't know what you have until you lose it! I am unfortunately on
Windows, and I miss CMD+Tab and CMD+Tilde style of switching so much. It's
vastly superior in terms of reducing cognitive load.

~~~
delecti
Are you familiar with all the Windows Button shortcuts?

Win+# changes to that application in the task bar (Win+1 is the app nearest
the start button, etc). That lets you develop a lot of muscle memory for
switching between apps if you pin things to the taskbar; for me Win+1 is
always my browser, Win+2 is file explorer, and so on. Win+Up maximizes a
window, Win+Left/Right docks to half the screen, Win+Shift+Left/Right moves a
window between monitors.

------
oneplane
Odd what things people seem to have issues with. I've never had any problem
with application and window management on either platform, be it keyboard
based or mouse based.

I suppose for some people there has to be 'one true way' of managing windows
and applications and every other way that isn't their way is automatically no
good. But for me that hasn't really been the case. I like some versions more
than others, but it doesn't really affect the way I work or the efficiency I
work at.

------
monster2control
I’m not sure what your talking about alt-` switches between app windows. The
windows switcher is dreadful, it clumps all your windows in sorted and you
can’t easily swap back and forth between two apps. On macOS, command tabbing
nicely flips back and forth between the last used window. Windows never seems
to make it easy to switch in my opinion.

------
pcr910303
Great, it'll be immensely useful for me. I would appreciate more if the
layover looked more like macOS. Currently the corners are too sharp compared
to the macOS default ones, and the text is white compared to the less
standing-out grey.

Nonetheless, the idea is great and I think I'll switch to it right away!

------
imkieren
I like this idea a lot, just tried it now however and the UI is a bit too slow
for how fast I like to switch between apps, espically on multiple desktops -
takes about a second to show up and swaps to the active monitor instead of
staying on the main like command+tab does. Will follow this!

~~~
lwouis
For the slowness, could you please check my reply here:
[https://news.ycombinator.com/item?id=21256353](https://news.ycombinator.com/item?id=21256353)

For the active monitor issue, I have never tested on multi-monitors (I
personally switched back to single-monitor after years of multi). Could you
please open a ticket? It may be an easy update

------
29athrowaway
Mission Control dashboard + Reduce motion accessibility setting = the best
window switcher

~~~
lwouis
Unfortunately Mission Control is not keyboard-accessible :/

------
fortran77
Wow! I remember when Windows users would try to put Apple-style features on
Windows. (Interestingly, the "dock" was first on Windows, with StarDock, etc,
before OSX had theirs).

~~~
PunksATawnyFill
Meanwhile, Mac users STILL don't get a real Delete key; they get a Backspace
key mislabeled "delete."

~~~
zapzupnz
It's been called Delete on Macs since day 1. What you call the 'Delete' key,
Mac users call 'Forward Delete'.

------
eddyg
I’ve been using HyperSwitch [1] and _love_ it, but will give this a look...

[1] [https://bahoom.com/hyperswitch](https://bahoom.com/hyperswitch)

------
seltzered_
[https://github.com/numist/Switch](https://github.com/numist/Switch) was a
very similar app made a few years ago.

------
pazimzadeh
How do you change the delay for showing the UI?

> Delay before showing the UI to avoid flashing (default 200ms)

What's flashing?

Have you thought about enabling going backwards by pressing ` while control is
held down?

~~~
cgijoe
I believe OP means that if you press Alt+Tab and release the keys quickly,
it'll simply swap to the last window without showing ("flashing") any UI
overlay at all.

~~~
userbinator
The Windows one doesn't --- at least on XP, that is; Alt+Tab causes the switch
window to show up the instant it's pressed.

The delay may be the reason others here are noticing that it's "slow".

~~~
withinrafael
Neither does the switcher on Windows 10.

------
mhd
Is OS 9 single-app mode still an option on Mojave+? It used to work a few
versions ago with a hidden setting, but doesn't seem to work like that
anymore.

------
arvinsim
If I can emulate MacOS workspace shortcuts on Windows, I would use it a lot
more.

Muscle memory is sometimes a curse.

------
K0SM0S
I'm curious, why copy from Windows 10 instead of e.g. KDE (Plasma) which has
so much more features and such a better UX overall?

~~~
lwouis
When I was on Linux I always used i3, so I'm not familiar with KDE. Could you
please elaborate on these extra features and how the UX is better?

~~~
eitland
Different strokes for different folks I guess.

Personally I love KDE (install Neon, mostly leave it alone, as it os perfect
for me).

Other people will be happy with KDE because they can customize it to their
hearts content. You can even make KDE look and work like MacOS if you want.

Other people (notably a number here on HN) will immediately start commenting
about how there are too many options in KDE and how the developers should
rather fix some jarring alignment issues that people like me cannot see.

Don't worry too much about us KDE users. You've already made my day better
just by trying to fix one of the things that made me give up Mac after three
years of trying.

------
ComputerGuru
That’s funny. I wrote a utility to bring macOS-style window switching for
Windows 10 a few years ago: [https://neosmart.net/blog/2017/easy-window-
switcher/](https://neosmart.net/blog/2017/easy-window-switcher/)

(Don’t worry, it’s still updated and maintained.)

Also submitted as another Show HN, somewhat tongue-in-cheek, because why not?
[https://news.ycombinator.com/item?id=21255305](https://news.ycombinator.com/item?id=21255305)

~~~
rjblackman
thanks I've been looking for something like this. once you understand the cmd-
tab, cmd-` behaviour from macos, you realize microsoft made the wrong ui
decision with their alt-tab.

~~~
kristiandupont
This is certainly not the realization that I have reached.

To me, "app" is an arbitrary grouping that I don't really care about. I have
little mental projects in my head with a couple of windows related to them.
That could be a browser window and an instance of vscode. The fact that I
might have another set of windows that happen to use those same apps doesn't
mean that I want them to pollute my z-index when switching back and forth.

Yes, I know about spaces or multiple desktops or whatever but for some reason
those don't sit will with me.

------
PunksATawnyFill
How about fixing the problem where Apple doesn't restore the minimized app
when you switch to it?

Kind of defeats the purpose of tabbing through apps in the first place, when
you leave it minimized in the dock after you switch to it.

DUHHHH Apple.

~~~
oneplane
That's what hide is for. cmd+h hides the app+windows, going back to it
immediately restores all of it.

