Better window management

This commit is contained in:
2026-08-16 16:42:16 +01:00
parent f4f40442a8
commit aaf8ae59df
3 changed files with 104 additions and 53 deletions
+43 -11
View File
@@ -113,20 +113,52 @@ bind('SUPER + CTRL + L', function()
end
end
if workspace.special then
hl.workspace_rule { workspace = tostring(workspace.name), layout = next_layout }
else
hl.workspace_rule { workspace = tostring(workspace.id), layout = next_layout }
end
hl.workspace_rule { workspace = 'name:' .. tostring(workspace.name), layout = next_layout }
notify('󱂬 Workspace layout set to ' .. next_layout)
end, 'Toggle workspace layout')
local get_current_layout = function()
local workspace = hl.get_active_workspace()
if hl.get_active_special_workspace() then
workspace = hl.get_active_special_workspace()
end
if not workspace then
return 'dwindle'
end
return workspace.tiled_layout
end
-- Move focus with SUPER + arrow keys
bind('SUPER + H', hl.dsp.focus { direction = 'left' }, 'Move window focus left')
bind('SUPER + L', hl.dsp.focus { direction = 'right' }, 'Move window focus right')
bind('SUPER + K', hl.dsp.focus { direction = 'up' }, 'Move window focus up')
bind('SUPER + J', hl.dsp.focus { direction = 'down' }, 'Move window focus down')
bind('SUPER + H', function()
if get_current_layout() == 'monocle' then
hl.dispatch(hl.dsp.window.cycle_next { tiled = true, next = false })
else
hl.dispatch(hl.dsp.focus { direction = 'left' })
end
end, 'Move window focus left')
bind('SUPER + L', function()
if get_current_layout() == 'monocle' then
hl.dispatch(hl.dsp.window.cycle_next { tiled = true, next = true })
else
hl.dispatch(hl.dsp.focus { direction = 'right' })
end
end, 'Move window focus right')
bind('SUPER + K', function()
if get_current_layout() == 'monocle' then
hl.dispatch(hl.dsp.window.cycle_next { tiled = true, next = false })
else
hl.dispatch(hl.dsp.focus { direction = 'up' })
end
end, 'Move window focus up')
bind('SUPER + J', function()
if get_current_layout() == 'monocle' then
hl.dispatch(hl.dsp.window.cycle_next { tiled = true, next = true })
else
hl.dispatch(hl.dsp.focus { direction = 'down' })
end
end, 'Move window focus down')
bind('SUPER + SHIFT + H', hl.dsp.window.move { direction = 'left' }, 'Move window left')
bind('SUPER + SHIFT + L', hl.dsp.window.move { direction = 'right' }, 'Move window right')
bind('SUPER + SHIFT + K', hl.dsp.window.move { direction = 'up' }, 'Move window up')
@@ -162,8 +194,8 @@ bind('SUPER + D', function()
end, 'Toggle comms workspace')
-- Cycle through applications on active workspace
bind('SUPER + TAB', hl.dsp.window.cycle_next { next = true }, 'Cycle to next window')
bind('SUPER + SHIFT + TAB', hl.dsp.window.cycle_next { next = false }, 'Cycle to prev window')
bind('SUPER + TAB', hl.dsp.window.cycle_next { tiled = true, next = true }, 'Cycle to next window')
bind('SUPER + SHIFT + TAB', hl.dsp.window.cycle_next { tiled = true, next = false }, 'Cycle to prev window')
-- bind("SUPER + TAB", /*bringactivetotop*/, "Reveal active window on top")
-- bind("SUPER SHIFT + TAB", /*bringactivetotop*/, "Reveal active window on top")