From 292b6daf5c56ff60a6263ff4945e74e5ca4372e7 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Mon, 13 Jul 2026 15:58:40 -0400 Subject: Creating an overview version that works with all branches Signed-off-by: Don Williams On branch development Your branch is up to date with 'origin/development'. Changes to be committed: new file: config/quickshell/overview-unified/README.md new file: config/quickshell/overview-unified/assets/image.png new file: config/quickshell/overview-unified/common/Appearance.qml new file: config/quickshell/overview-unified/common/Config.qml new file: config/quickshell/overview-unified/common/functions/ColorUtils.qml new file: config/quickshell/overview-unified/common/functions/qmldir new file: config/quickshell/overview-unified/common/qmldir new file: config/quickshell/overview-unified/common/widgets/RectangularShadow.qml new file: config/quickshell/overview-unified/common/widgets/StyledRectangularShadow.qml new file: config/quickshell/overview-unified/common/widgets/StyledText.qml new file: config/quickshell/overview-unified/common/widgets/StyledToolTip.qml new file: config/quickshell/overview-unified/common/widgets/StyledToolTipContent.qml new file: config/quickshell/overview-unified/common/widgets/qmldir new file: config/quickshell/overview-unified/modules/overview/Overview.qml new file: config/quickshell/overview-unified/modules/overview/OverviewWidget.qml new file: config/quickshell/overview-unified/modules/overview/OverviewWindow.qml new file: config/quickshell/overview-unified/modules/overview/qmldir new file: config/quickshell/overview-unified/services/GlobalStates.qml new file: config/quickshell/overview-unified/services/HyprlandData.qml new file: config/quickshell/overview-unified/services/qmldir new file: config/quickshell/overview-unified/shell.qml new file: config/quickshell/qs-hyprview-trixie/LICENSE new file: config/quickshell/qs-hyprview-trixie/README.md new file: config/quickshell/qs-hyprview-trixie/common/Appearance.qml new file: config/quickshell/qs-hyprview-trixie/layouts/BandsLayout.qml new file: config/quickshell/qs-hyprview-trixie/layouts/ColumnarLayout.qml new file: config/quickshell/qs-hyprview-trixie/layouts/HeroLayout.qml new file: config/quickshell/qs-hyprview-trixie/layouts/JustifiedLayout.qml new file: config/quickshell/qs-hyprview-trixie/layouts/LayoutsManager.qml new file: config/quickshell/qs-hyprview-trixie/layouts/MasonryLayout.qml new file: config/quickshell/qs-hyprview-trixie/layouts/SatelliteLayout.qml new file: config/quickshell/qs-hyprview-trixie/layouts/SmartGridLayout.qml new file: config/quickshell/qs-hyprview-trixie/layouts/SpiralLayout.qml new file: config/quickshell/qs-hyprview-trixie/layouts/StarggeredLayout.qml new file: config/quickshell/qs-hyprview-trixie/layouts/VortexLayout.qml new file: config/quickshell/qs-hyprview-trixie/layouts/qmldir new file: config/quickshell/qs-hyprview-trixie/modules/Hyprview.qml new file: config/quickshell/qs-hyprview-trixie/modules/SearchBox.qml new file: config/quickshell/qs-hyprview-trixie/modules/WindowThumbnail.qml new file: config/quickshell/qs-hyprview-trixie/modules/qmldir new file: config/quickshell/qs-hyprview-trixie/qs-hyprview-template.qml new file: config/quickshell/qs-hyprview-trixie/screenshots/bands.jpeg new file: config/quickshell/qs-hyprview-trixie/screenshots/hero.jpeg new file: config/quickshell/qs-hyprview-trixie/screenshots/masonry.jpeg new file: config/quickshell/qs-hyprview-trixie/screenshots/satellite.jpeg new file: config/quickshell/qs-hyprview-trixie/screenshots/smartgrid.jpeg new file: config/quickshell/qs-hyprview-trixie/screenshots/spiral.jpeg new file: config/quickshell/qs-hyprview-trixie/screenshots/staggered.jpeg new file: config/quickshell/qs-hyprview-trixie/screenshots/vortex.jpeg new file: config/quickshell/qs-hyprview-trixie/shell.qml --- .../overview-unified/services/HyprlandData.qml | 137 +++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 config/quickshell/overview-unified/services/HyprlandData.qml (limited to 'config/quickshell/overview-unified/services/HyprlandData.qml') diff --git a/config/quickshell/overview-unified/services/HyprlandData.qml b/config/quickshell/overview-unified/services/HyprlandData.qml new file mode 100644 index 00000000..e23472d0 --- /dev/null +++ b/config/quickshell/overview-unified/services/HyprlandData.qml @@ -0,0 +1,137 @@ +pragma Singleton +pragma ComponentBehavior: Bound + +import QtQuick +import Quickshell +import Quickshell.Io +import Quickshell.Hyprland + +/** + * Provides access to some Hyprland data not available in Quickshell.Hyprland. + */ +Singleton { + id: root + property var windowList: [] + property var addresses: [] + property var windowByAddress: ({}) + property var workspaces: [] + property var workspaceIds: [] + property var workspaceById: ({}) + property var activeWorkspace: null + property var monitors: [] + property var layers: ({}) + + function updateWindowList() { + getClients.running = true; + } + + function updateLayers() { + getLayers.running = true; + } + + function updateMonitors() { + getMonitors.running = true; + } + + function updateWorkspaces() { + getWorkspaces.running = true; + getActiveWorkspace.running = true; + } + + function updateAll() { + updateWindowList(); + updateMonitors(); + updateLayers(); + updateWorkspaces(); + } + + function biggestWindowForWorkspace(workspaceId) { + const windowsInThisWorkspace = HyprlandData.windowList.filter(w => w.workspace.id == workspaceId); + return windowsInThisWorkspace.reduce((maxWin, win) => { + const maxArea = (maxWin?.size?.[0] ?? 0) * (maxWin?.size?.[1] ?? 0); + const winArea = (win?.size?.[0] ?? 0) * (win?.size?.[1] ?? 0); + return winArea > maxArea ? win : maxWin; + }, null); + } + + Component.onCompleted: { + updateAll(); + } + + Connections { + target: Hyprland + + function onRawEvent(event) { + updateAll() + } + } + + Process { + id: getClients + command: ["hyprctl", "clients", "-j"] + stdout: StdioCollector { + id: clientsCollector + onStreamFinished: { + root.windowList = JSON.parse(clientsCollector.text) + let tempWinByAddress = {}; + for (var i = 0; i < root.windowList.length; ++i) { + var win = root.windowList[i]; + tempWinByAddress[win.address] = win; + } + root.windowByAddress = tempWinByAddress; + root.addresses = root.windowList.map(win => win.address); + } + } + } + + Process { + id: getMonitors + command: ["hyprctl", "monitors", "-j"] + stdout: StdioCollector { + id: monitorsCollector + onStreamFinished: { + root.monitors = JSON.parse(monitorsCollector.text); + } + } + } + + Process { + id: getLayers + command: ["hyprctl", "layers", "-j"] + stdout: StdioCollector { + id: layersCollector + onStreamFinished: { + root.layers = JSON.parse(layersCollector.text); + } + } + } + + Process { + id: getWorkspaces + command: ["hyprctl", "workspaces", "-j"] + stdout: StdioCollector { + id: workspacesCollector + onStreamFinished: { + root.workspaces = JSON.parse(workspacesCollector.text); + let tempWorkspaceById = {}; + for (var i = 0; i < root.workspaces.length; ++i) { + var ws = root.workspaces[i]; + tempWorkspaceById[ws.id] = ws; + } + root.workspaceById = tempWorkspaceById; + root.workspaceIds = root.workspaces.map(ws => ws.id); + } + } + } + + Process { + id: getActiveWorkspace + command: ["hyprctl", "activeworkspace", "-j"] + stdout: StdioCollector { + id: activeWorkspaceCollector + onStreamFinished: { + root.activeWorkspace = JSON.parse(activeWorkspaceCollector.text); + } + } + } +} -- cgit v1.2.3