Skip to content

Commit 0311782

Browse files
committed
Merge remote-tracking branch 'upstream' into force_render
2 parents 707ca08 + 7f19d26 commit 0311782

38 files changed

+3796
-186
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,18 +258,14 @@ jobs:
258258
# Required for the rust-cache action to work.
259259
- uses: dtolnay/rust-toolchain@stable
260260

261-
# FIXME: doesn't seem to cache the builds, only the downloads for some unknown reason.
262-
- uses: Swatinem/rust-cache@v2
263-
with:
264-
cache-all-crates: true
265-
266261
# Remove man-db triggers to speed up Ubuntu upgrade by a minute or two during vmactions/freebsd-vm action run.
267262
- run: |
268263
sudo rm /var/lib/dpkg/info/man-db.*
269264
270265
- name: Build
271266
uses: vmactions/freebsd-vm@966989c456d41351f095a421f60e71342d3bce41 # v1.2.1
272267
with:
268+
copyback: false
273269
prepare: |
274270
pkg update -f
275271
pkg install -y ${{ env.DEPS_PKG }}
@@ -289,6 +285,12 @@ jobs:
289285
nix:
290286
runs-on: ubuntu-24.04
291287
steps:
288+
- name: Free Disk Space (Ubuntu)
289+
uses: jlumbroso/[email protected]
290+
with:
291+
dotnet: false
292+
large-packages: false
293+
292294
- uses: actions/checkout@v4
293295
with:
294296
show-progress: false

docs/mkdocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ nav:
103103
- Layer Rules: Configuration:-Layer-Rules.md
104104
- Animations: Configuration:-Animations.md
105105
- Gestures: Configuration:-Gestures.md
106+
- Recent Windows: Configuration:-Recent-Windows.md
106107
- Debug Options: Configuration:-Debug-Options.md
107108
- Include: Configuration:-Include.md
108109
- Development:

docs/wiki/Configuration:-Animations.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ animations {
5858
overview-open-close {
5959
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
6060
}
61+
62+
recent-windows-close {
63+
spring damping-ratio=1.0 stiffness=800 epsilon=0.001
64+
}
6165
}
6266
```
6367

@@ -422,6 +426,20 @@ animations {
422426
}
423427
```
424428

429+
#### `recent-windows-close`
430+
431+
<sup>Since: next release</sup>
432+
433+
The close fade-out animation of the recent windows switcher.
434+
435+
```kdl
436+
animations {
437+
recent-windows-close {
438+
spring damping-ratio=1.0 stiffness=800 epsilon=0.001
439+
}
440+
}
441+
```
442+
425443
### Synchronized Animations
426444

427445
<sup>Since: 0.1.5</sup>

docs/wiki/Configuration:-Introduction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ You can find documentation for various sections of the config on these wiki page
1212
* [`layer-rule {}`](./Configuration:-Layer-Rules.md)
1313
* [`animations {}`](./Configuration:-Animations.md)
1414
* [`gestures {}`](./Configuration:-Gestures.md)
15+
* [`recent-windows {}`](./Configuration:-Recent-Windows.md)
1516
* [`debug {}`](./Configuration:-Debug-Options.md)
1617
* [`include "other.kdl"`](./Configuration:-Include.md)
1718

docs/wiki/Configuration:-Key-Bindings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ binds {
354354
Actions for taking screenshots.
355355

356356
- `screenshot`: opens the built-in interactive screenshot UI.
357-
- `screenshot-screen`, `screenshow-window`: takes a screenshot of the focused screen or window respectively.
357+
- `screenshot-screen`, `screenshot-window`: takes a screenshot of the focused screen or window respectively.
358358

359359
The screenshot is both stored to the clipboard and saved to disk, according to the [`screenshot-path` option](./Configuration:-Miscellaneous.md#screenshot-path).
360360

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
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).

docs/wiki/Getting-Started.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## Quick start
2+
3+
Use these commands to install niri with [DankMaterialShell](https://github.com/AvengeMedia/DankMaterialShell) for a fairly out-of-the-box experience.
4+
5+
Fedora:
6+
```
7+
sudo dnf copr enable avengemedia/dms
8+
sudo dnf install niri dms
9+
systemctl --user add-wants niri.service dms
10+
```
11+
12+
Arch Linux (via [paru](https://github.com/morganamilo/paru)):
13+
```
14+
sudo pacman -Syu niri xwayland-satellite xdg-desktop-portal-gnome xdg-desktop-portal-gtk
15+
paru -S dms-shell-bin matugen wl-clipboard cliphist cava qt6-multimedia-ffmpeg
16+
systemctl --user add-wants niri.service dms
17+
```
18+
19+
After running these commands, log out, choose Niri in your display manager, and log back in.
20+
Or, if not using a display manager, run `niri-session` on a TTY.
21+
22+
The default niri config will run Waybar, so you might get two bars on screen.
23+
To fix this, stop Waybar with `pkill waybar` command, then open `~/.config/niri/config.kdl` and delete the `spawn-at-startup "waybar"` line.
24+
25+
## Slower and more considered start
26+
127
The easiest way to get niri is to install one of the distribution packages.
228
Here are some of them: [Fedora COPR](https://copr.fedorainfracloud.org/coprs/yalter/niri/) and [nightly COPR](https://copr.fedorainfracloud.org/coprs/yalter/niri-git/) (which I maintain myself), [NixOS Flake](https://github.com/sodiboo/niri-flake), and some more from repology below, including a [pacstall package](https://pacstall.dev/packages/niri/) for Debian-based distros.
329
See the [Building](#building) section if you'd like to compile niri yourself and the [Packaging niri](./Packaging-niri.md) page if you want to package niri.

docs/wiki/Integrating-niri.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This is detailed on the [Important Software](./Important-Software.md) page.
5151

5252
On top of that, you may want to preconfigure some desktop shell components to make the experience less barebones.
5353
Niri's default config spawns [Waybar](https://github.com/Alexays/Waybar), which is a good starting point, but you may want to consider changing its default configuration to be less of a kitchen sink, and adding the `niri/workspaces` module.
54-
You will probably also want a desktop background tool ([swaybg](https://github.com/swaywm/swaybg) or [swww](https://github.com/LGFae/swww)), and a nicer screen locker (compared to the default `swaylock`), like [hyprlock](https://github.com/hyprwm/hyprlock/).
54+
You will probably also want a desktop background tool ([swaybg](https://github.com/swaywm/swaybg) or [awww (which used to be swww)](https://codeberg.org/LGFae/awww/)), and a nicer screen locker (compared to the default `swaylock`), like [hyprlock](https://github.com/hyprwm/hyprlock/).
5555

5656
Alternatively, some desktop environments and shells work with niri, and can give a more cohesive experience in one package:
5757

docs/wiki/Overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ layer-rule {
8888

8989
This will only work for *background* layer surfaces that ignore exclusive zones (typical for wallpaper tools).
9090

91-
You can run two different wallpaper tools (like swaybg and swww), one for the backdrop and one for the normal workspace background.
91+
You can run two different wallpaper tools (like swaybg and awww), one for the backdrop and one for the normal workspace background.
9292
This way you could set the backdrop one to a blurred version of the wallpaper for a nice effect.
9393

9494
You can also combine this with a transparent background color if you don't like the wallpaper moving together with workspaces:

docs/wiki/_Sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* [Layer Rules](./Configuration:-Layer-Rules.md)
3434
* [Animations](./Configuration:-Animations.md)
3535
* [Gestures](./Configuration:-Gestures.md)
36+
* [Recent Windows](./Configuration:-Recent-Windows.md)
3637
* [Debug Options](./Configuration:-Debug-Options.md)
3738
* [Include](./Configuration:-Include.md)
3839

0 commit comments

Comments
 (0)