News for hackers. Stuff that matters.
Re:Show HN: I3wm Alt+Tab Workspace Switcher by shric on Wednesday March 13, 2024 @08:50AM (#39690752)
One big reason I use i3 is because I find the Windows and macOS style alt/cmd tab incredibly unintuitive. It is not easy to consistently predict how many times to press it to get the desired result.

With i3 I bind keys to specific things (including workspaces) so I can switch instantly.

Re:Show HN: I3wm Alt+Tab Workspace Switcher by vladvasiliu on Wednesday March 13, 2024 @08:57AM (#39690801)
I've built something similar for my own needs.

What I found lacking in the default i3 possibilities, was going to the previously used window on the same workspace.

My daily driver is a 32" 4k monitor, so many times I end up with one IDE or terminal on the left, and some documentation on the right, both halves visible at the same time.

However, I hate using tabs in the browser, so thanks to a hacky extension, firefox opens a new window per tab, which means that i3 manages firefox' tabs as regular windows.

So, if you have a bunch of windows open, want to see the one in the middle of the bunch, but need to switch between that and the "work" window, there's no easy way to do that from the keyboard.

From the IDE, going right works as expected. But from the browser, going left "changes tabs". You only reach the IDE after you've been through all the other tabs.

Re:Show HN: I3wm Alt+Tab Workspace Switcher by mo_42 on Wednesday March 13, 2024 @10:02AM (#39691314)
> However, I hate using tabs in the browser, so thanks to a hacky extension, firefox opens a new window per tab, which means that i3 manages firefox' tabs as regular windows.

Can you provide a bit more information about your setup?

I'm using sway and I removed the tabs from Firefox to handle them as individual windows.

Re:Show HN: I3wm Alt+Tab Workspace Switcher by vladvasiliu on Wednesday March 13, 2024 @10:06AM (#39691352)
I don't have my machine on hand to give you the specific extension, but basically it's something called "notabs" or similar. Whenever a new tab is opened, it gets moved to a separate window. It works mostly OK, but it can sometimes get confused.

I combine this with some custom chrome to completely hide the tab bar area at all times.

Afterwards, I manage my firefox windows with i3 as I would any other window. They usually end up in tiled mode.

Re:Show HN: I3wm Alt+Tab Workspace Switcher by mo_42 on Wednesday March 13, 2024 @12:02PM (#39693160)
Thanks, I guess it would be the following extension:

https://addons.mozilla.org/de/firefox/addon/adsum-notabs/

For the custom chrome, I'm using in userChrome.css:

  #TabsToolbar { visibility: collapse !important; }
Re:Show HN: I3wm Alt+Tab Workspace Switcher by vladvasiliu on Wednesday March 13, 2024 @01:21PM (#39694414)
That's the one, yes.
Re:Show HN: I3wm Alt+Tab Workspace Switcher by skupig on Wednesday March 13, 2024 @09:08AM (#39690898)
You can use the "focus parent" bind then move off of it with your regular left/right binds.
Re:Show HN: I3wm Alt+Tab Workspace Switcher by vladvasiliu on Wednesday March 13, 2024 @10:08AM (#39691373)
Yeah, that works technically, but it's a PITA. Because you have to:

1. do an extra action

2. remember whether you actually have a parent or not, since it's context dependent. Doing this while the single-window IDE is selected, it'll do nothing (the parent is "everybody", so there's nothing to the right).

Re:Show HN: I3wm Alt+Tab Workspace Switcher by endre on Wednesday March 13, 2024 @09:46AM (#39691165)
i've got you covered. I made a script to achieve exactly this.
Re:Show HN: I3wm Alt+Tab Workspace Switcher by endre on Wednesday March 13, 2024 @09:48AM (#39691177)
https://end.re/9793ad90063fb74423e4b2ff4d5b198ab576110c9bfef...

and then trigger it with eg.:

``` bindsym $mod+x exec --no-startup-id "xargs -n1 kill -USR2 < /tmp/focus_last.pid" ```

Re:Show HN: I3wm Alt+Tab Workspace Switcher by vladvasiliu on Wednesday March 13, 2024 @10:10AM (#39691408)
Well, I've covered myself with a few lines of Rust that do exactly that.

By the way, there are a few subtleties which your script doesn't handle which bit me ;) Off the top of my head, some full-screen windows (mpv IIRC) behave a bit differently and would be missed.

Re:Show HN: I3wm Alt+Tab Workspace Switcher by cturner on Wednesday March 13, 2024 @09:40AM (#39691106)
The Windows alt+tab behaviour up to Windows 7 was reliable/predictable with two caveats, 1. Things that minimised to the notification area would not go to the back of the stack when you minimised them. 2. Microsoft Excel misbehaved - something to do with each workbook having its own window entry in the group, but also the application having this entry.

At some point since Windows 7 I played with it and found it to be no longer consistent. I could somewhat correct for this by using alt+esc to move a window to the back of the stack and then reverse to it with ctrl+shift+tab.

Re:Show HN: I3wm Alt+Tab Workspace Switcher by wdb on Wednesday March 13, 2024 @11:01AM (#39692061)
I like using Contexts on the Mac as replacement: https://contexts.co Looks like i3 does something similar?
Re:Show HN: I3wm Alt+Tab Workspace Switcher by quesera on Wednesday March 13, 2024 @03:42PM (#39696422)
Alt+Tab (or at least Cmd+Tab) works very predictably though, doesn't it? Most-recently-used order.

My work habits generally involve switching back and forth between two applications. Sometimes three.

Cmd+Tab switching works well for that. More convenient than, e.g., Cmd+3 then Cmd+7 etc.

I also appreciate Firefox's Ctrl+Tab for tab switching, which works the same way.