|
| 1 | +### Overview |
| 2 | + |
| 3 | +<sup>Since: next release</sup> |
| 4 | + |
| 5 | +In this section you can configure the recent windows switcher (Alt-Tab). |
| 6 | + |
| 7 | +Here is an outline of the available settings and their default values: |
| 8 | + |
| 9 | +```kdl |
| 10 | +recent-windows { |
| 11 | + // off |
| 12 | + open-delay-ms 150 |
| 13 | +
|
| 14 | + highlight { |
| 15 | + active-color "#999999ff" |
| 16 | + urgent-color "#ff9999ff" |
| 17 | + padding 30 |
| 18 | + corner-radius 0 |
| 19 | + } |
| 20 | +
|
| 21 | + previews { |
| 22 | + max-height 480 |
| 23 | + max-scale 0.5 |
| 24 | + } |
| 25 | +
|
| 26 | + binds { |
| 27 | + Alt+Tab { next-window; } |
| 28 | + Alt+Shift+Tab { previous-window; } |
| 29 | + Alt+grave { next-window filter="app-id"; } |
| 30 | + Alt+Shift+grave { previous-window filter="app-id"; } |
| 31 | +
|
| 32 | + Mod+Tab { next-window; } |
| 33 | + Mod+Shift+Tab { previous-window; } |
| 34 | + Mod+grave { next-window filter="app-id"; } |
| 35 | + Mod+Shift+grave { previous-window filter="app-id"; } |
| 36 | + } |
| 37 | +} |
| 38 | +``` |
| 39 | + |
| 40 | +`off` disables the recent windows switcher altogether. |
| 41 | + |
| 42 | +### `open-delay-ms` |
| 43 | + |
| 44 | +Delay, in milliseconds, between pressing the Alt-Tab bind and the recent windows switcher visually appearing on screen. |
| 45 | + |
| 46 | +The switcher is delayed by default so that quickly tapping Alt-Tab to switch windows wouldn't cause annoying fullscreen visual changes. |
| 47 | + |
| 48 | +```kdl |
| 49 | +recent-windows { |
| 50 | + // Make the switcher appear instantly. |
| 51 | + open-delay-ms 0 |
| 52 | +} |
| 53 | +``` |
| 54 | + |
| 55 | +### `highlight` |
| 56 | + |
| 57 | +Controls the highlight behind the focused window preview in the recent windows switcher. |
| 58 | + |
| 59 | +- `active-color`: normal color of the focused window highlight. |
| 60 | +- `urgent-color`: color of an urgent focused window highlight, also visible in a darker shade on unfocused windows. |
| 61 | +- `padding`: padding of the highlight around the window preview, in logical pixels. |
| 62 | +- `corner-radius`: corner radius of the highlight. |
| 63 | + |
| 64 | +```kdl |
| 65 | +recent-windows { |
| 66 | + // Round the corners on the highlight. |
| 67 | + highlight { |
| 68 | + corner-radius 14 |
| 69 | + } |
| 70 | +} |
| 71 | +``` |
| 72 | + |
| 73 | +### `previews` |
| 74 | + |
| 75 | +Controls the window previews in the switcher. |
| 76 | + |
| 77 | +- `max-scale`: maximum scale of the window previews. |
| 78 | +Windows cannot be scaled bigger than this value. |
| 79 | +- `max-height`: maximum height of the window previews. |
| 80 | +Further limits the size of the previews in order to occupy less space on large monitors. |
| 81 | + |
| 82 | +On smaller monitors, the previews will be primarily limited by `max-scale`, and on larger monitors they will be primarily limited by `max-height`. |
| 83 | + |
| 84 | +The `max-scale` limit is imposed twice: on the final window scale, and on the window height which cannot exceed `monitor height × max scale`. |
| 85 | + |
| 86 | +```kdl |
| 87 | +recent-windows { |
| 88 | + // Make the previews smaller to fit more on screen. |
| 89 | + previews { |
| 90 | + max-height 320 |
| 91 | + } |
| 92 | +} |
| 93 | +``` |
| 94 | + |
| 95 | +```kdl |
| 96 | +recent-windows { |
| 97 | + // Make the previews larger to see the window contents. |
| 98 | + previews { |
| 99 | + max-height 1080 |
| 100 | + max-scale 0.75 |
| 101 | + } |
| 102 | +} |
| 103 | +``` |
| 104 | + |
| 105 | +### `binds` |
| 106 | + |
| 107 | +Configure binds that open and navigate the recent windows switcher. |
| 108 | + |
| 109 | +The defaults are <kbd>Alt</kbd><kbd>Tab</kbd> / <kbd>Mod</kbd><kbd>Tab</kbd> to switch across all windows, and <kbd>Alt</kbd><kbd>\`</kbd> / <kbd>Mod</kbd><kbd>\`</kbd> to switch between windows of the current application. |
| 110 | +Adding <kbd>Shift</kbd> will switch windows backwards. |
| 111 | + |
| 112 | +Adding the recent windows `binds {}` section to your config removes all default binds. |
| 113 | +You can copy the ones you need from the summary at the top of this wiki page. |
| 114 | + |
| 115 | +```kdl |
| 116 | +recent-windows { |
| 117 | + // Even an empty binds {} section will remove all default binds. |
| 118 | + binds { |
| 119 | + } |
| 120 | +} |
| 121 | +``` |
| 122 | + |
| 123 | +The available actions are `next-window` and `previous-window`. |
| 124 | +They can optionally have the following properties: |
| 125 | + |
| 126 | +- `filter="app-id"`: filters the switcher to the windows of the currently selected application, as determined by the Wayland app ID. |
| 127 | +- `scope="all"`, `scope="output"`, `scope="workspace"`: sets the pre-selected scope when this bind is used to open the recent windows switcher. |
| 128 | + |
| 129 | +```kdl |
| 130 | +recent-windows { |
| 131 | + // Pre-select the "Output" scope when switching windows. |
| 132 | + binds { |
| 133 | + Mod+Tab { next-window scope="output"; } |
| 134 | + Mod+Shift+Tab { previous-window scope="output"; } |
| 135 | + Mod+grave { next-window scope="output" filter="app-id"; } |
| 136 | + Mod+Shift+grave { previous-window scope="output" filter="app-id"; } |
| 137 | + } |
| 138 | +} |
| 139 | +``` |
| 140 | + |
| 141 | +The recent windows binds have a precedence over the [normal binds](./Configuration:-Key-Bindings.md), meaning that if you have <kbd>Alt</kbd><kbd>Tab</kbd> bound to something else in the normal binds, the `recent-windows` bind will override it. |
| 142 | + |
| 143 | +All binds in this section must have a modifier key like <kbd>Alt</kbd> or <kbd>Mod</kbd> because the recent windows switcher remains open only while you hold any modifier key. |
| 144 | + |
| 145 | +#### Bindings inside the switcher |
| 146 | + |
| 147 | +When the switcher is open, some hardcoded binds are available: |
| 148 | + |
| 149 | +- <kbd>Escape</kbd> cancels the switcher. |
| 150 | +- <kbd>Enter</kbd> closes the switcher confirming the current window. |
| 151 | +- <kbd>A</kbd>, <kbd>W</kbd>, <kbd>O</kbd> select a specific scope. |
| 152 | +- <kbd>S</kbd> cycles between scopes, as indicated by the panel at the top. |
| 153 | +- <kbd>←</kbd>, <kbd>→</kbd>, <kbd>Home</kbd>, <kbd>End</kbd> move the selection directionally. |
| 154 | + |
| 155 | +Additionally, certain regular binds will automatically work in the switcher: |
| 156 | + |
| 157 | +- focus column left/right and their variants: will move the selection left/right inside the switcher. |
| 158 | +- focus column first/last: will move the selection to the first or last window. |
| 159 | +- close window: will close the window currently focused in the switcher. |
| 160 | +- screenshot: will open the screenshot UI. |
| 161 | + |
| 162 | +The way this works is by finding all regular binds corresponding to these actions and taking just the trigger key without modifiers. |
| 163 | +For example, if you have <kbd>Mod</kbd><kbd>Shift</kbd><kbd>C</kbd> bound to `close-window`, in the window switcher pressing <kbd>C</kbd> on its own will close the window. |
| 164 | + |
| 165 | +This way we don't need to hardcode things like HJKL directional movements. |
| 166 | +If you have, say, Colemak-DH MNEI binds instead, they will work for you in the window switcher (as long as they don't conflict with the hardcoded ones). |
0 commit comments