v0.1.3 #251
YaLTeR
announced in
Announcements
v0.1.3
#251
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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 toniri --session
. Please read below on the changes for environments without systemd.Also, please consider including the wp-viewporter revert: 40cec34 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!
touchpad-gestures.mp4
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.
config-error-bounce.mp4
Touch support
@cmeissl added basic touchscreen support to niri. Thanks!
Gradient borders
Focus ring and borders can now use a linear gradient instead of a solid color!
This is how you can set it up:
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:
relative-to="workspace-view"
By the way, regular colors can also now be written with CSS-like notations. The old four-number way is now deprecated.
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).
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:
default-column-width {}
(unset, the app picks its own) caused the app to shrink a bit right after it appeared. This wasn't really noticeable, but it resulted in a smaller window size than what the app wanted. It is now fixed.default-column-width { fixed N; }
similarly not taking borders into account, resulting in a smaller window than the specified N.mpv --fs-screen=N
will now work).open-maximized true
window rule.open-fullscreen true/false
window rule. Setting it totrue
will fullscreen the window upon opening, and setting it tofalse
will deny the window from fullscreening upon opening.open-fullscreen false
will not work, because these window rules apply at the initial configure. So far I only sawmpv --fs
do this, so it's not a big problem (you can just remove the mpv flag).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.
Also, since the
niri.service
scope now only contains niri itself, I have moved it intosession.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.
systemd
which gates calls to the systemd D-Bus API. Currently, this includes starting transient scopes andsystemctl import-environment
.XDG_CURRENT_DESKTOP
andXDG_SESSION_TYPE
in the main binary, rather than in theniri-session
script.niri --session
flag for running niri as the main session instance, which means that it will import environment variables globally into systemd and D-Bus, and start D-Bus services. This flag replaces auto-detection based on the presence of theNOTIFY_SOCKET
variable.dinit
feature that runsdinitctl setenv
to import environment, and added ready notifications throughNOTIFY_FD
environment variable (thanks @metent).So, if you package niri:
niri --session
instead ofniri
.systemd
feature if needed.dinit
feature if your distribution uses dinit.Other improvements in this release
toggle-debug-tint
desynchronizing for newly connected outputs.toggle-debug-tint
.spawn
andspawn-at-startup
will now expand~
to the home directory in the command name, similarly to howscreenshot-path
does it. In the command arguments~
will not be expanded.environment {}
config section where you can control the environment variables that niri sets for the commands it spawns.Xwayland -fullscreen
work (that flag makes it emulate a specific screen resolution for the clients inside).niri msg action quit
on click will now work as expected.error!
log messages towarn!
for consistency. In niri,error!
always indicates a bug in our code. If something can happen without a bug in niri, then it should be awarn!
.This discussion was created from the release v0.1.3.
Beta Was this translation helpful? Give feedback.
All reactions