From d8a67ce298b77b4f6fcfa4cd1dedfc48f68c9ea7 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Tue, 7 Oct 2025 20:59:33 -0400 Subject: [PATCH] Compositor: Reworked the compositor detection to make it more robust when switching from one to another in TTY - Sway seems to leave its SWAYSOCK valid when going back to TTY, which would break Noctalia on Niri. Was probably fine with a display manager. + Autofmt --- Modules/Bar/Calendar/CalendarPanel.qml | 3 +-- Services/CompositorService.qml | 10 ++++++++-- Services/SwayService.qml | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Modules/Bar/Calendar/CalendarPanel.qml b/Modules/Bar/Calendar/CalendarPanel.qml index fceecb63..277745b5 100644 --- a/Modules/Bar/Calendar/CalendarPanel.qml +++ b/Modules/Bar/Calendar/CalendarPanel.qml @@ -297,8 +297,7 @@ NPanel { } // Spacer - Item { - } + Item {} // Navigation and divider RowLayout { diff --git a/Services/CompositorService.qml b/Services/CompositorService.qml index fe81878a..fbab5177 100644 --- a/Services/CompositorService.qml +++ b/Services/CompositorService.qml @@ -32,8 +32,14 @@ Singleton { function detectCompositor() { const hyprlandSignature = Quickshell.env("HYPRLAND_INSTANCE_SIGNATURE") + const niriSocket = Quickshell.env("NIRI_SOCKET") const swaySock = Quickshell.env("SWAYSOCK") - if (hyprlandSignature && hyprlandSignature.length > 0) { + if (niriSocket && niriSocket.length > 0) { + isHyprland = false + isNiri = true + isSway = false + backendLoader.sourceComponent = niriComponent + } else if (hyprlandSignature && hyprlandSignature.length > 0) { isHyprland = true isNiri = false isSway = false @@ -44,7 +50,7 @@ Singleton { isSway = true backendLoader.sourceComponent = swayComponent } else { - // Default to Niri + // Always fallback to Niri isHyprland = false isNiri = true isSway = false diff --git a/Services/SwayService.qml b/Services/SwayService.qml index fbcb2d45..01727855 100644 --- a/Services/SwayService.qml +++ b/Services/SwayService.qml @@ -155,7 +155,7 @@ Item { if (!toplevel) return "" - return toplevel.appId; + return toplevel.appId } // Safe property getter