Introduce new module implementing the status notifier
spec (https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/). The
core dbus logic and spec implementation is from
swaybar (https://github.com/swaywm/sway/tree/master/swaybar/tray), with
rendering stripped out and a switch to tllist. The dbus loop is async and not
re-entrant so the module lock is taken each time we process a message (and when
we process content). To reduce memory usage the icon pixmaps are immutable and
reference counted. So they can be passed between the module and the
particles (through tags) without copying.
Work to be done in future diffs:
1. Tray interactivity/menu support
2. Support KDE search paths for the tray. Can it be implemented with yml
scripting?
Introduce a new icon particle. It follows the icon
spec (https://specifications.freedesktop.org/icon-theme-spec/latest/index.html).
Rendering logic is taken from fuzzel (using nanosvg + libpng), while loading
logic is taken from sway. Standard usage is with `use-tag = false` which expands
the provided string template and then loads the string as the icon name. There
are settings to manually override the base paths, themes, etc. The second usage
which is required for tray support is a special icon tag that transfers raw
pixmaps. With `use-tag = true` it first expands the string, and then uses that
output to find an icon pixmap tag. To reduce memory usage, themes are reference
counted so they can be passed down the configuration stack without having to
load them in multiple times.
For programmability, a fallback particle can be specified if no icon/tag is
found `fallback: ...`. And the new icon pixmap tag can be existence checked in
map conditions using `+{tag_name}`.
Future work to be done in follow up diffs:
1. Icon caching. Currently performs an icon lookup on each instantiation & a
render on each refresh.
2. Theme caching. Changing theme directories results in a new "theme collection"
being created resulting in the possibility of duplicated theme loading.
sway moves the workspace to fallback_output when there is no output. For example: when all the screens are off. This commit adds an ignore for the fallback output.
If the amount of data coming in is more than we can hold in our
buffer, we resized the buffer by doubling its size. However, there
were two(!) issues here:
* If this was the first resize, the buffer size was set to 1024. This
may not be enough (i.e. there may be more than 1024 bytes to process).
* In all other cases, the buffer size was doubled. However, there is
still no guarantee the buffer is large enough.
Fix by looping until the buffer *is* large enough.
This ensures the bar's size (width) is updated when the screen
resolution (and/or scale) is changed.
Note that we already handled scale changes. This logic has been moved
from output_scale() to output_done().
Closes#330