forked from Shinonome/dots-hyprland
make lock push hack work for multimonitor
This commit is contained in:
@@ -16,7 +16,6 @@ LockScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Push everything down
|
// Push everything down
|
||||||
property var lastWorkspaceId: 1
|
|
||||||
Variants {
|
Variants {
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
delegate: Scope {
|
delegate: Scope {
|
||||||
@@ -25,13 +24,16 @@ LockScreen {
|
|||||||
property string targetMonitorName: modelData.name
|
property string targetMonitorName: modelData.name
|
||||||
property int verticalMovementDistance: modelData.height
|
property int verticalMovementDistance: modelData.height
|
||||||
property int horizontalSqueeze: modelData.width * 0.2
|
property int horizontalSqueeze: modelData.width * 0.2
|
||||||
|
property int lastWorkspaceId
|
||||||
onShouldPushChanged: {
|
onShouldPushChanged: {
|
||||||
if (shouldPush) {
|
if (shouldPush) {
|
||||||
root.lastWorkspaceId = HyprlandData.activeWorkspace.id;
|
// Save workspace
|
||||||
|
print(targetMonitorName)
|
||||||
|
lastWorkspaceId = HyprlandData.monitors.find(m => m.name == targetMonitorName).activeWorkspace.id
|
||||||
// Set anim to vertical and move to very very big workspace for a sliding up effect
|
// Set anim to vertical and move to very very big workspace for a sliding up effect
|
||||||
Quickshell.execDetached(["hyprctl", "--batch", "keyword animation workspaces,1,7,menu_decel,slidevert; dispatch workspace 2147483647"]);
|
Quickshell.execDetached(["hyprctl", "--batch", `keyword animation workspaces,1,7,menu_decel,slidevert; dispatch workspace ${2147483647 - lastWorkspaceId}`]);
|
||||||
} else {
|
} else {
|
||||||
Quickshell.execDetached(["hyprctl", "--batch", `dispatch workspace ${root.lastWorkspaceId}; reload`]);
|
Quickshell.execDetached(["hyprctl", "--batch", `dispatch workspace ${lastWorkspaceId}; reload`]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user