-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop-bindings.lua
More file actions
30 lines (29 loc) · 1.53 KB
/
Copy pathloop-bindings.lua
File metadata and controls
30 lines (29 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- 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 })