workspace: Delete empty tag when unselected

This commit is contained in:
James Reed 2020-07-29 17:13:09 -06:00
parent a4e00a79cb
commit a768a20b06
No known key found for this signature in database
GPG Key ID: 0BE2BD33C5E8125E
1 changed files with 6 additions and 0 deletions

View File

@ -144,6 +144,12 @@ function ws.new(name, args)
end
local tag = awful.tag.add(name, props)
tag:connect_signal("property::selected", function ()
if tag.volatile and not tag.selected and #tag:clients() == 0 then
tag:delete()
end
end)
return handle_args(tag, args)
end