niri
Clone
https://git.tahinli.com/Tahinli/niri.git
0 watching·0 forks·Rust·GPL-3.0·12.1 MiB·9d8f4f8·Ivan Molodetskikh·1 month ago·2997 commits
| 1 | ### Overview |
| 2 | |
| 3 | Niri has dynamic workspaces that can move between monitors. |
| 4 | |
| 5 | Each monitor contains an independent set of workspaces arranged vertically. |
| 6 | You can switch between workspaces on a monitor with `focus-workspace-down` and `focus-workspace-up`. |
| 7 | Empty workspaces "in the middle" automatically disappear when you switch away from them. |
| 8 | |
| 9 | There's always one empty workspace at the end (at the bottom) of every monitor. |
| 10 | When you open a window on this empty workspace, a new empty workspace will immediately appear further below it. |
| 11 | |
| 12 | You can move workspaces up and down on the monitor with `move-workspace-up/down`. |
| 13 | The way to put a window on a new workspace "in the middle" is to put it on the last (empty) workspace, then move the workspace up to where you need. |
| 14 | |
| 15 | Here's a visual representation that shows two monitors and their workspaces. |
| 16 | The left monitor has three workspaces (two with windows, plus one empty), and the right monitor has two workspaces (one with windows, plus one empty). |
| 17 | |
| 18 | <picture> |
| 19 | <source media="(prefers-color-scheme: dark)" srcset="./img/workspaces-dark.png"> |
| 20 | <img alt="Two monitors. First with three workspaces, second with two workspaces." src="./img/workspaces-light.png"> |
| 21 | </picture> |
| 22 | |
| 23 | You can move a workspace to a different monitor using binds like `move-workspace-to-monitor-left/right/up/down` and `move-workspace-to-monitor-next/previous`. |
| 24 | |
| 25 | When you disconnect a monitor, its workspaces will automatically move to a different monitor. |
| 26 | But, they will also "remember" their original monitor, so when you reconnect it, the workspaces will automatically move back to it. |
| 27 | |
| 28 | > [!TIP] |
| 29 | > From other tiling WMs, you may be used to thinking about workspaces like this: "These are all of my workspaces. I can show workspace X on my first monitor, and workspace Y on my second monitor." |
| 30 | > In niri, instead, think like this: "My first monitor contains these workspaces, including X and Y, and my second monitor contains these other workspaces. I can switch my first monitor to workspace X or Y. I can move workspace Y to my second monitor to show it there." |
| 31 | |
| 32 | ### Addressing workspaces by index |
| 33 | |
| 34 | Several actions in niri can address workspaces "by index": `focus-workspace 2`, `move-column-to-workspace 4`. |
| 35 | This index refers to whichever workspace *currently happens to be* at this position on the focused monitor. |
| 36 | So, `focus-workspace 2` will always put you on the second workspace of the monitor, whichever workspace that currently is. |
| 37 | |
| 38 | This is an important distinction from WMs with static workspace systems. |
| 39 | In niri, workspaces *do not have indices on their own*. |
| 40 | If you take the first workspace and move it further down on the monitor, `focus-workspace 1` will now put you on a different workspace (the one that was below the first workspace before you moved it). |
| 41 | |
| 42 | When you want to have a more permanent workspace in niri, you can create a [named workspace](./Configuration:-Named-Workspaces.md) in the config or via the `set-workspace-name` action. |
| 43 | You can refer to named workspaces by name, e.g. `focus-workspace "browser"`, and they won't disappear when they become empty. |
| 44 | |
| 45 | > [!TIP] |
| 46 | > You can try to emulate static workspaces by creating workspaces named "one", "two", "three", ..., and binding keys to `focus-workspace "one"`, `focus-workspace "two"`, ... |
| 47 | > This can work to some extent, but it can become somewhat confusing, since you can still move these workspaces up and down and between monitors. |
| 48 | > |
| 49 | > If you're coming from a static workspace WM, I suggest *not* doing that, but instead trying the "niri way" with dynamic workspaces, focusing and moving up/down instead of by index. |
| 50 | > Thanks to scrollable tiling, you generally need fewer workspaces than on a traditional tiling WM. |
| 51 | |
| 52 | ### Example workflow |
| 53 | |
| 54 | This is how I like to use workspaces. |
| 55 | |
| 56 | I will usually have my browser on the topmost workspace, then one workspace per project (or a "thing") I'm working on. |
| 57 | On a single workspace I have 1–2 windows that fit inside a monitor that I switch between frequently, and maybe extra windows scrolled outside the view, usually either ones I need rarely, or temporary windows that I quickly close. |
| 58 | When I need another permanent window, I'll put it on a new workspace. |
| 59 | |
| 60 | I actively move workspaces up and down as I'm working on things to make what I need accessible in one motion. |
| 61 | For example, I usually frequently switch between the browser and whatever I'm doing, so I always move whatever I'm currently doing to right below the browser, so a single `focus-workspace-up/down` gets me where I want. |