mirror of
https://github.com/swaywm/sway.git
synced 2026-04-26 06:46:26 -04:00
swaybar: only display the last status line
This commit is contained in:
parent
55016729a5
commit
b99308b026
1 changed files with 5 additions and 0 deletions
|
|
@ -113,6 +113,11 @@ bool status_handle_readable(struct status_line *status) {
|
||||||
|
|
||||||
sway_log(SWAY_DEBUG, "Using text protocol.");
|
sway_log(SWAY_DEBUG, "Using text protocol.");
|
||||||
status->protocol = PROTOCOL_TEXT;
|
status->protocol = PROTOCOL_TEXT;
|
||||||
|
char *last_newline = strrchr(status->buffer, '\n');
|
||||||
|
if (last_newline != NULL) {
|
||||||
|
status->buffer_index = strlen(last_newline + 1);
|
||||||
|
memmove(status->buffer, last_newline + 1, status->buffer_index + 1);
|
||||||
|
}
|
||||||
status->text = status->buffer;
|
status->text = status->buffer;
|
||||||
// intentional fall-through
|
// intentional fall-through
|
||||||
case PROTOCOL_TEXT:
|
case PROTOCOL_TEXT:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue