aboutsummaryrefslogtreecommitdiffstats
path: root/config/quickshell/overview/services/HyprlandData.qml
diff options
context:
space:
mode:
authorDon Williams <Don.e.williams@gmail.com>2026-07-04 17:28:36 -0400
committerPinapelz <yukais@pinapelz.com>2026-08-29 21:39:35 -0700
commite974676da74ca270b289f789ae055e3a9b4012fe (patch)
treee43881adb8d2ab15b85d009e7ad85999d6f61416 /config/quickshell/overview/services/HyprlandData.qml
parent2f4b617fbb4214e50ae0bc44fd4acb5385731c75 (diff)
Updated quickshell overview to current version
Signed-off-by: Don Williams <Don.e.williams@gmail.com> On branch development Your branch is up to date with 'origin/development'. Changes to be committed: modified: CHANGELOG.md new file: config/quickshell/overview-bak/README.md new file: config/quickshell/overview-bak/assets/image.png new file: config/quickshell/overview-bak/common/Appearance.qml new file: config/quickshell/overview-bak/common/Config.qml new file: config/quickshell/overview-bak/common/functions/ColorUtils.qml new file: config/quickshell/overview-bak/common/functions/qmldir new file: config/quickshell/overview-bak/common/qmldir new file: config/quickshell/overview-bak/common/widgets/StyledRectangularShadow.qml new file: config/quickshell/overview-bak/common/widgets/StyledText.qml new file: config/quickshell/overview-bak/common/widgets/StyledToolTip.qml new file: config/quickshell/overview-bak/common/widgets/StyledToolTipContent.qml new file: config/quickshell/overview-bak/common/widgets/qmldir new file: config/quickshell/overview-bak/modules/overview/Overview.qml new file: config/quickshell/overview-bak/modules/overview/OverviewWidget.qml new file: config/quickshell/overview-bak/modules/overview/OverviewWindow.qml new file: config/quickshell/overview-bak/modules/overview/qmldir new file: config/quickshell/overview-bak/services/GlobalStates.qml new file: config/quickshell/overview-bak/services/HyprlandData.qml new file: config/quickshell/overview-bak/services/qmldir new file: config/quickshell/overview-bak/shell.qml new file: config/quickshell/overview/.github/FUNDING.yml modified: config/quickshell/overview/README.md new file: config/quickshell/overview/assets/Workspace_Wallpaper.png modified: config/quickshell/overview/assets/image.png modified: config/quickshell/overview/common/Appearance.qml modified: config/quickshell/overview/common/Config.qml new file: config/quickshell/overview/config.example.json modified: config/quickshell/overview/modules/overview/Overview.qml modified: config/quickshell/overview/modules/overview/OverviewWidget.qml modified: config/quickshell/overview/modules/overview/OverviewWindow.qml new file: config/quickshell/overview/quickshell-overview.qml modified: config/quickshell/overview/services/HyprlandData.qml modified: config/quickshell/overview/shell.qml
Diffstat (limited to 'config/quickshell/overview/services/HyprlandData.qml')
-rw-r--r--config/quickshell/overview/services/HyprlandData.qml88
1 files changed, 80 insertions, 8 deletions
diff --git a/config/quickshell/overview/services/HyprlandData.qml b/config/quickshell/overview/services/HyprlandData.qml
index e23472d0..6127e989 100644
--- a/config/quickshell/overview/services/HyprlandData.qml
+++ b/config/quickshell/overview/services/HyprlandData.qml
@@ -5,6 +5,7 @@ import QtQuick
import Quickshell
import Quickshell.Io
import Quickshell.Hyprland
+import "../common"
/**
* Provides access to some Hyprland data not available in Quickshell.Hyprland.
@@ -15,11 +16,17 @@ Singleton {
property var addresses: []
property var windowByAddress: ({})
property var workspaces: []
+ property var allWorkspaces: []
property var workspaceIds: []
property var workspaceById: ({})
property var activeWorkspace: null
property var monitors: []
property var layers: ({})
+ property bool pendingWindowsUpdate: false
+ property bool pendingMonitorsUpdate: false
+ property bool pendingLayersUpdate: false
+ property bool pendingWorkspacesUpdate: false
+ property bool pendingActiveWorkspaceUpdate: false
function updateWindowList() {
getClients.running = true;
@@ -39,10 +46,46 @@ Singleton {
}
function updateAll() {
- updateWindowList();
- updateMonitors();
- updateLayers();
- updateWorkspaces();
+ scheduleUpdates(true, true, true, true, true);
+ }
+
+ function scheduleUpdates(windows, monitors, layers, workspaces, activeWorkspace) {
+ pendingWindowsUpdate = pendingWindowsUpdate || !!windows;
+ pendingMonitorsUpdate = pendingMonitorsUpdate || !!monitors;
+ pendingLayersUpdate = pendingLayersUpdate || !!layers;
+ pendingWorkspacesUpdate = pendingWorkspacesUpdate || !!workspaces;
+ pendingActiveWorkspaceUpdate = pendingActiveWorkspaceUpdate || !!activeWorkspace;
+
+ const debounceMs = Math.max(0, Config.options.hacks.hyprlandEventDebounceMs);
+ if (debounceMs === 0) {
+ flushPendingUpdates();
+ } else {
+ eventDebounceTimer.interval = debounceMs;
+ eventDebounceTimer.restart();
+ }
+ }
+
+ function flushPendingUpdates() {
+ if (pendingWindowsUpdate) {
+ pendingWindowsUpdate = false;
+ updateWindowList();
+ }
+ if (pendingMonitorsUpdate) {
+ pendingMonitorsUpdate = false;
+ updateMonitors();
+ }
+ if (pendingLayersUpdate) {
+ pendingLayersUpdate = false;
+ updateLayers();
+ }
+ if (pendingWorkspacesUpdate) {
+ pendingWorkspacesUpdate = false;
+ getWorkspaces.running = true;
+ }
+ if (pendingActiveWorkspaceUpdate) {
+ pendingActiveWorkspaceUpdate = false;
+ getActiveWorkspace.running = true;
+ }
}
function biggestWindowForWorkspace(workspaceId) {
@@ -55,24 +98,51 @@ Singleton {
}
Component.onCompleted: {
- updateAll();
+ scheduleUpdates(true, true, true, true, true);
+ flushPendingUpdates();
}
Connections {
target: Hyprland
function onRawEvent(event) {
- updateAll()
+ const eventName = `${event?.name ?? event?.event ?? event?.type ?? ""}`;
+ if (["openlayer", "closelayer", "screencast"].includes(eventName))
+ return;
+
+ if (eventName === "openwindow" || eventName === "closewindow" || eventName === "movewindow" || eventName === "movewindowv2" || eventName === "windowtitle") {
+ scheduleUpdates(true, false, false, true, false);
+ return;
+ }
+
+ if (eventName === "workspace" || eventName === "workspacev2" || eventName === "focusedmon" || eventName === "focusedmonv2" || eventName === "activewindow" || eventName === "activewindowv2") {
+ scheduleUpdates(false, false, false, true, true);
+ return;
+ }
+
+ if (eventName.startsWith("monitor") || eventName === "configreloaded") {
+ scheduleUpdates(true, true, false, true, true);
+ return;
+ }
+
+ scheduleUpdates(true, true, true, true, true);
}
}
+ Timer {
+ id: eventDebounceTimer
+ interval: Math.max(0, Config.options.hacks.hyprlandEventDebounceMs)
+ repeat: false
+ onTriggered: root.flushPendingUpdates()
+ }
+
Process {
id: getClients
command: ["hyprctl", "clients", "-j"]
stdout: StdioCollector {
id: clientsCollector
onStreamFinished: {
- root.windowList = JSON.parse(clientsCollector.text)
+ root.windowList = JSON.parse(clientsCollector.text);
let tempWinByAddress = {};
for (var i = 0; i < root.windowList.length; ++i) {
var win = root.windowList[i];
@@ -112,7 +182,9 @@ Singleton {
stdout: StdioCollector {
id: workspacesCollector
onStreamFinished: {
- root.workspaces = JSON.parse(workspacesCollector.text);
+ const rawWorkspaces = JSON.parse(workspacesCollector.text);
+ root.allWorkspaces = rawWorkspaces;
+ root.workspaces = rawWorkspaces.filter(ws => ws.id >= 1 && ws.id <= 100);
let tempWorkspaceById = {};
for (var i = 0; i < root.workspaces.length; ++i) {
var ws = root.workspaces[i];
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage