Search code examples
widgetawesome-wm

place a wibox on a client's content


I want to change/cover a client's content (in relation with a signal) : I just make a widget/wibox appear with the correct size and position.

So I put this in my manage signal :

local w = wibox({
        x = c.x,
        y = c.y,
        width = c.width,
        height = c.height,
        visible = false,
        ontop = true,
        widget = my_widget(c)
})
c.mawibox = w

As I unfocus the client, I toggle visibility : c.mawibox.visible = true but when I leave current tag, the wibox is still appearing : how to attach visibility only for the client's window?

Is there another way to produce this effect? is it possible to add a Cairo surface on top of the client's content?


Solution

  • but when I leave current tag, the wibox is still appearing : how to attach visibility only for the client's window?

    I would use tag.connect_signal("property::selected", function() [update your wibox here] end). You can check with c:isvisible() whether your client is, well, visible. If you also want to handle sticky clients (visible on all tags), you also need to handle the signal for "a client's sticky property changed".