KDE's edge effects for Hyprland.
hl.plugin.hypredge.edge_effect(edge, dispatcher):
Triggers a dispatcher when the cursor enters a region of a monitor.
Valid edges are top, bottom, left, right, topleft, topright, bottomleft, bottomright.
Valid dispatchers include hl.dsp... as well as lua functions.
hl.plugin.hypredge.move_cursor_to_edge(edge):
Moves the cursor to that edge of the screen, not affecting the other axis.
Valid edges are top, bottom, left, right.
This will be made into a dispatcher once this issue is fixed.
Adds the effect hypredge_ignore_constraints [on|off].
By default, hypredge will not trigger edge effects if the mouse is constrained. This overrides that, allowing edge effects to always trigger.
if hl.plugin.hypredge ~= nil then
hl.config({
plugin = {
hypredge = {
corner_barrier = 100 -- default
}
}
})
-- This emulates workspace switching by screen edge, like in KDE.
hl.plugin.hypredge.edge_effect("left", function()
hl.dispatch(hl.dsp.focus({ workspace = "e-1" }))
hl.plugin.hypredge.move_cursor_to_edge("right")
end)
hl.plugin.hypredge.edge_effect("right", function()
hl.dispatch(hl.dsp.focus({ workspace = "e+1" }))
hl.plugin.hypredge.move_cursor_to_edge("left")
end)
-- You can use any dispatchers you want!
hl.plugin.hypredge.edge_effect("bottom", hl.dsp.exec_cmd("kitty"))
-- Corners are also trigger areas!
hl.plugin.hypredge.edge_effect("topright", hl.dsp.exec_cmd("firefox"))
-- This lets dispatchers trigger when FFXIV is focused.
-- Normally, it constrains the mouse meaning edge effects do not fire.
hl.window_rule({
match = { title = "FINAL FANTASY XIV" },
hypredge_ignore_constraints = "on",
})
end