diff options
| author | Don Williams <don.e.williams@gmail.com> | 2025-11-30 20:04:02 -0500 |
|---|---|---|
| committer | Don Williams <don.e.williams@gmail.com> | 2025-11-30 20:04:02 -0500 |
| commit | ca0c23cce006ea3f7d793c5fa8eee6acff196470 (patch) | |
| tree | 092a7446c0f494c958b11b1af09474d99718a74e /config/quickshell/overview/services/HyprlandData.qml | |
| parent | 510eafbe0560cff6e459b64fcb778d645cd43ab3 (diff) | |
Integrate Quickshell-Overview with Qt6 fixes and automation scripts
## Overview
This commit integrates the corrected Quickshell-Overview feature across all
installation and update workflows. The overview provides an AGS alternative
with live window previews toggled via Super+TAB keybind.
## Changes
### 1. Quickshell Overview QML Files
- Added config/quickshell/overview/ subdirectory with Qt6-compatible QML
- Includes 20+ files covering:
* OverviewWindow.qml with proper clipping (no OpacityMask, uses QtQuick.Effects)
* OverviewWidget.qml for window handling
* Overview.qml main component with Hyprland integration
* Common utilities and styling
* Services for Hyprland data and global state management
### 2. copy.sh Updates
- Removes default shell.qml that blocks quickshell named config detection
- Auto-copies config/quickshell/overview to ~/.config/quickshell/overview/
- Updates old 'qs' startup commands to 'qs -c overview'
- Handles both fresh installs and config overwrite scenarios
### 3. upgrade.sh Updates
- Added config/quickshell/ to upgrade directory list
- Excludes shell.qml to preserve overview config detection capability
- Enables seamless upgrades without losing quickshell settings
### 4. IPC Command Fixes
- Corrected OverviewToggle.sh to use proper 'qs ipc -c overview call overview toggle'
- Fixed startup commands from old 'qs' to 'qs -c overview'
- Hyprland-Dots now uses corrected toggle script
## Qt6 Compatibility
- Replaced Qt5Compat.GraphicalEffects with QtQuick.Effects
- Removed OpacityMask in favor of Qt6-compatible clipping technique
- All QML properly imports Qt6 modules
## Release Script
- release.sh automatically uses copy.sh, inheriting all quickshell updates
## Testing
- Verified on target systems (Fedora 43 VM, jak-nixos)
- qs -c overview successfully launches overview config when shell.qml is removed
- IPC toggle commands work correctly within Wayland sessions
## Files Modified
- config/quickshell/overview/* (20 new files)
- copy.sh (enhanced QS handling)
- upgrade.sh (added quickshell to upgrade paths)
Diffstat (limited to 'config/quickshell/overview/services/HyprlandData.qml')
| -rw-r--r-- | config/quickshell/overview/services/HyprlandData.qml | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/config/quickshell/overview/services/HyprlandData.qml b/config/quickshell/overview/services/HyprlandData.qml new file mode 100644 index 00000000..e23472d0 --- /dev/null +++ b/config/quickshell/overview/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); + } + } + } +} |
