79590002

Date: 2025-04-24 07:11:39
Score: 0.5
Natty:
Report link

This config solves the problem

local wf = hs.window.filter
-- print primary screen id
screen_id = hs.screen.primaryScreen():id()
print(screen_id)
filter = wf.new():setCurrentSpace(true):setDefaultFilter{}:setScreens(screen_id)
switcher_space = hs.window.switcher.new(filter)
hs.window.switcher.ui.showThumbnails = false
hs.window.switcher.ui.showSelectedThumbnail = false
hs.hotkey.bind('alt', 'tab', 'Next window', function()
    switcher_space:next()
    hs.alert.closeAll()
end)
hs.hotkey.bind('alt-shift', 'tab', 'Prev window', function()
    switcher_space:previous()
    hs.alert.closeAll()
end)

-- Bind option + number keys to switch spaces
for i = 1, 6 do
    hs.hotkey.bind('alt', tostring(i), function()
        hs.spaces.gotoSpace(i+2)
    end)
end

print(hs.spaces.allSpaces())


Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Akash Lakhera