mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-15 16:52:47 -04:00
Support Hyprland lua dispatching (#2419)
This commit is contained in:
@@ -279,7 +279,7 @@ Item {
|
||||
const nextIndex = direction > 0 ? Math.min(validIndex + 1, realWorkspaces.length - 1) : Math.max(validIndex - 1, 0);
|
||||
|
||||
if (nextIndex !== validIndex) {
|
||||
Hyprland.dispatch(`workspace ${realWorkspaces[nextIndex].id}`);
|
||||
HyprlandService.focusWorkspace(realWorkspaces[nextIndex].id);
|
||||
}
|
||||
} else if (CompositorService.isDwl) {
|
||||
const currentTag = getCurrentWorkspace();
|
||||
|
||||
@@ -580,8 +580,9 @@ Item {
|
||||
NiriService.switchToWorkspace(data.id);
|
||||
break;
|
||||
case "hyprland":
|
||||
if (data.id)
|
||||
Hyprland.dispatch(`workspace ${data.id}`);
|
||||
if (data.id) {
|
||||
HyprlandService.focusWorkspace(data.id);
|
||||
}
|
||||
break;
|
||||
case "dwl":
|
||||
if (data.tag !== undefined)
|
||||
@@ -670,7 +671,7 @@ Item {
|
||||
return;
|
||||
}
|
||||
|
||||
Hyprland.dispatch(`workspace ${realWorkspaces[nextIndex].id}`);
|
||||
HyprlandService.focusWorkspace(realWorkspaces[nextIndex].id);
|
||||
} else if (CompositorService.isDwl) {
|
||||
const realWorkspaces = getRealWorkspaces();
|
||||
if (realWorkspaces.length < 2) {
|
||||
@@ -1308,7 +1309,7 @@ Item {
|
||||
NiriService.switchToWorkspace(modelData.id);
|
||||
}
|
||||
} else if (CompositorService.isHyprland && modelData?.id) {
|
||||
Hyprland.dispatch(`workspace ${modelData.id}`);
|
||||
HyprlandService.focusWorkspace(modelData.id);
|
||||
} else if (CompositorService.isDwl && modelData?.tag !== undefined) {
|
||||
DwlService.switchToTag(root.screenName, modelData.tag);
|
||||
} else if ((CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) && modelData?.num) {
|
||||
@@ -1671,7 +1672,7 @@ Item {
|
||||
if (!winId)
|
||||
return;
|
||||
if (CompositorService.isHyprland) {
|
||||
Hyprland.dispatch(`focuswindow address:${winId}`);
|
||||
HyprlandService.focusWindow(winId);
|
||||
} else if (CompositorService.isNiri) {
|
||||
NiriService.focusWindow(winId);
|
||||
}
|
||||
@@ -1840,7 +1841,7 @@ Item {
|
||||
if (!winId)
|
||||
return;
|
||||
if (CompositorService.isHyprland) {
|
||||
Hyprland.dispatch(`focuswindow address:${winId}`);
|
||||
HyprlandService.focusWindow(winId);
|
||||
} else if (CompositorService.isNiri) {
|
||||
NiriService.focusWindow(winId);
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ Item {
|
||||
if (!specialName)
|
||||
return false;
|
||||
|
||||
Hyprland.dispatch("togglespecialworkspace " + specialName);
|
||||
HyprlandService.toggleSpecial(specialName);
|
||||
Qt.callLater(() => waylandToplevel.activate());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -255,7 +255,8 @@ Scope {
|
||||
}
|
||||
|
||||
const targetId = thisMonitorWorkspaceIds[targetIndex];
|
||||
Hyprland.dispatch("workspace " + targetId);
|
||||
|
||||
HyprlandService.focusWorkspace(targetId);
|
||||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ Item {
|
||||
onClicked: {
|
||||
if (root.draggingTargetWorkspace === -1) {
|
||||
root.overviewOpen = false;
|
||||
Hyprland.dispatch(`workspace ${workspaceValue}`);
|
||||
HyplandService.focusWorkspace(workspaceValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,7 +352,7 @@ Item {
|
||||
root.draggingTargetWorkspace = -1;
|
||||
|
||||
if (targetWorkspace !== -1 && targetWorkspace !== windowData?.workspace.id) {
|
||||
Hyprland.dispatch(`movetoworkspacesilent ${targetWorkspace},address:${windowData?.address}`);
|
||||
HyprlandService.moveToWorkspace(targetWorkspace, windowData?.address, false)
|
||||
Qt.callLater(() => {
|
||||
Hyprland.refreshToplevels();
|
||||
Hyprland.refreshWorkspaces();
|
||||
@@ -372,10 +372,10 @@ Item {
|
||||
return;
|
||||
if (event.button === Qt.LeftButton) {
|
||||
root.overviewOpen = false;
|
||||
Hyprland.dispatch(`focuswindow address:${windowData.address}`);
|
||||
HyprlandService.focusWindow(windowData.address);
|
||||
event.accepted = true;
|
||||
} else if (event.button === Qt.MiddleButton) {
|
||||
Hyprland.dispatch(`closewindow address:${windowData.address}`);
|
||||
HyprlandService.closeWindow(windowData.address);
|
||||
event.accepted = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user