mogenson / PaperWM.spoon

Tiled scrollable window manager for MacOS
MIT License
442 stars 19 forks source link

Add a window parameter to moveWindowToSpace() #44

Closed mogenson closed 6 months ago

mogenson commented 6 months ago

This allows the PaperWM API to be called externally with a provided window. I use it with a function in my HammerSpoon config that moves all windows for a specific application to a given space.

function move_app_windows_to_space(application, index)
    local windows = hs.window.filter.new(application):getWindows()
    for i, window in ipairs(windows or {}) do
        -- give time to process window events between moves
        hs.timer.doAfter(0.1 * i, function()
            PaperWM:moveWindowToSpace(index, window)
        end)
    end
end