v0.1.2
niri-wm/niriv0.1.2Feb 17, 2024by YaLTeR
AI Summary
Celebrating 1000 stars, this release adds window opening animations, configurable animation settings, and idle protocols (ext-idle-notify) for tools like swayidle. It also enables invoking actions via IPC and begins window rule support.
Key Highlights
- Window opening animations (fade in and movement).
- Configurable animation settings in the config file.
- Idle protocols support for screen locking/suspension.
- IPC actions allowing programmatic invocation of binds.
- Basic window rules for `default-column-width` and `open-on-output`.
Breaking Changes
- Requires libinput >= 1.21.
- The `niri-visual-tests` subcrate is now included and should be excluded from packaging.
- The `animation-slowdown` debug flag has been removed.
New Features
- Window opening animations.
- Idle protocols (ext-idle-notify and idle-inhibit).
- IPC command expansion (`niri msg action ...`).
- Window rules (regex matching).
- Improved focus stealing prevention for dialogs.
- DRM leasing support for VR applications.
Full Release Notes
Thanks everyone for 1000 stars! 🥳
Niri is a scrollable-tiling Wayland compositor. Windows are arranged in columns on an infinite strip going to the right. Opening a new window never causes existing windows to resize.
Here are the improvements from the last release.
> [!NOTE]
> Packagers: niri now requires libinput >= 1.21.
>
> The new niri-visual-tests subcrate is development-only and should not be packaged. If you do `cargo test --workspace`, make sure to exclude it: `cargo test --workspace --exclude niri-visual-tests`, as it brings extra native dependencies.
### Window opening animations
Windows now appear with an animation! Existing windows to the right move away, and the new window fades in, avoiding sudden visual jumps. All happening quickly enough to hopefully not be distracting.
https://github.com/YaLTeR/niri/assets/1794388/f1ebf2e5-0eb1-4b8f-9eba-6afe60604989
More animations are coming, but they need time and work to implement *right*.
### Animation settings
If you prefer reduced motion, or on the contrary if you want *more* animation, you can now set this up in a [new `animations` config section](https://github.com/YaLTeR/niri/blob/v0.1.2/resources/default-config.kdl#L207). There's a flag to turn off, and a setting to adjust speed for all animations at once, as well as settings for every individual animation should you need it.
These settings replace the now-removed `animation-slowdown` debug flag.
### Idle protocols
Niri now implements the ext-idle-notify and idle-inhibit pair of Wayland protocols. This allows tools like [`swayidle`](https://github.com/swaywm/swayidle) to work, and clients like `mpv` to pause them from working while you're watching videos.
As a bonus, I also implemented the `org.freedesktop.ScreenSaver` D-Bus interface for idle inhibiting, used by xdg-desktop-portal-gtk. This was necessary to make Flatpak Firefox correctly inhibit the idle state, and in general covers more applications.
### Invoke actions via IPC
As the first expansion to the `niri msg` command, you can now invoke *any bindable action* with `niri msg action do-something`. That is, if you can bind something like `Mod+F { maximize-column; }`, then you can also call it programmatically with `niri msg action maximize-column`.
Turns out, one thing IPC actions are pretty convenient for is scripting video demos, like the one above!
Also, niri now has a way to report errors back to the IPC client, instead of leaving it in the dark for requests that don't otherwise need a response.
### Window rules (the beginnings thereof)
You can now set some (at the moment, two) settings on a per-window basis. You can match or exclude windows from a rule with regular expressions on app-id and window title, similarly to other compositors. See the default config for a [detailed explanation](https://github.com/YaLTeR/niri/blob/v0.1.2/resources/default-config.kdl#L257).
The settings you can currently set are `default-column-width` and `open-on-output`. Most notably, this lets you work around WezTerm's initial configure bug:
```
window-rule {
// This regexp is intentionally made as specific as possible.
// You can get away with app-id="wezterm" if you want.
match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width {}
}
```
More rules, including dynamically updating ones, are coming, after some refactors.
### Better focus stealing prevention
To minimize your distraction, niri prevents new windows from taking focus while you're in a fullscreen application (I've had enough games ruined by a sudden Steam chat message). In this release, niri will additionally track when a newly opened window is a dialog from a particular existing window, and put that dialog to the immediate right from its parent window. The dialog will get focus only if the parent window was focused.
This change both prevents some random client from a different monitor/workspace from taking focus with a sudden dialog (looking at you, syncthing-gtk), and lets dialogs originating from fullscreen windows take focus as expected, bypassing the normal fullscreen focus stealing prevention.
### Improved filtering in the hotkey overlay
The hotkey overlay shows a hardcoded set of binds that I deemed "most important". Included are the `spawn` actions, because binds like "spawn terminal" and "spawn application launcher" are definitely up there in the importance list.
However, not all commands you might want to `spawn` are that important, and with a lot of binds, the list could get polluted with many entries like *XF86AudioRaiseVolume*. Filtering based on program name doesn't sound very robust, so, instead, now the hotkey overlay will only show `spawn` binds with `Mod` or `Super` in the hotkey.
Additionally, out of multiple `spawn` binds to the same command, only the first one will show up in the hotkey overlay, which is consistent with all other hotkeys.
<table>
<thead>
<tr>
<th>Before</th>
<th>After</th>
</tr>
</thead>
<tbody>
<tr>
<td valign="top"><img alt="Hotkey overlay before the change." src="https://github.com/YaLTeR/niri/assets/1794388/549d257f-def8-45a7-967c-e63de7d9db98"></td>
<td valign="top"><img alt="Hotkey overlay after the change." src="https://github.com/YaLTeR/niri/assets/1794388/dff82430-5440-4a20-8b5d-e8ec9dd96fa2"></td>
</tr>
</tbody>
</table>
### Other improvements
- Fixed a crash with some monitors with weird EDID data, and fixed inability to light up some monitors by filtering out interlaced modes.
- Implemented DRM leasing. This lets you use VR applications and headsets with niri. Thanks @Supreeeme for working on this!
- Added `consume-or-expel-window-{left,right}` actions that either expel the focused window into its own column, or consume a singular focused window into a column. These act as an alternative to the existing consume and expel commands, and are not bound to any keys by default. Thanks @exoticorn for implementing them!
- Added a `dwtp` flag to touchpad settings for disable-when-trackpointing.
- Added `trackpoint` input settings. Thanks @okvik for implementing them!
- Added a way to bind / IPC-invoke `quit` while skipping the "Are you sure you want to exit niri?" dialog: `Mod+Shift+E { quit skip-confirmation=true; }`.
- You can no longer spawn multiple lockscreen clients at once (more relevant now with swayidle).
- Fixed binds like `Super+Q` not working (you had to spell it out as `Mod+Super+Q`).
- Changed the default `swaylock` bind from `Mod+Alt+L` to `Super+Alt+L` to fix a collision with the `Mod+L` bind when running niri as a window (not sure how I missed this in testing). You don't usually want to "lock the screen" of a nested niri anyway.
- Monitors powered off with DPMS will now light up upon switching the TTY back to niri.
- The `NIRI_SOCKET` environment variable is now exported into the systemd and D-Bus session, which lets systemd units run `niri msg`. For example, this [allows](https://github.com/YaLTeR/niri/wiki/Example-systemd-Setup) you to run `swayidle` as a systemd service.
- Fixed a Smithay bug which mistakenly sent primary-selection to wlr-data-control v1 clients, causing them to crash (thanks @kchibisov).
- Fixed `border` using focus ring's default values instead of its own.
- Fixed omitting the `layout` config section resulting in `gaps 0` instead of the default `gaps 16`.
- Fixed target monitor not getting focus when pressing `move-column-to-monitor-*` on an empty source monitor.