From 9a40cbbed68b83941391cbb580af7793ca18a7a2 Mon Sep 17 00:00:00 2001 From: Sidharth Rao Date: Sun, 25 Feb 2024 14:21:25 -0500 Subject: [PATCH] Made battery interact better with other layers. --- render.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/render.c b/render.c index 49bab0a1..5cd65f95 100644 --- a/render.c +++ b/render.c @@ -55,14 +55,14 @@ static void subtext(struct swaylock_surface *surface, char **tstr, char **dstr, struct tm *tm = localtime(&t); // Write time - if (surface->state->args.timestr[0]) { + if (surface->state->args.clock && surface->state->args.timestr[0]) { strftime(tbuf, sizeof(tbuf), surface->state->args.timestr, tm); *tstr = tbuf; } else { *tstr = NULL; } - if (surface->state->args.datestr[0]) { + if (surface->state->args.clock && surface->state->args.datestr[0]) { // Create a temporary buffer to hold the modified date string char tempbuf[256]; @@ -336,9 +336,11 @@ void render_frame(struct swaylock_surface *surface) { if (text_l1 && !text_l2 && !text_l3) { text = text_l1; - if (text_l2 && !text_l1 && !text_l3) + } + if (text_l2 && !text_l1 && !text_l3) { text = text_l2; - if (text_l3 && !text_l1 && !text_l2) + } + if (text_l3 && !text_l1 && !text_l2) { text = text_l3; }