Using AwesomeWM widgets on wayland1 proof of concept
- A AwesomeWM
drawablemaps to a wayland surfacewl_surfaceas it is just a surface on which one can draw but without any specific role or context in which the surface will occur. In AwesomeWM adrawablecan occur as adrawinor as part of a titlebar. That's similar to how wayland assignes meaning to a surface through shells. It's also in both cases the object that handles input. - A AwesomeWM
drawinmaps to a wayland layershell surfacezwlr_layer_surface_v1as a drawin essentially wraps a drawable and giving it a purpose as a "desktop shell widget". The two relationshipsdrawabletodrawinandwl_surfacetozwlr_layer_surface_v1are very analogous.
- In
core/there are the currently two replacements for wayland. - In
shims/there are all other objects as hollow replacments which means they don't actually do anything but only exist to keep the Awesome libraries running. They are mostly taken from the test suit in AwesomeWM. aww.luais the entry point to the program.con.luais the singleton that contains the wayland connection and holds the different wayland globals.helpers.sois a small C-library to create the necessary shared memory buffer.
- AwesomeWM always defines a position by a total x and y value. That makes sense in the context of Xorg but it would be very hacky to support that on wayland.
- As long as there is no custom titlebar protocol in the wayland/wlroots ecosystem, it's impossible to supplement that aspect of AwesomeWM.
- With the foreign toplevel protocol we get some ability to move a window from a third party app but it really isn't meant to be a window management protocol. Apart from the technical constraint here, I personally only really care about the widgets anyway.
Make sure to have all dependencies in place:
- The
helpers.souses lua 5.3 by default so it would be easiest to go with that lua version, otherwise change the Makefile inhelpers/. - wau is needed. You should be able to install it from the luarocks (see below).
- AwesomeWMs lua library and lgi are needed. The AwesomeWM library is expected to reside in
/usr/share/awesome/lib/otherwise change the path inaww.lua.
# install wau
sudo luarocks install --server=https://luarocks.org/dev wau --lua-version 5.3
# clone the repo
git clone https://github.com/Nooo37/aww
cd aww
# this will create the needed helpers.so
make -C helpers
# make sure to be in a wayland compositor and run the example
lua5.3 aww.lua example.luaIn example.lua I constructed a minimal example that works for both:
lua aww.lua example.luaif you are in a wayland1 compositorcat example.lua | awesome-client"if you are using AwesomeWM (hard to get rid of again, just restart if you don't know what to do)