Search code examples
luaawesome-wm

How to set a custom icon of any client for the tasklist in awesomeWM v3.5.6?


if (c.class == "Google-chrome") then
     c.icon = capi.image ( "/home/art-attack/.config/awesome/icons/chrome.png" )
end

I tried it but I always got an error i.e attempt to call field 'image' (a nil value)

{ rule = { class = "Google-chrome" },
  properties = { icon = beautiful.icon_chrome } },

Then I find another way to use properties icon in awful.rules and it worked but didn't change the icon instead it disabled the icon of that client.


Solution

  • if c.class == "Google-chrome" then
        local icon = gears.surface("path/to/chrome.png")
        return text, bg, bg_image, icon
    end
    

    Add this code before

    if capi.client.focus == c then