feat(adapter): detect niri wayland previews

This commit is contained in:
dongdongbh 2026-05-22 22:27:02 -04:00
parent 5d643ee01a
commit 0dc74f5339
2 changed files with 5 additions and 3 deletions

View file

@ -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")
}

View file

@ -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"))?;