Live data from Hacker News

Show HN: I3wm Alt+Tab Workspace Switcher

news.ycombinator.com

21–30 of 58 posts

Re: Show HN: I3wm Alt+Tab Workspace Switcher

#21
post #19

Earlier quoted context omitted.

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…

i've got you covered. I made a script to achieve exactly this.

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

#22

Isn't it much more efficient to simply use $mod+num_of_workspace like Alt+1, Alt+2?

You still have that available. This is for when you might not remember which workspace the stuff you're looking for or are just more visual in recognizing the workspace you need.

Re: Show HN: I3wm Alt+Tab Workspace Switcher

#23
i'm curious about OPs point of processing visual queues faster than specific keystrokes. The default config for workspaces is 1 through 9. How is it possible that it's harder to recall a specific workspace than process a visual queue?

None of that makes sense to me

Re: Show HN: I3wm Alt+Tab Workspace Switcher

#24

I've mostly moved away from i3, for XMonad where I have my workspace keys mapped to alt+qwer...zxcv in a waterfall pattern. That way workspace switching is always on one hand and I don't need to reach for the 10th workspace. On i3 though, I find myself scrolling through workspaces a lot, especially when I have a trackpoint available. It requires almost no precision to just throw the mouse to the bottom of the display…

I'm very new to i3 but could you not set up a similar set of keybinds with it? What does XMonad add for you?

EDIT: I've just stolen this btw. I was never using the higher workspaces because $mod+number gets less convenient on higher numbers. This pattern works great though, thanks!

Re: Show HN: I3wm Alt+Tab Workspace Switcher

#25
I think this is a really nice idea. I suspect I will continue using mod + {num} but I love the implementation.

I've always liked OS X's distinction between Alt + Tab which switches between App, and then Alt + ~ to switch between the windows of the apps. While using Windows the number of open windows quickly becomes too large for Alt + Tab to be useful for anything more than switching between a handful of recent windows.

But the problem with the OS X implementation is that after you switch to an app switching between windows is like throwing darts in teh dark. There is no overall context available at all.

Using Alt + Tab to switch between workspaces, and with a tiling window a workspace preview also shows you all teh windows in it, and once you switch to a workspace switching to the window you want is trivial, seems like a novel and significantly improved way to handle Alt + Tab navigation.

Re: Show HN: I3wm Alt+Tab Workspace Switcher

#26
post #2

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.

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…

> 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

#27

I think this is a really nice idea. I suspect I will continue using mod + {num} but I love the implementation. I've always liked OS X's distinction between Alt + Tab which switches between App, and then Alt + ~ to switch between the windows of the apps. While using Windows the number of open windows quickly becomes too large for Alt + Tab to be useful for anything more than switching between a handful of recent windo…

> But the problem with the OS X implementation is that after you switch to an app switching between windows is like throwing darts in teh dark. There is no overall context available at all.

There's also the fact that, IIRC, it brings all the non-minimized windows of the app to the front.

Re: Show HN: I3wm Alt+Tab Workspace Switcher

#28
post #26

Earlier quoted context omitted.

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…

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

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

#29
post #12

Earlier quoted context omitted.

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…

You can use the "focus parent" bind then move off of it with your regular left/right binds.

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

#30
post #21
post #19

Earlier quoted context omitted.

i've got you covered. I made a script to achieve exactly this.

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" ```

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.

Post reply on HN