--TODO find out why it doesnt work at start --local awful = require("awful") function nametags(s) local tags = s.tags for _, tag in ipairs(tags) do -- set tag basename if tag.basename == nil then tag.basename = tag.name end -- check if tag has any clients. if not, use basename if next(tag:clients()) == nil then tag.name = tag.basename else -- loop over all screen clients (ordered top to bottom) local hastag = nil for _, c in ipairs(s.clients) do -- test if client in on the tag for _, ctag in ipairs(c:tags()) do if ctag == tag then hastag = c break end end -- if it does, this will be the tag name. so break if hastag ~= nil then break end end -- set tag name -- there should always be a tag since we checked above so if there isnt then there is clearly a problem --TODO remove this if statement if hastag then tag.name = tag.basename .. ": " .. hastag.class end end end end function nametagsc(c) nametags(c.screen) end client.connect_signal("manage", nametagsc) client.connect_signal("swapped", nametagsc) client.connect_signal("tagged", nametagsc) client.connect_signal("unmanage", nametagsc) client.connect_signal("untagged", nametagsc) --awful.screen.connect_for_each_screen(nametags)