feat(config/hypr): extend workspace keybinds to support up to 10 workspaces

Switched from a hard‑coded 1‑9 range to a dynamic 1‑10 range, allowing more workspaces and cleaning up the keybinding logic; also removed stray "No emojis." comment.

New Features
- Switch and move active windows using workspace numbers 1‑10.

Enhancements
- Loop now calculates key via modulo to support cyclic indexing.
- Introduced `workspaces` variable for readability.

Bug Fixes
- Removed the leftover comment "No emojis."
This commit is contained in:
sankalp committed 2026-05-25 23:26:29 +05:45
1 parent 786714f669
commit 66c5393cfe
2 files changed
+8 -7

No files matched your search

+8 -6
View File
@@ -131,12 +131,14 @@ for key, val in pairs({
hl.bind("ALT + SHIFT + " .. key, hl.dsp.window.resize({ x = val[2], y = val[3], relative = true })) -- Resize
end
-- Switch workspaces with mainMod + [0-9]
-- Move active window to a workspace with mainMod + SHIFT + [0-9]
for i = 1, 9 do
hl.bind(mainMod .. " + " .. i, hl.dsp.focus({ workspace = i }))
hl.bind("ALT + SHIFT + " .. i, hl.dsp.window.move({ workspace = i, follow = false }))
hl.bind(mainMod .. " + SHIFT + " .. i, hl.dsp.window.move({ workspace = i }))
-- Switch workspaces with mainMod + [0-10]
-- Move active window to a workspace with mainMod + SHIFT + [0-10]
local workspaces = 10
for i = 1, workspaces do
local key = i % 10
hl.bind(mainMod .. " + " .. key, hl.dsp.focus({ workspace = i }))
hl.bind("ALT + SHIFT + " .. key, hl.dsp.window.move({ workspace = i, follow = false }))
hl.bind(mainMod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = i }))
end
-- Move/resize windows with SUPER + LMB/RMB and dragging
-1
View File
@@ -7,4 +7,3 @@ require("configs.startup_apps")
require("configs.misc")
dofile("/home/sankalp/.config/Modus/config/hypr/modus.lua")