From 2087ea72f80a5efd8e3c818fa6a0c6d11b445a4d Mon Sep 17 00:00:00 2001 From: xB Date: Fri, 6 Jun 2025 00:47:26 +0300 Subject: [PATCH 1/7] QS Rewrite: bar: Add an option for choosing screens --- .config/quickshell/modules/bar/Bar.qml | 3 +++ .config/quickshell/modules/common/ConfigOptions.qml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/.config/quickshell/modules/bar/Bar.qml b/.config/quickshell/modules/bar/Bar.qml index 891c9a2c8..6c5e2a865 100644 --- a/.config/quickshell/modules/bar/Bar.qml +++ b/.config/quickshell/modules/bar/Bar.qml @@ -26,6 +26,9 @@ Scope { 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 : diff --git a/.config/quickshell/modules/common/ConfigOptions.qml b/.config/quickshell/modules/common/ConfigOptions.qml index 91ba70408..98abcf364 100644 --- a/.config/quickshell/modules/common/ConfigOptions.qml +++ b/.config/quickshell/modules/common/ConfigOptions.qml @@ -36,6 +36,10 @@ Singleton { property bool alwaysShowSwap: true property bool alwaysShowCpu: false } + property list screensList: [ + "HDMI-A-1", + "DP-1" + ] property QtObject workspaces: QtObject { property int shown: 10 property bool alwaysShowNumbers: false 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 2/7] 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 : From 1a0df48ac3739a72c0ad8861410b49d4ea7b0b3d Mon Sep 17 00:00:00 2001 From: _xB <65196493+xBiei@users.noreply.github.com> Date: Fri, 13 Jun 2025 21:38:33 +0300 Subject: [PATCH 3/7] bar: Use ScriptModel to only update related screens --- .config/quickshell/modules/bar/Bar.qml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.config/quickshell/modules/bar/Bar.qml b/.config/quickshell/modules/bar/Bar.qml index eb171bbf7..9c98e26e7 100644 --- a/.config/quickshell/modules/bar/Bar.qml +++ b/.config/quickshell/modules/bar/Bar.qml @@ -28,15 +28,19 @@ Scope { // 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)); + ScriptModel { + id: screensModel + values: { + const screens = Quickshell.screens; + const list = ConfigOptions.bar.screensList; + if (!list || list.length === 0) + return screens; + return screens.filter(screen => list.includes(screen.name)); + } } Variants { // For each monitor - model: bar.filteredScreens + model: screensModel.values PanelWindow { // Bar window id: barRoot From 50e69c2fa536bc76a7874078e75aa1b98190d566 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 13 Jun 2025 22:51:50 +0200 Subject: [PATCH 4/7] bar: fix screen filtering --- .config/quickshell/modules/bar/Bar.qml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.config/quickshell/modules/bar/Bar.qml b/.config/quickshell/modules/bar/Bar.qml index 9c98e26e7..fa66de5b2 100644 --- a/.config/quickshell/modules/bar/Bar.qml +++ b/.config/quickshell/modules/bar/Bar.qml @@ -26,21 +26,14 @@ Scope { implicitWidth: 1 color: Appearance.colors.colOutlineVariant - - // Check screensList from config, If no screens are specified, show on all screens - ScriptModel { - id: screensModel - values: { + Variants { // For each monitor + model: { const screens = Quickshell.screens; const list = ConfigOptions.bar.screensList; if (!list || list.length === 0) return screens; return screens.filter(screen => list.includes(screen.name)); } - } - - Variants { // For each monitor - model: screensModel.values PanelWindow { // Bar window id: barRoot From 62909dedfab203a4ec2c1740d1c028fb10dcb458 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 13 Jun 2025 22:52:18 +0200 Subject: [PATCH 5/7] configoptions: bar: empty screen list by default --- .config/quickshell/modules/common/ConfigOptions.qml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.config/quickshell/modules/common/ConfigOptions.qml b/.config/quickshell/modules/common/ConfigOptions.qml index 527412737..e5bd45413 100644 --- a/.config/quickshell/modules/common/ConfigOptions.qml +++ b/.config/quickshell/modules/common/ConfigOptions.qml @@ -45,10 +45,7 @@ Singleton { property bool alwaysShowSwap: true property bool alwaysShowCpu: false } - property list screensList: [ - "HDMI-A-1", - "DP-1" - ] + property list screensList: [] // List of names, like "eDP-1", find out with 'hyprctl monitors' command property QtObject utilButtons: QtObject { property bool showScreenSnip: true property bool showColorPicker: false From 0b49b731520427fa63e13db27557c8f3b8cc08e7 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 13 Jun 2025 22:54:00 +0200 Subject: [PATCH 6/7] config options: bar: rename screensList -> screenList --- .config/quickshell/modules/common/ConfigOptions.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/quickshell/modules/common/ConfigOptions.qml b/.config/quickshell/modules/common/ConfigOptions.qml index e5bd45413..ca73f1f42 100644 --- a/.config/quickshell/modules/common/ConfigOptions.qml +++ b/.config/quickshell/modules/common/ConfigOptions.qml @@ -45,7 +45,7 @@ Singleton { property bool alwaysShowSwap: true property bool alwaysShowCpu: false } - property list screensList: [] // List of names, like "eDP-1", find out with 'hyprctl monitors' command + property list screenList: [] // List of names, like "eDP-1", find out with 'hyprctl monitors' command property QtObject utilButtons: QtObject { property bool showScreenSnip: true property bool showColorPicker: false From 0ad98583792f176fd13bfff1e27d487617bfe704 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 13 Jun 2025 22:54:24 +0200 Subject: [PATCH 7/7] bar: screensList -> screenList --- .config/quickshell/modules/bar/Bar.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/quickshell/modules/bar/Bar.qml b/.config/quickshell/modules/bar/Bar.qml index fa66de5b2..8615c4cf3 100644 --- a/.config/quickshell/modules/bar/Bar.qml +++ b/.config/quickshell/modules/bar/Bar.qml @@ -29,7 +29,7 @@ Scope { Variants { // For each monitor model: { const screens = Quickshell.screens; - const list = ConfigOptions.bar.screensList; + const list = ConfigOptions.bar.screenList; if (!list || list.length === 0) return screens; return screens.filter(screen => list.includes(screen.name));