forked from quickshell/quickshell
hyprland/ipc: expose Hyprland toplevels
This commit is contained in:
parent
c115df8d34
commit
362c8e1b69
11 changed files with 685 additions and 43 deletions
37
src/wayland/hyprland/test/manual/toplevel-association.qml
Normal file
37
src/wayland/hyprland/test/manual/toplevel-association.qml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Wayland
|
||||
|
||||
FloatingWindow {
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
Text { text: "Hyprland -> Wayland" }
|
||||
|
||||
ListView {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
clip: true
|
||||
model: Hyprland.toplevels
|
||||
delegate: Text {
|
||||
required property HyprlandToplevel modelData
|
||||
text: `${modelData} -> ${modelData.wayland}`
|
||||
}
|
||||
}
|
||||
|
||||
Text { text: "Wayland -> Hyprland" }
|
||||
|
||||
ListView {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
clip: true
|
||||
model: ToplevelManager.toplevels
|
||||
delegate: Text {
|
||||
required property Toplevel modelData
|
||||
text: `${modelData} -> ${modelData.HyprlandToplevel.handle}`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
34
src/wayland/hyprland/test/manual/toplevels.qml
Normal file
34
src/wayland/hyprland/test/manual/toplevels.qml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
|
||||
FloatingWindow {
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
Text { text: "Current toplevel:" }
|
||||
|
||||
ToplevelFromHyprland {
|
||||
modelData: Hyprland.activeToplevel
|
||||
}
|
||||
|
||||
Text { text: "\nAll toplevels:" }
|
||||
|
||||
ListView {
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
clip: true
|
||||
model: Hyprland.toplevels
|
||||
delegate: ToplevelFromHyprland {}
|
||||
}
|
||||
}
|
||||
|
||||
component ToplevelFromHyprland: ColumnLayout {
|
||||
required property HyprlandToplevel modelData
|
||||
|
||||
Text {
|
||||
text: `Window 0x${modelData.address}, title: ${modelData.title}, activated: ${modelData.activated}, workspace id: ${modelData.workspace.id}, monitor name: ${modelData.monitor.name}, urgent: ${modelData.urgent}`
|
||||
}
|
||||
}
|
||||
}
|
||||
34
src/wayland/hyprland/test/manual/workspaces.qml
Normal file
34
src/wayland/hyprland/test/manual/workspaces.qml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Hyprland
|
||||
|
||||
FloatingWindow {
|
||||
ListView {
|
||||
anchors.fill: parent
|
||||
model: Hyprland.workspaces
|
||||
spacing: 5
|
||||
|
||||
delegate: WrapperRectangle {
|
||||
id: wsDelegate
|
||||
required property HyprlandWorkspace modelData
|
||||
color: "lightgray"
|
||||
|
||||
ColumnLayout {
|
||||
Text { text: `Workspace ${wsDelegate.modelData.id} on ${wsDelegate.modelData.monitor} | urgent: ${wsDelegate.modelData.urgent}`}
|
||||
|
||||
ColumnLayout {
|
||||
Repeater {
|
||||
model: wsDelegate.modelData.toplevels
|
||||
Text {
|
||||
id: tDelegate
|
||||
required property HyprlandToplevel modelData;
|
||||
text: `${tDelegate.modelData}: ${tDelegate.modelData.title}`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue