On 01.07.2011 22:05, Daniel wrote:
> Ryan T. Sawyer <sawyer07+wm <at> gmail.com> writes:
> 
>>
>>> My awesome is 3.4.5 and here is the code I'm using:
>>>
>>
>> I missed the original message, probably because I hadn't joined the
>> list yet when it was sent out. Where would I put this code to try it
>> out? Is it in rc.lua or somewhere in the awful lib files?
> 
> The code goes in rc.lua, in the end may be a good place. In the default
> rc.lua there is signal stuff there.
> 
> This code does not work with current awesome from git. I'm trying to get 
> it working. Changing add_signal to connect_signal helps, but still I get
> "attempt to call method save (a nil value)". (c.icon itself is not nil, it
> is userdata: 0xbeefbeef)... Anybody?
> 
> recurse = true
> client.connect_signal("new",
>   function(c)
>     c:connect_signal("property::icon",
>       function()
>         if not recurse then return end
>         c.icon:save("/tmp/icon.png")
>         local h = io.popen("convert -colorspace Gray /tmp/icon.png 
> /tmp/icon2.png"):read("*all")                                                 
>  
>                          recurse = false
>         c.icon = image("/tmp/icon2.png")                                    
>         recurse = true
>       end)
>     end)

c.icon:write_to_png("/tmp/icon.png")

Also, instead of image() you need
oocairo.image_surface_create_from_png("/tmp/icon2.png")

Cheers,
Uli

-- 
"Do you know that books smell like nutmeg or some spice from a foreign land?"
                                                  -- Faber in Fahrenheit 451

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

Reply via email to