Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

On Gnome I can use "Super key" + left key if I need multiple aligned windows on my screen. Can you still convince me to try i3 :) ?


On my left side of my screen, I have a series of code windows that I can reach in a tabbed fashion. They're in different code editors. On my right is a notepad stacked vertically with a web browser with documentation. I want to open a new terminal and have everything scoot to the side, then go back to the way it was after I close it. How do I do that with "Super key" + left?

It's something that doesn't seem useful until you've done it for a while, and then it's hard to go back.


Workspaces are per monitor so its easy to switch all screens at once or just one at a time.

Further i3 has keybinding modes which are sets of keybindings that are activated together. These work like user definable vim modes. A given binding can do one or more operations, and optionally exit the mode.

A brief example.

Everything not in a mode is in the default mode.

A command mode wherein every key is either an action or a mode entered by tapping and releasing left shift.

A workspace switch mode entered by w in command wherein a key is bound to switch to switching to that letter ws. eg left-shift -> w -> a switch to workspace a

An open mode wherein keys are bound to individual applications eg t for terminal b for browser. left-shift -> o t open terminal

Another mode to move a given window to given letter workspace. Another to do the same and switch to it. Another to focus the same app defined in the open mode. Another to get the app from the letter ws.

A mode to control audio including hotkeys for navigating tracks, changing volume, switching all playing streams to different devices, toggling playback.

A mode to kill either the focused app, all in the current workspace or all in the screen. left-shift -> q -> q for current focused, q w for the workspace q e for all visible windows.

You can tab or stack(vertical tab) any app.

You can assign particular workspaces to monitors and particular apps to particular workspaces.

You can a built in tool to run commands based on window rules.

You can save and restore entire windows layouts.


> Workspaces are per monitor so its easy to switch all screens at once or just one at a time.

This alone keeps me using i3.


i3's "scratchpad" alone is worth switching. You can show/hide a floating window on any workspace with a single hotkey. I use Chrome's app mode to launch dedicated windows for frequently used sites (Calendar, Slack, DevDocs) and I can call them up easily. Works wonderfully for native apps, too, like Spotify.

I tried Gnome recently, and although it's very polished, I switched back to i3 because it wasn't nearly as intuitive to drive with the keyboard.


Honestly, I don't like scratchpad. If you use it on multiple windows, doing `scratchpad show` multiple times causes one window to appear, then disappear, then next window appear, then disappear... and it does this across workspaces. I don't understand when I'd need something like that. It's a weird feature.

Instead, something I really wanted was to be able to toggle the hiding and showing of all floating windows per workspace. It sometimes happens that I just want to work with floating windows for a while, and the number of windows explodes, and I end up with all these floating windows on top of my tiled windows. Using i3 with the default configuration, I had to manually move all floating windows out of the way to get to the tiling windows below, and then move them back when I wanted to work with them again. That was cumbersome, so I did this:

bindsym $mod+Tab exec "current_workspace=\\"$(i3-msg -t get_tree | jq -r 'recurse(.nodes[]) | select(.type == \\"workspace\\" and ([recurse((.nodes, .floating_nodes)[])] | any(.focused))) | .name')\\"; floating_workspace=\\"F${current_workspace%:*}\\"; if i3-msg -t get_tree | jq -e \\"recurse(.nodes[]) | select(.type == \\\\"workspace\\\\" and .name == \\\\"$current_workspace\\\\") | .floating_nodes | length > 0\\"; then i3 \\"[workspace=$current_workspace floating] move to workspace $floating_workspace\\"; else i3 \\"[workspace=$floating_workspace floating] move to workspace $current_workspace\\"; fi"

Now, I just press Super+Tab and all floating windows on workspace e.g. 6:some-topic get moved to new workspace F6, and when I press it again they're moved back to 6:some-topic, right where they were. This is workspace independent; the windows belong to a workspace. I can hide the floating windows of however many workspace I want and call them back and they won't get mixed.

I think it's pretty cool that i3's configuration and tooling allow for this kind of advanced configuration. It's like I added a whole new feature.


> If you use it on multiple windows, doing `scratchpad show` multiple times causes one window to appear, then disappear, then next window appear, then disappear... and it does this across workspaces.

You need to create a keybinding that calls `scratchpad show` using a window class qualifier to target the app you want. That's the key to making the scratchpad useful.


I've been using i3 for years but somehow I missed the scratchpad. It does sound like a time-saver. Thanks for your tips!


bindsym $mod+grave for_window [class=“st-256color”] scratchpad show

Problem solved! Here is your quake terminal toggle.


What I like most about i3 is:

1) You can control it from the shell (and hence scripts and hotkeys). For example, `i3 "move to workspace prev"` moves the window to the previous workspace.

2) You can obtain a lot of information of the window manager state (all windows, their sizes, their tree structure, the marks, etc) from i3-msg in JSON format.

1 and 2 mean that the WM is very highly programmable via the programming language of your choice.

3) Workspaces are not fixed. Empty workspaces don't exist unless you're currently in them. You can move a window to a workspace of any name and it will get created. Empty a workspace and when you move away from it, it will be destroyed. This makes it very convenient to work with temporary workspaces.

4) Windows are arranged in a tree structure. Normal windows are leaves. Containers are the branches that take you to those leaves. Containers can be in 4 modes: vertical, horizontal, stacked, or tabbed. That last one means you can tab any set of windows. Why do so many applications implement tabbing when it should be the window manager's job? Stacked is very cool in that it's like tabbing, but the window title doesn't shrink with each added window you have in them. Anyway, this point means that you get a lot of flexibility in how you organize your windows.

5) The configuration gives you a lot of control. These are many small things, so I won't list them all, but as an example, I can put a colored prefix on window and container titles to remind me what they're about without having to focus on them and see their content. I can also match new windows by some criteria and have them appear in a container I tagged without them gaining focus. This is very useful for when I'm doing something in the shell that will cause a window (or multiple) to repeatedly appear but I don't want to lose focus from the shell and I don't want the new window(s) to appear on top of it. As an example of this, I may be running selenium tests which could cause a browser window to appear to show how the tests run. I may also be doing some ad-hoc statistics in octave (cli) and have graph windows appear.


You can change window focus from the keyboard, have more than two equally-sized windows, split in both directions, control the wm via i3-msg commands, autostart programs easily.


I've been getting into i3, but I haven't made any use of i3-msg yet. Are there any good tutorials to get started?


Check out Luke Smith. He has a few good tutorials on i3. He’s at lukesmith.xyz


Yeah. I’ve replaced IDEA tabs with i3 windows. They’re way easier to manage.


I use dwm, but it is similar. It has a master area and a stack. The windows "snap" functionality is in several DE now, including gnome. The difference in tiling wm is that 1) it is far more flexible than just one window left and one window right 2) it doesnt take an extra keyboard shortcut, it organizes them automatically.

I would say flip the question around: if I can automatically tile windows, why would I use gnome where I have to do it manually?


Actually, I found this pretty useful. I have to use "graphical" programs (browser, IDE, email client) rather than terminal based ones. And the graphical ones seem to assume that their windows are pretty large.

Let's say I start my server in my IDE and I use my browser to interact with it. Then the bottom right of the IDE (where the console output of the server is) will be visible even with the browser in focus, and so I can see what the log output is doing.

I have got keyboard shortcuts that move windows to predefined positions with predefined sizes. E.g. full height but only the right 85% of the screen. Or full width but only 90% of the height.


i3 has much better multi monitor support.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: