v0.1.6 #350
Replies: 5 comments
-
Looks pretty dope! |
Beta Was this translation helpful? Give feedback.
-
yippee! mouse view scrolling is something i've been lowkey desiring for a while. i'm really glad that the feature has made it into niri!! |
Beta Was this translation helpful? Give feedback.
-
My favorite release so far! I can hardly believe how beautiful and smooth everything is right now. And here's a little tip for anyone using an image as their lock screen: try adding the |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
so pretty! |
Beta Was this translation helpful? Give feedback.
-
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.
We've now got a small setup showcase thread, be sure to check it out!
And here are the improvements from the last release.
Gestures
In this release, I added mouse gestures for resizing and scrolling the view. I also made a wiki page listing all existing gestures.
Interactive Window Resizing
You can now resize windows interactively with a mouse (yes, finally). Both by edge-dragging windows with client-side decorations, and anywhere on a window by holding Mod together with the right mouse button.
To complement this, there are two new double-click gestures: double-clicking a resize will expand the window to the full monitor width, or reset the window height to take up all available space, depending on the edge that you double-click. Thanks @FreeFull for suggesting these gestures!
Resetting the window height is also available as the new
reset-window-height
key binding.niri-interactive-resize.mp4
Despite the ubiquity, interactive resizing proved quite tricky to implement with plenty of edge cases (tiling makes it harder since multiple things need to coordinate together). The main challenge stems from the fact that when resizing a window by the left edge, its right edge should stay in place, which means that the window itself must move to the left, strictly in sync with changing size. Throw into the mix slow windows (the red rectangle on the video), windows not strictly obeying the given size (e.g. terminals snapping to the cell grid), and multiple windows in a column (which must all resize together), and you've got a wild asynchronous cocktail.
There was even a Chromium bug involved in this one, and a similar Firefox issue is waiting on a recent GTK 3 update.
Mouse View Scrolling
Holding Mod and the middle mouse button (scroll wheel) will now let you scroll the view. This uses the touchpad swipe gesture code with all its decelerated spring animation goodness, but makes sure that the spot that you "grabbed" stays locked to the mouse cursor.
niri-mouse-view-gesture.mp4
Functionality
This release also adds some nice new functionality.
Named Workspaces
You can now declare named workspaces in the config.
Unlike normal (dynamic) workspaces, named workspaces are persistent (they are not deleted when they have no windows), but otherwise they behave just like normal workspaces: you can reposition them and move to different monitors.
Actions like
focus-workspace
ormove-column-to-workspace
can refer to workspaces by name in addition to by index. Also, you can use the newopen-on-workspace
window rule to make a window open on a specific named workspace:You can find a few more details on the wiki page.
Named workspaces should mostly solve the "shove a bunch of windows on correct monitors at startup" problem while working seamlessly with the dynamic workspace system. Thanks to @algernon for implementing this!
IPC Improvements
The new
niri msg output
command lets you apply transient output configuration changes. It uses the same syntax as the config file, e.g.niri msg output eDP-1 scale 2
. These changes will persist until you edit the output settings in the config file (or restart niri).While adding this, I also made output names case-insensitive, both for
niri msg output
and for the config file, which should make things less annoying.Additionally, @rustysec added a
niri msg workspaces
command which will be extra useful now with the introduction of named workspaces:Like with other IPC commands, you can use the
--json
flag to get the same data in a machine-readable form.New Window Rules
You can now set
focus-ring
andborder
properties in window rules to override them for specific windows.The new
is_active_in_column
matcher, added by @TheZoq2, can be used to make a magnifier-like window layout:Finally, the new
at-startup
matcher will match during the first 60 seconds after niri startup. You can combine it withopen-on-output
oropen-on-workspace
properties to put windows where they belong when starting the session, but not afterward. I found it quite useful for e.g. browsers where I want new windows to open normally as I go on with my day, rather than keep spawning on the same monitor and workspace.Debugging Features
There are a few new debugging features:
The
debug-toggle-opaque-regions
bind will draw regions marked as opaque in blue and others in red.The
debug-toggle-damage
bind will draw the damage computed for the screen. Kind of, mostly. Good enough to tell when something wrong is going on.The
disable-direct-scanout
flag disables direct scanout to the primary and the overlay planes.Eye candy
Of course, there are also new eye candy features!
Rounded Window Corners
Niri can now do corner rounding, a clear must-have feature for any self-respecting Wayland compositor. I've got quite an extensive implementation here, actually. Let's take a look.
You set the radius with the new
geometry-corner-radius
window rule.By itself, it doesn't clip the window but merely informs elements like the border and the focus ring which window radius they should assume. This means that you can keep using client-side-decorated windows with their own rounded corners and shadows, and have the borders drawn with the right radius.
This sets the radius of the window geometry—the inner radius of the border. The outer border radius is computed automatically taking the border width into account.
You can even set a separate radius for every corner, for example, to match GTK 3 applications:
No, I don't particularly see anyone going out of their way to set this up for every window.
Next, the new
clip-to-geometry
window rule will make niri actually clip windows to their geometry, including thegeometry-corner-radius
that you have set.Combine this with
prefer-no-csd
to get the classic rounded corner setup that works on all windows:All of this works correctly with subsurfaces, windows blocked out from screencasts, transparency, resize and other animations. And whenever possible, there's no overhead: opaque regions are preserved (except for the corners themselves), and even overlay plane unredirection still works for subsurfaces completely inside the clipped geometry!
Screen Transition
I added a
do-screen-transition
action which lets you switch between light and dark, or between different themes, smoothly like in GNOME Shell.niri-screen-transition.mp4
The key is to make sure the applications themselves switch their theme without animation and as fast as possible, then niri's own screen transition will make it look nice and synchronized.
If your apps take just a bit too long to switch, you can increase the delay during which the screen is frozen (defaults to 250 ms):
Animation Custom Shaders
Finally, for something more advanced. I'm experimenting with the ability to set custom shaders for animations. Currently, I added support to all three base window animations (open, close, resize).
No, not those shaders.
For example, you can use a custom shader to change the default crossfade resize to an animation that crops the window when it is growing, and crossfades only when it is shrinking. This looks nicer for the text-heavy terminals since it avoids visually stretching the text.
niri-resize-shader.mp4
For the closing animation, I made a shader that makes the windows fall down and rotate, inspired by the S rank animation from osu!lazer:
niri-close-custom-shader.mp4
And for the opening, I made a simple expanding circle example:
niri-open-custom-shader.mp4
The way you make these shaders is by writing a GLSL function:
Like all other settings, custom shaders are live-reloaded as you edit the config. I've got detailed documentation with many examples, including all shaders above, in this folder.
Other improvements in this release
Abgr8888
andXbgr8888
formats to wl_shm which fixes some clients that assume they are always present.linear
easing animation curve.This discussion was created from the release v0.1.6.
Beta Was this translation helpful? Give feedback.
All reactions