Render i3bar blocks

This commit is contained in:
Drew DeVault 2018-03-31 14:39:18 -04:00
parent ee85c91831
commit 333dbcbe72
7 changed files with 314 additions and 34 deletions

View file

@ -17,13 +17,13 @@ void status_error(struct status_line *status, const char *text) {
status->text = text;
}
bool handle_status_readable(struct status_line *status) {
bool status_handle_readable(struct status_line *status) {
char *line;
switch (status->protocol) {
case PROTOCOL_ERROR:
return false;
case PROTOCOL_I3BAR:
if (i3bar_readable(status) > 0) {
if (i3bar_handle_readable(status) > 0) {
return true;
}
break;
@ -66,6 +66,7 @@ bool handle_status_readable(struct status_line *status) {
status->protocol = PROTOCOL_I3BAR;
free(status->text_state.buffer);
wl_list_init(&status->blocks);
status->i3bar_state.buffer_size = 4096;
status->i3bar_state.buffer =
malloc(status->i3bar_state.buffer_size);