Show HN: I3wm Alt+Tab Workspace Switcher
https://github.com/iondodon/i3-switcher-x11
The i3wm Alt+Tab Workspace Switcher is a tool designed to bring the familiar Alt+Tab window switching functionality to the i3 window manager environment. It aims to enhance productivity by enabling users to switch between workspaces efficiently and intuitively, mimicking the window switching feature found in traditional desktop environments like Windows.
In my experience, using the $mod+workspace number to switch workspaces feels slower. I suspect this might be because I process visual cues more quickly than I recall specific keystrokes for each workspace. Alternatively, it could simply be due to my familiarity with the Alt+Tab behavior from Windows and macOS, which has influenced my preferences and habits.
57 comments
[ 2.7 ms ] story [ 116 ms ] threadWith i3 I bind keys to specific things (including workspaces) so I can switch instantly.
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.
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).
and then trigger it with eg.:
``` bindsym $mod+x exec --no-startup-id "xargs -n1 kill -USR2 < /tmp/focus_last.pid" ```
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.
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 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.
https://addons.mozilla.org/de/firefox/addon/adsum-notabs/
For the custom chrome, I'm using in userChrome.css:
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.
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.
https://github.com/cboddy/i3-workspace-names-daemon
for_window [class="(?i)firefox"] title_format "<tt></tt><span foreground='#FF6611'> </span><tt> </tt>%title
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 and scroll until you see the thing you want, then continue on your way.
Never once thought about wanting alt+tab, my hatred for inconsistent alt+tab is why I went to tiling wms in the first place.
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!
It was years ago at this point and i3 was giving me issues binding alt to one of the mods, while retaining super for other shortcuts. I've always been quick to get to get frustrated with config files so it was a nice off-ramp to learn something new.
None of that makes sense to me
I used to do this all the time when I was on a laptop as my primary machine, with many things either full screen windows or ~3 windows on the screen, and different tasks on different workspaces. "Back to last workspace" was something I used all the time.
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.
There's also the fact that, IIRC, it brings all the non-minimized windows of the app to the front.
Anyone else using anything out of the ordinary that they think is clever ?
bindsym $mod+Shift+P exec /home/calvin/bin/rename_workspace
bindsym $mod+Shift+F exec /home/calvin/bin/throw_window
alt-F -> "throw_window" launches dmenu with a list of all my windows so i can then select it and it will automatically switch me to the workspace that window is on and focus it
alt-P -> rename my workspace on the fly
https://git.ceux.org/throw_window.git/
https://git.ceux.org/i3-rename-workspace.git/
Windows: Alt-Tab will cycle through all open 'windows' (so if you have 2 different Word documents open, it will show both independently)
macOS: CMD-Tab will cycle through all open 'apps' (if you have 2 different Word documents open, macOS will not distinguish between them and only show you the last used Word doc)
E.g. If I have 2 Excelsheets open and 2 Word documents open, if Word is the current in-focus app ... CMD+` only cycles between the 2 Words documents (and does not cycle the Excel sheets)
Dear OS: If I have multiple instances of an application open it's because I'm doing different things. If one is a text editor, you should not act differently depending on if the other one is a PDF viewer or another text editor.
Many applications already have their own "grouping", usually called tabs. Web browsers being a really obvious one, and where this application grouping is the worst. Half my "apps" are really just web pages.
Grouping the window where I'm testing the web application I'm currently coding with the IDE where I'm working on the code would make way more sense than grouping it with my web-based email client... yet here we are.
I use https://github.com/OliverUv/quickswitch-for-i3/ to fuzzy select a buffer,
bindsym $mod+b exec --no-startup-id ~/projects/quickswitch-for-i3/quickswitch.py --swap
I have a "hidden" workspace where windows I don't want to look at goes to
bindsym $mod+Shift+x move container to workspace garbage
This lets me not worry about remembering which workspace something lives on, but just "pull" it to whatever window I'm on