-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Replies: 4 comments · 20 replies
|
I agree it would be useful, but display mirroring is somewhat complicated. Also would require thinking how to configure it.
Maybe there's a way to make it work? It sounds like it should work for that case. |
All reactions
|
I have this issue (wl-mirror window freezing/not capturing correctly) on both my Lenovo Y540 laptop with a GTX1660TI and my desktop ITX build with a RTX4070. Both are running niri with proprietary Below are logs/info from testing on my desktop. with `export-dmabuf` backend (fails)$ wl-mirror -v -b export-dmabuf --fullscreen-output DP-1 DP-3
debug: main::main(): initializing stream
debug: main::main(): initializing wayland
debug: wayland::on_registry_add(): wl_compositor (version = 6, id = 1)
debug: wayland::on_registry_add(): wl_subcompositor (version = 1, id = 2)
debug: wayland::on_registry_add(): xdg_wm_base (version = 6, id = 3)
debug: wayland::on_registry_add(): zwlr_layer_shell_v1 (version = 4, id = 6)
debug: wayland::on_registry_add(): ext_session_lock_manager_v1 (version = 1, id = 7)
debug: wayland::on_registry_add(): wl_shm (version = 2, id = 8)
debug: wayland::on_registry_add(): zxdg_output_manager_v1 (version = 3, id = 9)
debug: wayland::on_registry_add(): wp_fractional_scale_manager_v1 (version = 1, id = 10)
debug: wayland::on_registry_add(): zwp_tablet_manager_v2 (version = 1, id = 11)
debug: wayland::on_registry_add(): zwp_pointer_gestures_v1 (version = 3, id = 12)
debug: wayland::on_registry_add(): zwp_relative_pointer_manager_v1 (version = 1, id = 13)
debug: wayland::on_registry_add(): zwp_pointer_constraints_v1 (version = 1, id = 14)
debug: wayland::on_registry_add(): ext_idle_notifier_v1 (version = 2, id = 15)
debug: wayland::on_registry_add(): zwp_idle_inhibit_manager_v1 (version = 1, id = 16)
debug: wayland::on_registry_add(): wl_data_device_manager (version = 3, id = 17)
debug: wayland::on_registry_add(): zwp_primary_selection_device_manager_v1 (version = 1, id = 18)
debug: wayland::on_registry_add(): zwlr_data_control_manager_v1 (version = 2, id = 19)
debug: wayland::on_registry_add(): ext_data_control_manager_v1 (version = 1, id = 20)
debug: wayland::on_registry_add(): wp_presentation (version = 2, id = 21)
debug: wayland::on_registry_add(): wp_security_context_manager_v1 (version = 1, id = 22)
debug: wayland::on_registry_add(): zwp_text_input_manager_v3 (version = 1, id = 23)
debug: wayland::on_registry_add(): zwp_input_method_manager_v2 (version = 1, id = 24)
debug: wayland::on_registry_add(): zwp_keyboard_shortcuts_inhibit_manager_v1 (version = 1, id = 25)
debug: wayland::on_registry_add(): zwp_virtual_keyboard_manager_v1 (version = 1, id = 26)
debug: wayland::on_registry_add(): zwlr_virtual_pointer_manager_v1 (version = 2, id = 27)
debug: wayland::on_registry_add(): zwlr_foreign_toplevel_manager_v1 (version = 3, id = 28)
debug: wayland::on_registry_add(): ext_workspace_manager_v1 (version = 1, id = 29)
debug: wayland::on_registry_add(): zwlr_output_manager_v1 (version = 4, id = 30)
debug: wayland::on_registry_add(): zwlr_screencopy_manager_v1 (version = 3, id = 31)
debug: wayland::on_registry_add(): wp_viewporter (version = 1, id = 32)
debug: wayland::on_registry_add(): zxdg_exporter_v2 (version = 1, id = 33)
debug: wayland::on_registry_add(): zxdg_importer_v2 (version = 1, id = 34)
debug: wayland::on_registry_add(): zwlr_gamma_control_manager_v1 (version = 1, id = 35)
debug: wayland::on_registry_add(): xdg_activation_v1 (version = 1, id = 36)
debug: wayland::on_registry_add(): mutter_x11_interop (version = 1, id = 37)
debug: wayland::on_registry_add(): wl_seat (version = 9, id = 38)
debug: wayland::on_registry_add(): wp_cursor_shape_manager_v1 (version = 2, id = 39)
debug: wayland::on_registry_add(): wl_eglstream_display (version = 1, id = 40)
debug: wayland::on_registry_add(): wl_drm (version = 2, id = 41)
debug: wayland::on_registry_add(): zwp_linux_dmabuf_v1 (version = 5, id = 42)
debug: wayland::on_registry_add(): wp_drm_lease_device_v1 (version = 1, id = 43)
debug: wayland::on_registry_add(): wl_output (version = 4, id = 44)
debug: wayland::on_registry_add(): wl_output (version = 4, id = 45)
debug: wayland::on_registry_add(): wl_output (version = 4, id = 46)
debug: main::main(): initializing EGL
debug: egl::init(): initialized EGL 1.5
debug: main::main(): configuring wayland window
debug: wayland::on_xdg_output_logical_size(): updating output (null) (size = 2560x1440, id = 44)
debug: wayland::on_xdg_output_name(): updating output DP-2 (id = 44)
debug: wayland::on_xdg_output_logical_position(): updating output (null) (position = 640,-1080, id = 45)
debug: wayland::on_xdg_output_logical_size(): updating output (null) (size = 1920x1080, id = 45)
debug: wayland::on_xdg_output_name(): updating output DP-3 (id = 45)
debug: wayland::on_output_geometry(): updating output (null) (transform = 270ccw, id = 46)
debug: wayland::on_xdg_output_logical_position(): updating output (null) (position = 2560,-240, id = 46)
debug: wayland::on_xdg_output_logical_size(): updating output (null) (size = 1050x1680, id = 46)
debug: wayland::on_xdg_output_name(): updating output DP-1 (id = 46)
debug: wayland::on_fractional_scale_preferred_scale(): scale = 1.0000
debug: wayland::on_xdg_toplevel_configure(): window resized to 1248x1378
debug: egl::resize_window(): resizing EGL window to 1248x1378
debug: egl::resize_viewport(): resizing viewport
debug: egl::resize_viewport(): win_width = 1248, win_height = 1378
debug: egl::resize_viewport(): view_width = 1248, view_height = 1248
debug: egl::resize_viewport(): viewport 0, 65, 1248, 1248
debug: wayland::on_surface_configure_finished(): window configured
debug: wayland::configure_window(): fullscreening on target output
debug: main::main(): initializing mirror
debug: options::find_output(): searching for output by name
debug: options::find_output(): found output with name DP-3
debug: main::main(): initializing mirror backend
error: mirror-export-dmabuf::init(): missing wlr_export_dmabuf_manager protocol
debug: main::cleanup(): deallocating resources
debug: mirror::cleanup(): destroying mirror objects
debug: egl::cleanup(): destroying EGL objects
debug: wayland::cleanup(): destroying wayland objects
debug: wayland::shm::cleanup(): destroying wayland shm objectsNot sure if this is the backend I'm suppposed to use: DMABUF is supposedly supported at least for screencasting in browsers like Arc. with `auto`/unspecified backend$ wl-mirror -v --fullscreen-output DP-1 DP-3
debug: main::main(): initializing stream
debug: main::main(): initializing wayland
debug: wayland::on_registry_add(): wl_compositor (version = 6, id = 1)
debug: wayland::on_registry_add(): wl_subcompositor (version = 1, id = 2)
debug: wayland::on_registry_add(): xdg_wm_base (version = 6, id = 3)
debug: wayland::on_registry_add(): zwlr_layer_shell_v1 (version = 4, id = 6)
debug: wayland::on_registry_add(): ext_session_lock_manager_v1 (version = 1, id = 7)
debug: wayland::on_registry_add(): wl_shm (version = 2, id = 8)
debug: wayland::on_registry_add(): zxdg_output_manager_v1 (version = 3, id = 9)
debug: wayland::on_registry_add(): wp_fractional_scale_manager_v1 (version = 1, id = 10)
debug: wayland::on_registry_add(): zwp_tablet_manager_v2 (version = 1, id = 11)
debug: wayland::on_registry_add(): zwp_pointer_gestures_v1 (version = 3, id = 12)
debug: wayland::on_registry_add(): zwp_relative_pointer_manager_v1 (version = 1, id = 13)
debug: wayland::on_registry_add(): zwp_pointer_constraints_v1 (version = 1, id = 14)
debug: wayland::on_registry_add(): ext_idle_notifier_v1 (version = 2, id = 15)
debug: wayland::on_registry_add(): zwp_idle_inhibit_manager_v1 (version = 1, id = 16)
debug: wayland::on_registry_add(): wl_data_device_manager (version = 3, id = 17)
debug: wayland::on_registry_add(): zwp_primary_selection_device_manager_v1 (version = 1, id = 18)
debug: wayland::on_registry_add(): zwlr_data_control_manager_v1 (version = 2, id = 19)
debug: wayland::on_registry_add(): ext_data_control_manager_v1 (version = 1, id = 20)
debug: wayland::on_registry_add(): wp_presentation (version = 2, id = 21)
debug: wayland::on_registry_add(): wp_security_context_manager_v1 (version = 1, id = 22)
debug: wayland::on_registry_add(): zwp_text_input_manager_v3 (version = 1, id = 23)
debug: wayland::on_registry_add(): zwp_input_method_manager_v2 (version = 1, id = 24)
debug: wayland::on_registry_add(): zwp_keyboard_shortcuts_inhibit_manager_v1 (version = 1, id = 25)
debug: wayland::on_registry_add(): zwp_virtual_keyboard_manager_v1 (version = 1, id = 26)
debug: wayland::on_registry_add(): zwlr_virtual_pointer_manager_v1 (version = 2, id = 27)
debug: wayland::on_registry_add(): zwlr_foreign_toplevel_manager_v1 (version = 3, id = 28)
debug: wayland::on_registry_add(): ext_workspace_manager_v1 (version = 1, id = 29)
debug: wayland::on_registry_add(): zwlr_output_manager_v1 (version = 4, id = 30)
debug: wayland::on_registry_add(): zwlr_screencopy_manager_v1 (version = 3, id = 31)
debug: wayland::on_registry_add(): wp_viewporter (version = 1, id = 32)
debug: wayland::on_registry_add(): zxdg_exporter_v2 (version = 1, id = 33)
debug: wayland::on_registry_add(): zxdg_importer_v2 (version = 1, id = 34)
debug: wayland::on_registry_add(): zwlr_gamma_control_manager_v1 (version = 1, id = 35)
debug: wayland::on_registry_add(): xdg_activation_v1 (version = 1, id = 36)
debug: wayland::on_registry_add(): mutter_x11_interop (version = 1, id = 37)
debug: wayland::on_registry_add(): wl_seat (version = 9, id = 38)
debug: wayland::on_registry_add(): wp_cursor_shape_manager_v1 (version = 2, id = 39)
debug: wayland::on_registry_add(): wl_eglstream_display (version = 1, id = 40)
debug: wayland::on_registry_add(): wl_drm (version = 2, id = 41)
debug: wayland::on_registry_add(): zwp_linux_dmabuf_v1 (version = 5, id = 42)
debug: wayland::on_registry_add(): wp_drm_lease_device_v1 (version = 1, id = 43)
debug: wayland::on_registry_add(): wl_output (version = 4, id = 44)
debug: wayland::on_registry_add(): wl_output (version = 4, id = 45)
debug: wayland::on_registry_add(): wl_output (version = 4, id = 46)
debug: main::main(): initializing EGL
debug: egl::init(): initialized EGL 1.5
debug: main::main(): configuring wayland window
debug: wayland::on_xdg_output_logical_size(): updating output (null) (size = 2560x1440, id = 44)
debug: wayland::on_xdg_output_name(): updating output DP-2 (id = 44)
debug: wayland::on_xdg_output_logical_position(): updating output (null) (position = 640,-1080, id = 45)
debug: wayland::on_xdg_output_logical_size(): updating output (null) (size = 1920x1080, id = 45)
debug: wayland::on_xdg_output_name(): updating output DP-3 (id = 45)
debug: wayland::on_output_geometry(): updating output (null) (transform = 270ccw, id = 46)
debug: wayland::on_xdg_output_logical_position(): updating output (null) (position = 2560,-240, id = 46)
debug: wayland::on_xdg_output_logical_size(): updating output (null) (size = 1050x1680, id = 46)
debug: wayland::on_xdg_output_name(): updating output DP-1 (id = 46)
debug: wayland::on_fractional_scale_preferred_scale(): scale = 1.0000
debug: wayland::on_xdg_toplevel_configure(): window resized to 1248x1378
debug: egl::resize_window(): resizing EGL window to 1248x1378
debug: egl::resize_viewport(): resizing viewport
debug: egl::resize_viewport(): win_width = 1248, win_height = 1378
debug: egl::resize_viewport(): view_width = 1248, view_height = 1248
debug: egl::resize_viewport(): viewport 0, 65, 1248, 1248
debug: wayland::on_surface_configure_finished(): window configured
debug: wayland::configure_window(): fullscreening on target output
debug: main::main(): initializing mirror
debug: options::find_output(): searching for output by name
debug: options::find_output(): found output with name DP-3
debug: main::main(): initializing mirror backend
debug: mirror::auto_backend_fallback(): selecting backend extcopy-dmabuf
error: mirror-extcopy::init(): missing ext_image_copy_capture protocol
warning: mirror::auto_backend_fallback(): falling back to backend screencopy-dmabuf
debug: main::main(): entering event loop
debug: wayland::on_xdg_toplevel_configure(): window resized to 1050x1680
debug: egl::resize_window(): resizing EGL window to 1050x1680
debug: egl::resize_viewport(): resizing viewport
debug: egl::resize_viewport(): win_width = 1050, win_height = 1680
debug: egl::resize_viewport(): view_width = 1050, view_height = 1050
debug: egl::resize_viewport(): viewport 0, 315, 1050, 1050
debug: wayland::on_surface_configure_finished(): window configured
debug: wayland::dmabuf::on_feedback_main_device(): opening main device
debug: wayland::dmabuf::open_device(): opening gbm device
debug: mirror-screencopy::on_dmabuf_device_opened(): dmabuf device opened, ready for capture
debug: wayland::on_surface_enter(): updating window scale
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: wayland::dmabuf::alloc(): allocated dmabuf with format=34325258, size=1920x1080, modifier=300000000e08014, planes=1
debug: wayland::dmabuf::alloc(): plane[0]: fd=41, offset=0, stride=1e00
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_buffer_done(): waiting on dmabuf allocation
debug: wayland::dmabuf::on_linux_buffer_params_created(): allocation succeeded
debug: mirror-screencopy::on_dmabuf_allocated(): dmabuf allocated
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
debug: egl::resize_viewport(): resizing viewport
debug: egl::resize_viewport(): win_width = 1050, win_height = 1680
debug: egl::resize_viewport(): view_width = 1050, view_height = 590
debug: egl::resize_viewport(): viewport 0, 545, 1050, 590
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
debug: mirror-screencopy::on_linux_dmabuf(): received buffer offer for 1920x1080 frame
debug: mirror-screencopy::on_buffer_done(): received buffer done event
debug: mirror-screencopy::on_flags(): received flags event: flags=0
debug: mirror-screencopy::on_ready(): received ready event with width: 1920, height: 1080, stride: 0, format: 42RX
// ... this continues ...The window stays open but only updates occasionally, for maybe a second or two. I think updates only happen when focus is shuffled around between the wl-mirror and windows on the screen that is captured. Sometimes an update does not capture visible windows, only my my niri config.kdl// This config is in the KDL format: https://kdl.dev
// "/-" comments out the following node.
// Check the wiki for a full description of the configuration:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Overview
// Input device configuration.
// Find the full list of options on the wiki:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
input {
// workspace-auto-back-and-forth
keyboard {
track-layout "global"
xkb {
// You can set rules, model, layout, variant and options.
// For more information, see xkeyboard-config(7).
// For example:
// layout "us,ru"
// options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
layout "dk"
options "caps:escape"
}
}
// Next sections include libinput settings.
// Omitting settings disables them, or leaves them at their default values.
// touchpad {
// // off
// tap
// dwt
// // dwtp
// // drag false
// // drag-lock
// natural-scroll
// // accel-speed 0.05
// // accel-profile "flat"
// // scroll-method "two-finger"
// scroll-factor 0.75
// disabled-on-external-mouse
// middle-emulation
// }
mouse {
// off
// natural-scroll
// accel-speed 0.1
accel-profile "flat"
// scroll-method "no-scroll"
}
// trackpoint {
// // off
// // natural-scroll
// // accel-speed 0.2
// // accel-profile "flat"
// // scroll-method "on-button-down"
// // scroll-button 273
// // middle-emulation
// }
// Uncomment this to make the mouse warp to the center of newly focused windows.
// warp-mouse-to-focus
// Focus windows and outputs automatically when moving the mouse into them.
// Setting max-scroll-amount="0%" makes it work only on windows already fully on screen.
// focus-follows-mouse max-scroll-amount="0%"
}
/// SCREENS/MONITORS
// imagine every point is the upper left corner of the screen. scaling matters for positioning.
// BOTTOM GIGABYTE
output "DP-2" {
mode "2560x1440@239.998"
position x=0 y=0
variable-refresh-rate on-demand=true
focus-at-startup
}
// TOP AOC
output "DP-3" {
mode "1920x1080@144.001"
position x=640 y=-1080
// scale 0.9
// position x=426 y=-1200
variable-refresh-rate on-demand=true
}
// RIGHT OLD SAMSUNG
output "DP-1" {
mode "1680x1050@59.954" // could be 59.954 or 59.883, or 75.025 at 1280x1024
transform "270"
position x=2560 y=-240 //(1680-1440)=240, this makes bottom screens connect
}
layer-rule {
// make wallpapers stationary: https://github.com/YaLTeR/niri/wiki/Overview#backdrop-customization
match namespace="^wallpaper$"
place-within-backdrop true
}
// Settings that influence how windows are positioned and sized.
// Find more information on the wiki:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
layout {
background-color "transparent"
// Set gaps around windows in logical pixels.
gaps 8
// When to center a column when changing focus, options are:
// - "never", default behavior, focusing an off-screen column will keep at the left
// or right edge of the screen.
// - "always", the focused column will always be centered.
// - "on-overflow", focusing a column will center it if it doesn't fit
// together with the previously focused column.
center-focused-column "never"
// You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between.
preset-column-widths {
// Proportion sets the width as a fraction of the output width, taking gaps into account.
// For example, you can perfectly fit four windows sized "proportion 0.25" on an output.
// The default preset widths are 1/3, 1/2 and 2/3 of the output.
proportion 0.33333
proportion 0.5
proportion 0.66667
// Fixed sets the width in logical pixels exactly.
// fixed 1920
}
// You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between.
// preset-window-heights { }
// You can change the default width of the new windows.
default-column-width { proportion 0.5; }
// If you leave the brackets empty, the windows themselves will decide their initial width.
// default-column-width {}
// By default focus ring and border are rendered as a solid background rectangle
// behind windows. That is, they will show up through semitransparent windows.
// This is because windows using client-side decorations can have an arbitrary shape.
//
// If you don't like that, you should uncomment `prefer-no-csd` below.
// Niri will draw focus ring and border *around* windows that agree to omit their
// client-side decorations.
//
// Alternatively, you can override it with a window rule called
// `draw-border-with-background`.
// You can change how the focus ring looks.
focus-ring {
// Uncomment this line to disable the focus ring.
off
// How many logical pixels the ring extends out from the windows.
width 4
// Colors can be set in a variety of ways:
// - CSS named colors: "red"
// - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
// - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
// Color of the ring on the active monitor.
active-color "#7fc8ff"
// Color of the ring on inactive monitors.
inactive-color "#505050"
// You can also use gradients. They take precedence over solid colors.
// Gradients are rendered the same as CSS linear-gradient(angle, from, to).
// The angle is the same as in linear-gradient, and is optional,
// defaulting to 180 (top-to-bottom gradient).
// You can use any CSS linear-gradient tool on the web to set these up.
// Changing the color space is also supported, check the wiki for more info.
//
// active-gradient from="#80c8ff" to="#bbddff" angle=45
// You can also color the gradient relative to the entire view
// of the workspace, rather than relative to just the window itself.
// To do that, set relative-to="workspace-view".
//
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
}
// You can also add a border. It's similar to the focus ring, but always visible.
border {
// The settings are the same as for the focus ring.
// If you enable the border, you probably want to disable the focus ring.
//off
width 4
// active-color "#ffc87f"
// active-color "#7fc8ff"
active-color "#89b4fa"
inactive-color "#505050"
urgent-color "#ffc87f"
// active-gradient from="#ffbb66" to="#ffc880" angle=45
// active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view"
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
}
// You can enable drop shadows for windows.
shadow {
// Uncomment the next line to enable shadows.
on
// By default, the shadow draws only around its window, and not behind it.
// Uncomment this setting to make the shadow draw behind its window.
//
// Note that niri has no way of knowing about the CSD window corner
// radius. It has to assume that windows have square corners, leading to
// shadow artifacts inside the CSD rounded corners. This setting fixes
// those artifacts.
//
// However, instead you may want to set prefer-no-csd and/or
// geometry-corner-radius. Then, niri will know the corner radius and
// draw the shadow correctly, without having to draw it behind the
// window. These will also remove client-side shadows if the window
// draws any.
//
// draw-behind-window true
// You can change how shadows look. The values below are in logical
// pixels and match the CSS box-shadow properties.
// Softness controls the shadow blur radius.
softness 28
// Spread expands the shadow.
spread 2
// Offset moves the shadow relative to the window.
offset x=6 y=8
// You can also change the shadow color and opacity.
color "#000C"
}
// Struts shrink the area occupied by windows, similarly to layer-shell panels.
// You can think of them as a kind of outer gaps. They are set in logical pixels.
// Left and right struts will cause the next window to the side to always be visible.
// Top and bottom struts will simply add outer gaps in addition to the area occupied by
// layer-shell panels and regular gaps.
struts {
left 12
right 12
top 4
bottom 4
}
}
// Add lines like this to spawn processes at startup.
// Note that running niri as a session supports xdg-desktop-autostart,
// which may be more convenient to use.
// See the binds section below for more spawn examples.
// spawn-at-startup "alacritty" "-e" "fish"
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
// If the client will specifically ask for CSD, the request will be honored.
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
// This option will also fix border/focus ring drawing behind some semitransparent windows.
// After enabling or disabling this, you need to restart the apps for this to take effect.
// prefer-no-csd
// You can change the path where screenshots are saved.
// A ~ at the front will be expanded to the home directory.
// The path is formatted with strftime(3) to give you the screenshot date and time.
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
// You can also set this to null to disable saving screenshots to disk.
// screenshot-path null
// Animation settings.
// The wiki explains how to configure individual animations:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Animations
animations {
// Uncomment to turn off all animations.
// off
// Slow down all animations by this factor. Values below 1 speed them up instead.
slowdown 0.875
}
// Window rules let you adjust behavior for individual windows.
// Find more information on the wiki:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
// Work around WezTerm's initial configure bug
// by setting an empty default-column-width.
window-rule {
// This regular expression is intentionally made as specific as possible,
// since this is the default config, and we want no false positives.
// You can get away with just app-id="wezterm" if you want.
match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width {}
}
// Open the Firefox picture-in-picture player as floating by default.
window-rule {
// This app-id regular expression will work for both:
// - host Firefox (app-id is "firefox")
// - Flatpak Firefox (app-id is "org.mozilla.firefox")
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
open-floating true
}
// Example: block out two password managers from screen capture.
// (This example rule is commented out with a "/-" in front.)
/-window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
block-out-from "screen-capture"
// Use this instead if you want them visible on third-party screenshot tools.
// block-out-from "screencast"
}
// Example: enable rounded corners for all windows.
// (This example rule is commented out with a "/-" in front.)
window-rule {
geometry-corner-radius 6
clip-to-geometry true
}
binds {
// ADDED: unicode emoji picker
Mod+E { spawn "/usr/bin/wofi-emoji"; }
Mod+S { spawn "/usr/bin/dolphin"; }
// clipboard manager
// NOTE: clipcat does not seems to work with wl-roots/niri?
// Mod+Ctrl+V { spawn "clipcat-menu" "insert"; }
// Mod+Ctrl+Alt+V { spawn "clipcat-menu" "edit"; }
// Use `brightnessctl` to change backlight brightness gradually. Unfortunately there is a small delay when doing this.
XF86MonBrightnessUp { spawn "brightnessctl" "set" "2+"; }
Ctrl+XF86MonBrightnessUp { spawn "brightnessctl" "set" "10+"; }
XF86MonBrightnessDown { spawn "brightnessctl" "set" "2-"; }
Ctrl+XF86MonBrightnessDown { spawn "brightnessctl" "set" "10-"; }
// Keys consist of modifiers separated by + signs, followed by an XKB key name
// in the end. To find an XKB name for a particular key, you may use a program
// like wev.
//
// "Mod" is a special modifier equal to Super when running on a TTY, and to Alt
// when running as a winit window.
//
// Most actions that you can bind here can also be invoked programmatically with
// `niri msg action do-something`.
// Mod-Shift-/, which is usually the same as Mod-?,
// shows a list of important hotkeys.
Mod+Shift+7 { show-hotkey-overlay; }
// Suggested binds for running programs: terminal, app launcher, screen locker.
Mod+T { spawn "alacritty"; }
Mod+D { spawn "fuzzel"; }
Super+Alt+L { spawn "swaylock"; }
// You can also use a shell. Do this if you need pipes, multiple commands, etc.
// Note: the entire command goes as a single argument in the end.
// Mod+T { spawn "bash" "-c" "notify-send hello && exec alacritty"; }
// Example volume keys mappings for PipeWire & WirePlumber.
// The allow-when-locked=true property makes them work even when the session is locked.
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; }
XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
Mod+Q { close-window; }
Mod+Left { focus-column-left; }
Mod+Down { focus-window-down; }
Mod+Up { focus-window-up; }
Mod+Right { focus-column-right; }
Mod+H { focus-column-left; }
// Mod+J { focus-window-down; }
// Mod+K { focus-window-up; }
Mod+L { focus-column-right; }
Mod+Ctrl+Left { move-column-left; }
Mod+Ctrl+Down { move-window-down; }
Mod+Ctrl+Up { move-window-up; }
Mod+Ctrl+Right { move-column-right; }
Mod+Ctrl+H { move-column-left; }
// Mod+Ctrl+J { move-window-down; }
// Mod+Ctrl+K { move-window-up; }
Mod+Ctrl+L { move-column-right; }
// Alternative commands that move across workspaces when reaching
// the first or last window in a column.
Mod+J { focus-window-or-workspace-down; }
Mod+K { focus-window-or-workspace-up; }
Mod+Ctrl+J { move-window-down-or-to-workspace-down; }
Mod+Ctrl+K { move-window-up-or-to-workspace-up; }
Mod+Home { focus-column-first; }
Mod+End { focus-column-last; }
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
Mod+Shift+Left { focus-monitor-left; }
Mod+Shift+Down { focus-monitor-down; }
Mod+Shift+Up { focus-monitor-up; }
Mod+Shift+Right { focus-monitor-right; }
Mod+Shift+H { focus-monitor-left; }
Mod+Shift+J { focus-monitor-down; }
Mod+Shift+K { focus-monitor-up; }
Mod+Shift+L { focus-monitor-right; }
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
Mod+Shift+Ctrl+J { move-column-to-monitor-down; }
Mod+Shift+Ctrl+K { move-column-to-monitor-up; }
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
// Alternatively, there are commands to move just a single window:
// Mod+Shift+Ctrl+Left { move-window-to-monitor-left; }
// ...
// And you can also move a whole workspace to another monitor:
// Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; }
// ...
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
Mod+U { focus-workspace-down; }
Mod+I { focus-workspace-up; }
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
Mod+Ctrl+U { move-column-to-workspace-down; }
Mod+Ctrl+I { move-column-to-workspace-up; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+Page_Down { move-window-to-workspace-down; }
// ...
Mod+Shift+Page_Down { move-workspace-down; }
Mod+Shift+Page_Up { move-workspace-up; }
Mod+Shift+U { move-workspace-down; }
Mod+Shift+I { move-workspace-up; }
// You can bind mouse wheel scroll ticks using the following syntax.
// These binds will change direction based on the natural-scroll setting.
//
// To avoid scrolling through workspaces really fast, you can use
// the cooldown-ms property. The bind will be rate-limited to this value.
// You can set a cooldown on any bind, but it's most useful for the wheel.
Mod+WheelScrollDown cooldown-ms=200 { focus-workspace-down; }
Mod+WheelScrollUp cooldown-ms=200 { focus-workspace-up; }
Mod+Ctrl+WheelScrollDown cooldown-ms=200 { move-column-to-workspace-down; }
Mod+Ctrl+WheelScrollUp cooldown-ms=200 { move-column-to-workspace-up; }
Mod+WheelScrollRight { focus-column-right; }
Mod+WheelScrollLeft { focus-column-left; }
Mod+Ctrl+WheelScrollRight { move-column-right; }
Mod+Ctrl+WheelScrollLeft { move-column-left; }
// Usually scrolling up and down with Shift in applications results in
// horizontal scrolling; these binds replicate that.
Mod+Shift+WheelScrollDown { focus-column-right; }
Mod+Shift+WheelScrollUp { focus-column-left; }
Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
// Similarly, you can bind touchpad scroll "ticks".
// Touchpad scrolling is continuous, so for these binds it is split into
// discrete intervals.
// These binds are also affected by touchpad's natural-scroll, so these
// example binds are "inverted", since we have natural-scroll enabled for
// touchpads by default.
// Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
// Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
// You can refer to workspaces by index. However, keep in mind that
// niri is a dynamic workspace system, so these commands are kind of
// "best effort". Trying to refer to a workspace index bigger than
// the current workspace count will instead refer to the bottommost
// (empty) workspace.
//
// For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on
// will all refer to the 3rd workspace.
Mod+1 { focus-workspace 1; }
Mod+2 { focus-workspace 2; }
Mod+3 { focus-workspace 3; }
Mod+4 { focus-workspace 4; }
Mod+5 { focus-workspace 5; }
Mod+6 { focus-workspace 6; }
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
Mod+Ctrl+1 { move-column-to-workspace 1; }
Mod+Ctrl+2 { move-column-to-workspace 2; }
Mod+Ctrl+3 { move-column-to-workspace 3; }
Mod+Ctrl+4 { move-column-to-workspace 4; }
Mod+Ctrl+5 { move-column-to-workspace 5; }
Mod+Ctrl+6 { move-column-to-workspace 6; }
Mod+Ctrl+7 { move-column-to-workspace 7; }
Mod+Ctrl+8 { move-column-to-workspace 8; }
Mod+Ctrl+9 { move-column-to-workspace 9; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+1 { move-window-to-workspace 1; }
// Switches focus between the current and the previous workspace.
// Mod+Tab { focus-workspace-previous; }
// The following binds move the focused window in and out of a column.
// If the window is alone, they will consume it into the nearby column to the side.
// If the window is already in a column, they will expel it out.
Mod+BracketLeft { consume-or-expel-window-left; } // this is comma
Mod+BracketRight { consume-or-expel-window-right; } // this is dot
// Consume one window from the right to the bottom of the focused column.
Mod+Comma { consume-window-into-column; }
// Expel the bottom window from the focused column to the right.
Mod+Period { expel-window-from-column; }
Mod+R { switch-preset-column-width; }
Mod+Shift+R { switch-preset-window-height; }
Mod+Ctrl+R { reset-window-height; }
Mod+F { maximize-column; }
Mod+Shift+F { fullscreen-window; }
// Expand the focused column to space not taken up by other fully visible columns.
// Makes the column "fill the rest of the space".
Mod+Ctrl+F { expand-column-to-available-width; }
Mod+C { center-column; }
// Finer width adjustments.
// This command can also:
// * set width in pixels: "1000"
// * adjust width in pixels: "-5" or "+5"
// * set width as a percentage of screen width: "25%"
// * adjust width as a percentage of screen width: "-10%" or "+10%"
// Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0,
// set-column-width "100" will make the column occupy 200 physical screen pixels.
Mod+Minus { set-column-width "-10%"; }
Mod+Plus { set-column-width "+10%"; }
// Finer height adjustments when in column with other windows.
Mod+Shift+Minus { set-window-height "-10%"; }
Mod+Shift+Plus { set-window-height "+10%"; }
// Move the focused window between the floating and the tiling layout.
Mod+V { toggle-window-floating; }
Mod+Shift+V { switch-focus-between-floating-and-tiling; }
// Toggle tabbed column display mode.
// Windows in this column will appear as vertical tabs,
// rather than stacked on top of each other.
Mod+W { toggle-column-tabbed-display; }
// Actions to switch layouts.
// Note: if you uncomment these, make sure you do NOT have
// a matching layout switch hotkey configured in xkb options above.
// Having both at once on the same hotkey will break the switching,
// since it will switch twice upon pressing the hotkey (once by xkb, once by niri).
// Mod+Space { switch-layout "next"; }
// Mod+Shift+Space { switch-layout "prev"; }
Print { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
Mod+P { screenshot; }
Mod+Ctrl+P { screenshot-screen; }
Mod+Alt+P { screenshot-window; }
// Applications such as remote-desktop clients and software KVM switches may
// request that niri stops processing the keyboard shortcuts defined here
// so they may, for example, forward the key presses as-is to a remote machine.
// It's a good idea to bind an escape hatch to toggle the inhibitor,
// so a buggy application can't hold your session hostage.
//
// The allow-inhibiting=false property can be applied to other binds as well,
// which ensures niri always processes them, even when an inhibitor is active.
Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
// The quit action will show a confirmation dialog to avoid accidental exits.
Mod+Shift+E { quit; }
Ctrl+Alt+Delete { quit; }
// Powers off the monitors. To turn them back on, do any input like
// moving the mouse or pressing any other key.
Mod+Ctrl+Shift+Alt+P { power-off-monitors; }
}
// NOTE: consider refactoring to instead use niri settings for this?
// https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#xwayland-satellite
spawn-at-startup "xwayland-satellite" // let X11 windows be opened with xwayland
spawn-at-startup
// spawn-at-startup "gammastep -l 55.6761:12.5683" // start gammastep
// spawn-at-startup "gammastep -l geoclue2" // start gammastep with auto location
// NOTE: should be spawned by systemd instead: https://github.com/xrelkd/clipcat#integration
//spawn-at-startup "clipcatd" // clipboard manager
// spawn-at-startup "wluma"
spawn-at-startup "nm-applet" // system tray app that interacts with NetworkManager
environment {
// for xwayland
DISPLAY ":0"
// enable nvidia gpu stuff
LIBVA_DRIVER_NAME "nvidia"
__GLX_VENDOR_LIBRARY_NAME "nvidia"
NVD_BACKEND "direct"
QT_QPA_PLATFORM "wayland"
_JAVA_AWT_WM_NONREPARENTING "1" // fix java apps?
// use native electron wayland support (electron >28)
ELECTRON_OZONE_PLATFORM_HINT "auto"
} |
All reactions
|
@selvmaya Thanks for the report! The related wl-mirror bug report is wl-mirror#59. From all of the reports over the last year, it appears this issue is specific to the nvidia drivers, and not tied to any particular wl-mirror backend (the issue happens with both shm and dmabuf). The issue is that parts of wl-mirror seem to hang in some spots (still not exactly sure which spots); I'll see if I can find a user-friendly way of enabling profiling so that I can figure out what exactly hangs here. I don't have an nvidia GPU I can test this with, so all changes are on a guess-and-check basis; sorry that it's taking so long. |
All reactions
-
❤️ 1
|
No bother, thank you for your work! |
All reactions
-
❤️ 1
|
It'd be interesting to see what OBS does differently; I think I'll look into that! Maybe something stands out that I can try :) OBS preview is also what I used before I wrote wl-mirror. |
All reactions
-
❤️ 2
it will be a nice improvement you can share what is the complix part and may some one can help with the algorithm wl-mirror is bad in use i have the same issue i hope i could help to solve this |
All reactions
|
I'd really like this feature! (I don't wanna go like implement X and Y Hyprland feature, but as a reference this could be configured in Hyprland like this |
All reactions
-
👍 2
|
While |
All reactions
-
😄 1 -
👀 1
|
I've been making a simple fuzzel+wl-mirror wrapper program to make this easier but I'm running into an issue: Niri's CPU usage gets increased by 30% for every visisble instance of wl-mirror, and OBS isn't any better. Should I try building Niri with debug symbols and profiling it using Tracy? Though I'm still on Niri 25.08 so I don't know if this has been fixed in 25.11. |
All reactions
|
I am using wl-mirror with niri 25.11 now and am seeing a huge spike in CPU usage (7% by niri, 7% by wl-mirror). |
All reactions
|
+1 for mirror monitor support. Categorically essential. |
All reactions
|
You can use wl-mirror |
Uh oh!
There was an error while loading. Please reload this page.
Hi!
I really love niri, that's my main wm that I use daily. Sadly, I can't fully move away from gnome, because right now mirroring the "primary" display to my "secondary" is not possible in niri.
I've tried to use wl-mirror to put it on the other display, but when that window loses focus, it stops updating.
I think it would be really cool, if there were an option to mirror a display to another, or an action to do this, without relying on an external tool.
All reactions