MyGit

v0.1.3

YaLTeR/niri

版本发布时间: 2024-03-09 19:12:32

YaLTeR/niri最新发布版本:v0.1.8(2024-08-10 20:40:27)

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: if you're not using systemd and the niri-session script, you may need to change your niri startup command to niri --session. Please read below on the changes for environments without systemd.

Also, please consider including the wp-viewporter revert: 40cec34aa4a7f99ab12b30cba1a0ee83a706a413 to fix a mouse input bug with Chromium and Electron apps.

Touchpad gestures

I grew annoyed enough with the lack of a horizontal touchpad gesture in niri, so I spent several days working on the gestures. I tried three different horizontal gesture behaviors, and the one I landed on does a fairly good job of moving the windows where you intended.

I also made many overall improvements to both the vertical and the horizontal gestures to make them feel very good. They are now inertial, meaning that a short flick is enough to take you to the next workspace, as the gesture will account for the speed of your fingers. Vertical gesture has rubberbanding at the edges, indicating that you can't go any further. Finally, both gestures use spring animations when releasing fingers, which feel natural as they also take the finger speed into account. If you swipe with enough force, you'll even get a small bounce at the edge!

https://github.com/YaLTeR/niri/assets/1794388/946a910e-9bec-4cd1-a923-4a9421707515

Thanks goes to the maintainers of libadwaita since that's where I copied lots of the code and numeric values from.

Spring animations

As part of the gesture work, niri now supports spring animations. These are physics-based animations that are especially well suited for gestures, but feel good on their own too. Based on the spring configuration, they can optionally give small bounces and oscillations.

I made three of the four default animations to use springs. If you had custom animation settings in your config, comment them out to give springs a try! Also, check the default config for a more detailed explanation and examples on how to set up spring animations.

https://github.com/YaLTeR/niri/assets/1794388/29c70f51-1c5e-4367-83c4-92707692a33e

Touch support

@cmeissl added basic touchscreen support to niri. Thanks!

Dramatic reenactment (this laptop doesn't have a touchscreen).

Gradient borders

Focus ring and borders can now use a linear gradient instead of a solid color!

image

This is how you can set it up:

layout {
    border {
        active-gradient from="#f38ba8" to="#f9e2af" angle=45 relative-to="workspace-view"
        inactive-gradient from="#585b70" to="#7f849c" angle=45 relative-to="workspace-view"
    }
}

Colors can use several CSS-like notations, and the gradient itself is rendered like CSS linear-gradient(angle, from, to). You can use some CSS gradient generator, like this one, to get a gradient you like, then copy the values into the niri config.

Also, gradients can be relative to windows individually (the default), or to the whole view of the workspace. It's easier to explain visually:

Default relative-to="workspace-view"
image image

By the way, regular colors can also now be written with CSS-like notations. The old four-number way is now deprecated.

// catppuccin-mocha Sapphire
active-color "#74c7ec"
// catppuccin-mocha Surface2
inactive-color "#585b70"

wlr-screencopy

While niri supports xdg-desktop-portal screencasting and has a built-in screenshot UI, these are not very well suited for taking programmatic screenshots (and the current screenshot portal API isn't very good either). So, in this release, niri implements wlr-screencopy version 1 (not 3). Now you can take screenshots with grim.

Screen recording tools based on wlr-screencopy will need version 3, so they won't work for now. (The screencast portal is better for this anyway; for example, it leaves frame pacing entirely to the compositor, where it belongs.) Version 1 should be sufficient for any screenshot tool; if a screenshot tool complains that it needs version 3 then it likely needs a simple patch to avoid requesting version 3 if unavailable.

Like other security-sensitive protocols, wlr-screencopy is not available to sandboxed clients with a security context (such as Flatpaks).


Finally, all three of my outputs on a single screenshot.

Thanks to @sodiboo for implementing wlr-screencopy support!

Frame timing fixes

I fixed several issues in the presentation time handling and frame callback tracking logic.

Stricter config validation

Due to the ease of use in knuffel, the KDL parsing library we use in niri, some nodes technically accepted multiple children, despite only expecting one. Specifically, default-column-width {} and binds. Also, you could write multiple binds to the same key combination, which is similarly not supported.

This has been fixed to cause a config validation error. While technically a config-breaking change, it's more of a bug fix, since before all these extra nodes that you could write were ignored. Therefore I considered it fine to include in a minor niri version bump.

Thanks @sodiboo for implementing this validation!

Refactored window creation flow

I reworked the window creation flow and tracking of unmapped windows in niri to make it more robust and less "all over the place". As part of this:

Systemd scopes

When niri runs applications it will now put them into transient systemd scopes. One concrete benefit is that when an application uses too much RAM and systemd-oomd kills it, niri won't go down alongside the app, so the rest of your session will stay intact.

Many other tools (like Flatpak, tmux, or systemd itself) already do this for the commands they spawn, so niri joins this established practice.

┌ ~
└─ systemctl --user status
● sparklingbrook
    State: running
    Units: 444 loaded (incl. loaded aliases)
     Jobs: 0 queued
   Failed: 0 units
    Since: Mon 2024-03-04 10:25:20 +04; 4 days ago
  systemd: 254.9-1.fc39
   CGroup: /user.slice/user-1000.slice/user@1000.service
           ├─app.slice
           │ ├─app-niri-alacritty-1672431.scope
           │ │ ├─1672431 alacritty
           │ │ ├─1672446 /usr/bin/fish
           │ │ └─1672578 systemctl --user status --no-pager
           │ ├─app-niri-fuzzel-1672466.scope
           │ │ └─1672468 /var/home/yalter/stuff/blender-4.0.2-linux-x64/blender
<...>
           ├─session.slice
           │ ├─niri.service
           │ │ └─1663138 /usr/bin/niri --session
<...>

Also, since the niri.service scope now only contains niri itself, I have moved it into session.slice, a slice for important services such as the compositor.

Running without systemd

I've made it easier to run niri in environments without systemd.

So, if you package niri:

Other improvements in this release

相关地址:原始地址 下载(tar) 下载(zip)

1、 niri-0.1.3-vendored-dependencies.tar.xz 53.04MB

查看:2024-03-09发行的版本