How to close all windows in Hyprland at once

a month ago by alecsargent to c/windowmanagers

local function closeAllWindows()
    local windows = hl.get_windows()

    for _,w in pairs(windows) do
        hl.dispatch(hl.dsp.window.close({ window = w }))
    end
end

local function closeAllWindowsCurrentWorkspace()
    local cws = hl.get_active_workspace()
    local windows = hl.get_windows({ workspace = cws })

    for _,w in pairs(windows) do
        hl.dispatch(hl.dsp.window.close({ window = w }))
    end
end

-- Probably add another mod key for safety reasons.
hl.bind(M .. "+BackSpace", closeAllWindowsCurrentWorkspace )
hl.bind(M .. "+Delete", closeAllWindows )
windowmanagers
windowmanagers

@lemmy.zip

login for more options
386
251
32

A place to share, discuss & comment the window manager experience.

Visit our website


Related Communities

go to feed...