I'm writing a window manager that is similar to AwesomeWM in that it will be configurable with lua, will have a UI system to awesome's wibox, but with some additional niceties like built-in animation support, among other things.
I know AwesomeWM uses client properties like "client.titlebar_top" to implement titlebars, but what I would like to do is allow users to do two things:
- have titlebars on windows
- be able to arbitrarily embed clients inside of a "layout" (my window manager's equivalent of awesome's wibox)
Upon seeing this, my thought was that this could be simplified: if you can embed a client inside a wibox in an arbitrary way, you could create a titlebar by just automatically embedding a client in a wibox whenever it gets managed by the WM:
clients = {}
root.connect_signal("managed", function(client) {
table.insert(clients, wibox({
x = 20, y = 20, width = 200, height = 200,
layout = wibox.layout.vertical,
{}, -- titlebar would be here
client
}))
})
(forgive me if the syntax is not exactly correct, it's been a long time since I used awesome's wibox syntax.)
But if this feature existed, a user would also be able to, for example, implement a widget that would show a horizontal list of all the currently active clients. For example, the way Windows 7 had it where you would hover over the icon of a client, and it would show you a smaller preview of the contents of that client.
My question is: would it be possible to arbitrarily embed a client like this in a wibox window by using the xembed extension?
Also, by "arbitrarily embedded" I mean that you would be able to treat the embedded client as just another "element" that is part of that wibox layout. Meaning you can have multiple embedded windows in a wibox, and the embedded client window could be occluded by other elements drawn by cairo, it could be shaped arbitrarily, it can be rotated, scaled, translated, and become transparent.
Essentially, I would like to be able to treat the embedded client as if I was drawing an image with cairo.