From fc157dd709b32560dac4a930991896a9cb38e1da Mon Sep 17 00:00:00 2001 From: _xB <65196493+xBiei@users.noreply.github.com> Date: Thu, 12 Jun 2025 09:22:22 +0300 Subject: [PATCH] bar: Filter Variants instead of hiding PanelWindow --- .config/quickshell/modules/bar/Bar.qml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.config/quickshell/modules/bar/Bar.qml b/.config/quickshell/modules/bar/Bar.qml index 6c5e2a865..ed108c69e 100644 --- a/.config/quickshell/modules/bar/Bar.qml +++ b/.config/quickshell/modules/bar/Bar.qml @@ -19,16 +19,22 @@ Scope { readonly property int osdHideMouseMoveThreshold: 20 property bool showBarBackground: ConfigOptions.bar.showBackground + + // Check screensList from config, If no screens are specified, show on all screens + property var filteredScreens: { + const list = ConfigOptions.bar.screensList; + if (!list || list.length === 0) + return Quickshell.screens; + return Quickshell.screens.filter(screen => list.includes(screen.name)); + } + Variants { // For each monitor - model: Quickshell.screens + model: bar.filteredScreens PanelWindow { // Bar window id: barRoot screen: modelData - // Check screensList from config, If no screens are specified, show on all screens - visible: ConfigOptions.bar.screensList.includes(modelData.name) || ConfigOptions.bar.screensList.length === 0 - property ShellScreen modelData property var brightnessMonitor: Brightness.getMonitorForScreen(modelData) property real useShortenedForm: (Appearance.sizes.barHellaShortenScreenWidthThreshold >= screen.width) ? 2 :