This commit mostly duplicates the wlr_log functions, although
with a sway_* prefix. (This is very similar to PR #2009.)
However, the logging function no longer needs to be replaceable,
so sway_log_init's second argument is used to set the exit
callback for sway_abort.
wlr_log_init is still invoked in sway/main.c
This commit makes it easier to remove the wlroots dependency for
the helper programs swaymsg, swaybg, swaybar, and swaynag.
When running swaymsg -v, the version returned is actually the version of
swaymsg itself, yet the message displayed was "sway version <version>".
This can create confusion if users update sway and swaymsg but don't
restart sway, then use swaymsg to check the version.
This patch changes the wording to be "swaymsg version <version>"
instead, and likewise for swaybar.
To get the version of a running sway instance, users should run swaymsg
-t get_version.
This starts up the event loop and wayland display and shims out the
basic top level rendering concepts. Also includes some changes to
incorporate pango into the 1.x codebase properly.
Calling `exit` in sway_terminate prevents sway from correctly shutting
down (freeing data, cleanly terminating the ipc server, etc.).
A better way is to exit straight away if the failure occurs before
`wlc_run` and use sway_abort as usual if it occur when wlc is running.
Makes `ipc_recv_response` return a struct with size, type and payload
rather than just the payload string.
This is useful if the type has to be checked on the client.
This extends the i3bar protocol implementation with the following
features from @Airblade/i3:
* background
* border
* border_top, border_bottom, border_left, border_right
A block will now be rendered like this:
```
(border_left + margin) + width + (margin + border_right) + sep
```
Where `border_left/border_right` and their related margin is only drawn
if the `border` is specified and the border has a width > 0 (default is
1).
`border_top` and `border_bottom` does not affect the height of the bar
(no margin is added), thus it will be drawn behind the text if it is too
big. The user should specify a bar height if more space between
top/bottom borders are required.
This should fix the random json related crashes in swaybar.
The crashes occured because the same socket was used for listening on
workspace events and requesting workspace info, resulting in a
unreliable message queue on the socket.
The solution is to use one socket for the events and one socket for
reliably requesting workspace/output info.
I am not sure if this is a correct issue/fix but on my system at least
after an i3bar protocol is detected this while loop never goes back
around meaning it doesnt process the status line anymore.