feat(hypr): auto-swap-to-master on fetch/focus, use --persistent dispatches

fetch_or_launch and focus_or_launch now swap the target client to master
layout position when it is not already the master. Scripts switched from raw
hl.dsp.* calls to --persistent lua function dispatches (fetch_or_launch /
focus_or_launch), and both now guard against empty rofi selection.
This commit is contained in:
2026-07-31 09:22:45 -04:00
parent 039d15a5e6
commit 158c86efcf
3 changed files with 23 additions and 12 deletions
+13 -5
View File
@@ -209,10 +209,14 @@ function focus_or_launch(opts)
on_current_monitor = true,
}))
end
hl.dispatch(hl.dsp.focus({
window = "address:" .. client.address
}))
local layout = client.layout
if not (layout and layout.name == "master" and layout.is_master) then
hl.dispatch(hl.dsp.layout("swapwithmaster"))
end
return
end
end
@@ -235,14 +239,18 @@ function fetch_or_launch(opts)
if value and string.find(string.lower(value), string.lower(match), 1, true) then
if use_workspace and client.workspace and client.workspace.id then
hl.dispatch(hl.dsp.window.move({
workspace = active_workspace.id,
workspace = active_workspace,
on_current_monitor = true,
window = client,
}))
end
hl.dispatch(hl.dsp.focus({
window = "address:" .. client.address
}))
hl.dispatch(hl.dsp.focus({window = client}))
local layout = client.layout
if not (layout and layout.name == "master" and layout.is_master) then
hl.dispatch(hl.dsp.layout("swapwithmaster"))
end
return
end
end