From d9cd1907d91927a36efe7296eee2a7d8975230f8 Mon Sep 17 00:00:00 2001 From: Dongda Li Date: Fri, 22 May 2026 23:02:40 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20image=20preview=20with=20=C3=9Cberzug++?= =?UTF-8?q?=20on=20Niri=20(#3990)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 三咲雅 misaki masa --- CHANGELOG.md | 2 ++ yazi-adapter/src/drivers/ueberzug.rs | 7 ++++--- yazi-boot/src/actions/debug.rs | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58abd110..ccb14fab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): ### Added - Bulk create ([#3793]) +- Image preview with Überzug++ on Niri ([#3990]) ### Changed @@ -1727,3 +1728,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): [#3934]: https://github.com/sxyazi/yazi/pull/3934 [#3943]: https://github.com/sxyazi/yazi/pull/3943 [#3989]: https://github.com/sxyazi/yazi/pull/3989 +[#3990]: https://github.com/sxyazi/yazi/pull/3990 diff --git a/yazi-adapter/src/drivers/ueberzug.rs b/yazi-adapter/src/drivers/ueberzug.rs index 2e8c343e..6ab4aabd 100644 --- a/yazi-adapter/src/drivers/ueberzug.rs +++ b/yazi-adapter/src/drivers/ueberzug.rs @@ -76,11 +76,12 @@ impl Ueberzug { } } - // Currently Überzug++'s Wayland output only supports Sway, Hyprland and Wayfire - // as it requires information from specific compositor socket directly. + // Currently Überzug++'s Wayland output only supports Niri, Sway, Hyprland and + // Wayfire as it requires information from specific compositor socket directly. // These environment variables are from ueberzugpp src/canvas/wayland/config.cpp pub(crate) fn supported_compositor() -> bool { - env_exists("SWAYSOCK") + env_exists("NIRI_SOCKET") + || env_exists("SWAYSOCK") || env_exists("HYPRLAND_INSTANCE_SIGNATURE") || env_exists("WAYFIRE_SOCKET") } diff --git a/yazi-boot/src/actions/debug.rs b/yazi-boot/src/actions/debug.rs index 455bc3cb..26228335 100644 --- a/yazi-boot/src/actions/debug.rs +++ b/yazi-boot/src/actions/debug.rs @@ -46,6 +46,7 @@ impl Actions { writeln!(s, " XDG_SESSION_TYPE : {:?}", env::var_os("XDG_SESSION_TYPE"))?; writeln!(s, " WAYLAND_DISPLAY : {:?}", env::var_os("WAYLAND_DISPLAY"))?; writeln!(s, " DISPLAY : {:?}", env::var_os("DISPLAY"))?; + writeln!(s, " NIRI_SOCKET : {:?}", env::var_os("NIRI_SOCKET"))?; writeln!(s, " SWAYSOCK : {:?}", env::var_os("SWAYSOCK"))?; #[rustfmt::skip] writeln!(s, " HYPRLAND_INSTANCE_SIGNATURE: {:?}", env::var_os("HYPRLAND_INSTANCE_SIGNATURE"))?;