Sorry, i re-read your post, this should be more what you want :
-- code start
function rgb_to_r_g_b ( clr , alpha )
return ((clr / 0x10000) % 0x100) / 255., ((clr / 0x100) % 0x100) / 255.,
(clr % 0x100) / 255., alpha
end
function msgiw_icon ()
local s = mouse.screen
local color = {}
local c = "0xFF0000"
local d = "0x000000"
if s == 1 then
color = { c , d }
else
color = { d , c }
end
dim = 10
local cs = Cairo.image_surface_create("argb32", dim , dim )
local cr = Cairo.context_create(cs)
cr:set_source_rgba( rgb_to_r_g_b( color[1] , 1 ) )
cr:rectangle(0,0,dim,dim)
cr:fill()
msgiw.image = image.argb32(dim, dim, cs:get_data())
cr:set_source_rgba( rgb_to_r_g_b( color[2] , 1 ) )
cr:rectangle(0,0,dim,dim)
cr:fill()
msgiiw.image = image.argb32(dim, dim, cs:get_data())
end
msgiw = widget({ type = "imagebox" })
msgiiw = widget({ type = "imagebox" })
msgiw_timer = timer ({ timeout = .2 })
msgiw_timer:add_signal("timeout", function () msgiw_icon() end)
msgiw_timer:start()
-- code end
Now you have two widgets to insert : msgiw and msgiiw
Each one is to place on a wibox placed in different screens (am i really
clear ?)
2013/3/31 david cobac <[email protected]>
> Hi, maybe something like this :
>
> -- code start
> function rgb_to_r_g_b ( clr , alpha )
> return ((clr / 0x10000) % 0x100) / 255., ((clr / 0x100) % 0x100) /
> 255., (clr % 0x100) / 255., alpha
> end
> function msgiw_icon ()
> local s = mouse.screen
> if s == 1 then
> color = "0xFF0000"
> else
> color = "0x00FF00"
> end
> dim = 10
> local cs = Cairo.image_surface_create("argb32", dim , dim )
> local cr = Cairo.context_create(cs)
> cr:set_source_rgba( rgb_to_r_g_b( color , 1 ) )
> cr:rectangle(0,0,dim,dim)
> cr:fill()
> msgiw.image = image.argb32(dim, dim, cs:get_data())
> end
> msgiw = widget({ type = "imagebox" })
> msgiw_timer = timer ({ timeout = .2 })
> msgiw_timer:add_signal("timeout", function () msgiw_icon() end)
> msgiw_timer:start()
> -- code end
>
> you can change dim for different effects (should depend on height of the
> wibox, e.g. set dim to 1), then add msgiw as new widget in the right place
> in your wibox.
>
>
> 2013/3/26 Vladimir Todorov <[email protected]>
>
>> Any update on this? Sorry for the spam.
>>
>>
>> On Fri, Mar 15, 2013 at 2:46 PM, Vladimir Todorov
>> <[email protected]>wrote:
>>
>>> Hi all,
>>>
>>> I have a dual monitor setup and I would like to know which monitor is
>>> active in the moment (it depends on the mouse position). Sometimes when I
>>> change tags I expect to change the tags on the left monitor but instead I
>>> change the tags on the second monitor because my mouse is there - and I
>>> don't want to look for the mouse. So my idea is to have a widget (small
>>> box) in the task lists (right after the tag list) and I want it to be red
>>> on the active monitor and black on the inactive one. Do you know how I can
>>> implement this?
>>>
>>> # awesome --version ~
>>> awesome debian/3.4.6-1 (Hooch)
>>> • Build: Jul 14 2010 08:52:10 for x86_64 by gcc version 4.4.4 (@keller)
>>> • D-Bus support: ✔
>>>
>>> Thanks,
>>> Vladimir
>>>
>>
>>
>
>
> --
> Cordialement
> David Cobac
>
--
Cordialement
David Cobac