mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-04 22:49:50 -05:00
bar/workspaces: filter by monitor, switch to scriptmodel
This commit is contained in:
parent
9aa51c86da
commit
c2a80e1044
2 changed files with 14 additions and 11 deletions
|
|
@ -39,6 +39,7 @@ PanelWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
HyprWorkspaces {
|
HyprWorkspaces {
|
||||||
|
screen: root.screen
|
||||||
Layout.fillWidth: false
|
Layout.fillWidth: false
|
||||||
Layout.preferredHeight: parent.height
|
Layout.preferredHeight: parent.height
|
||||||
Layout.margins: 4
|
Layout.margins: 4
|
||||||
|
|
@ -98,7 +99,9 @@ PanelWindow {
|
||||||
// screen: root
|
// screen: root
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Widgets.Separator {}
|
Widgets.Separator {
|
||||||
|
Layout.leftMargin: 10
|
||||||
|
}
|
||||||
|
|
||||||
Clock {
|
Clock {
|
||||||
id: clock
|
id: clock
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,23 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
import ".."
|
import ".."
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
property var sortedWorkspaces: {
|
|
||||||
let values = Hyprland.workspaces.values.slice();
|
|
||||||
values.sort(function (a, b) {
|
|
||||||
return a.id - b.id;
|
|
||||||
});
|
|
||||||
|
|
||||||
return values;
|
|
||||||
}
|
|
||||||
|
|
||||||
spacing: 6
|
spacing: 6
|
||||||
visible: Hyprland.monitors.values.length != 0
|
visible: Hyprland.monitors.values.length != 0
|
||||||
|
|
||||||
|
required property var screen
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: parent.sortedWorkspaces
|
model: ScriptModel {
|
||||||
|
values: Hyprland.workspaces.values.slice().filter(
|
||||||
|
workspace => workspace.monitor === Hyprland.monitorFor(screen)
|
||||||
|
).sort((a,b) => {
|
||||||
|
return a.id - b.id;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
required property var modelData
|
required property var modelData
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue