-- Loop ring (abhinav.loop): HOLD SUPER+CTRL -> radial snap ring with live -- preview at the cursor; move toward a direction, release to snap. Two binds -- cover both press orders of the chord. local function loop_open() hl.dispatch(hl.dsp.submap("loop")) hl.dispatch(hl.dsp.global("athena-loop:open")) end o.bind("SUPER + Control_L", "Loop ring", loop_open) o.bind("CTRL + Super_L", "Loop ring", loop_open) -- While the ring is open every normal bind is suspended; only these exist. -- h/j/k/l (and arrows) select halves, u/i/n/m the quarters, enter applies. hl.define_submap("loop", function() local function sel(name) return hl.dsp.global("athena-loop:" .. name) end for _, k in ipairs({ "H", "LEFT" }) do hl.bind("SUPER + CTRL + " .. k, sel("sel-left")) end for _, k in ipairs({ "L", "RIGHT" }) do hl.bind("SUPER + CTRL + " .. k, sel("sel-right")) end for _, k in ipairs({ "K", "UP" }) do hl.bind("SUPER + CTRL + " .. k, sel("sel-up")) end for _, k in ipairs({ "J", "DOWN" }) do hl.bind("SUPER + CTRL + " .. k, sel("sel-down")) end hl.bind("SUPER + CTRL + U", sel("sel-tl")) hl.bind("SUPER + CTRL + I", sel("sel-tr")) hl.bind("SUPER + CTRL + N", sel("sel-bl")) hl.bind("SUPER + CTRL + M", sel("sel-br")) hl.bind("SUPER + CTRL + RETURN", sel("sel-max")) -- maximize (bar visible) hl.bind("SUPER + CTRL + SPACE", sel("sel-almost")) -- almost-maximize hl.bind("SUPER + CTRL + ESCAPE", sel("cancel")) hl.bind("catchall", function() end) end) hl.layer_rule({ match = { namespace = "athena-loop" }, no_anim = true })