1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-10-17 21:56:49 +02:00
dotfiles/hypr/helpers/focus-or-start.lua

11 lines
287 B
Lua

function FocusOrStart(command, classPrefix)
for _, window in ipairs(hl.get_windows()) do
if window.class:sub(1, #classPrefix) == classPrefix then
hl.dispatch(hl.dsp.focus({ window = window }))
return
end
end
hl.exec_cmd(command)
end