feat: better binds

This commit is contained in:
2026-07-17 09:04:29 +02:00
parent cad9b833ae
commit 682750bf63
2 changed files with 25 additions and 17 deletions
+15 -17
View File
@@ -2,19 +2,25 @@ local function exit_submap()
hl.dispatch(hl.dsp.submap("reset"))
end
for i = 1, 10, 1 do
local function add_workspace_keymap(bind_goto, bind_move, num)
hl.bind(
"SUPER + " .. tostring(i % 10),
hl.dsp.focus({ workspace = tostring(i) }),
{ description = "Go to workspace " .. tostring(i) }
bind_goto,
hl.dsp.focus({ workspace = tostring(num) }),
{ description = "Go to workspace " .. tostring(num) }
)
hl.bind(
"SUPER + SHIFT + " .. tostring(i % 10),
hl.dsp.window.move({ workspace = tostring(i), follow = 1 }),
{ description = "Move window to workspace " .. tostring(i) }
bind_move,
hl.dsp.window.move({ workspace = tostring(num), follow = 1 }),
{ description = "Move window to workspace " .. tostring(num) }
)
end
for i = 1, 10, 1 do
add_workspace_keymap("SUPER + " .. tostring(i % 10), "SUPER + SHIFT + " .. tostring(i % 10), i)
end
-- Super + - for 11th workspace
add_workspace_keymap("SUPER + code:20", "SUPER + SHIFT + code:20", 11)
hl.bind("SUPER + h", hl.dsp.focus({ direction = "l" }), { description = "Focus next window to left" })
hl.bind("SUPER + l", hl.dsp.focus({ direction = "r" }), { description = "Focus next window to right" })
hl.bind("SUPER + j", hl.dsp.focus({ direction = "d" }), { description = "Focus next window below" })
@@ -29,17 +35,9 @@ hl.bind(
hl.define_submap("workspace", function()
for i = 1, 10, 1 do
hl.bind(
tostring(i % 10),
hl.dsp.focus({ workspace = tostring(i) }),
{ description = "Go to workspace " .. tostring(i) }
)
hl.bind(
"SHIFT + " .. tostring(i % 10),
hl.dsp.window.move({ workspace = tostring(i), follow = 1 }),
{ description = "Move window to workspace " .. tostring(i) }
)
add_workspace_keymap(tostring(i % 10), "SHIFT + " .. tostring(i % 10), i)
end
add_workspace_keymap("code:20", "SHIFT + code:20", 11)
hl.bind("h", hl.dsp.focus({ direction = "l" }), { description = "Focus next window to left" })
hl.bind("l", hl.dsp.focus({ direction = "r" }), { description = "Focus next window to right" })