On 02/18/2011 10:49 AM, Uli Schlachter wrote:
At the end of your rc.lua, do:

recurse = true
client.add_signal("new", function(c)
    c:add_signal("property::icon", function()
       -- Make sure we aren't going into an endless loop when changing the icon
       if not recurse then return end
       if not client.icon then return end
       -- Here you can do something with c.icon, e.g.:
       c.icon:save("/tmp/icon.png")
       local h =
  io.popen("convert -colorspace Gray /tmp/icon.png /tmp/icon2.png")
       recurse = false
       c.icon = image("/tmp/icon2.png")
       recurse = true
    end)
end)

No idea if this works (I don't even know if that "convert" call works), but I
hope this helps you finding something that works.

Cheers,
Uli
Thanks a lot, it worked like a charm! The only thing I had to remove was line:

if not client.icon then return end

because it always remained nil. And one more thing, I had to read something from popened stream because without it the call to convert lagged behind (I presume, it were done concurrently) and next line used the old icon. I still don't understand how the signal works in this case and why it handles particularly taskbar icons. So I have to ask one more question - how the same thing could be done for the systray? Sorry for me being a little annoying:)

--
To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.

Reply via email to