In awesome
window manager, I want to create a shortcut to toggle show dekstop
(like modkey + d
)
I i press ModKey + d
then it should show destop and again i press Modkey + d
it should show the windows like previously
Is this possible
In awesome
window manager, I want to create a shortcut to toggle show dekstop
(like modkey + d
)
I i press ModKey + d
then it should show destop and again i press Modkey + d
it should show the windows like previously
Is this possible
In your rc.lua
set the following:
local show_desktop = false
then in globalkeys = gears.table.join(
add:
-- Toggle showing the desktop
awful.key({ altkey, "Control" }, "d",
function(c)
if show_desktop then
for _, c in ipairs(client.get()) do
c:emit_signal(
"request::activate", "key.unminimize", {raise = true}
)
end
show_desktop = false
else
for _, c in ipairs(client.get()) do
c.minimized = true
end
show_desktop = true
end
end,
{description = "toggle showing the desktop", group = "client"}),
I use ctrl+alt+d but you can replace the above with awful.key({ modkey }, "d",
if preferred.
Here is a link to my Reddit post about this as well.
This is what I once used to do so (borrowed from here), although I remember it messed up the arrangement of clients/windows:
awful.key({ M }, "d", function()
local tags = awful.screen.focused().tags
for i = 1, 2 do tags[i].selected = false end end,
create_description("show", "desktop")),
awful.key({ M, S }, "d", function()
local tags = awful.screen.focused().tags
for i = 1, 2 do tags[i].selected = true end end,
create_description("unshow", "desktop")),