diff --git a/src/config.c b/src/config.c index fbf6851..3756b94 100644 --- a/src/config.c +++ b/src/config.c @@ -161,9 +161,9 @@ void config_load(const char *cfg_path) {"animation", &config.animation, config_handle_u8}, {"asterisk", &config.asterisk, config_handle_char}, {"bg", &config.bg, config_handle_u8}, + {"bigclock", &config.bigclock, config_handle_bool}, {"blank_box", &config.blank_box, config_handle_bool}, {"blank_password", &config.blank_password, config_handle_bool}, - {"clock", &config.clock, config_handle_bool}, {"console_dev", &config.console_dev, config_handle_str}, {"default_input", &config.default_input, config_handle_u8}, {"fg", &config.fg, config_handle_u8}, @@ -270,6 +270,7 @@ void config_defaults() config.animation = 0; config.asterisk = '*'; config.bg = 0; + config.bigclock = false; config.blank_box = true; config.blank_password = false; config.console_dev = strdup("/dev/console"); diff --git a/src/config.h b/src/config.h index 5a4ed27..c3182b7 100644 --- a/src/config.h +++ b/src/config.h @@ -65,9 +65,9 @@ struct config uint8_t animation; char asterisk; uint8_t bg; + bool bigclock; bool blank_box; bool blank_password; - bool clock; char* console_dev; uint8_t default_input; uint8_t fg; diff --git a/src/draw.c b/src/draw.c index b01fd35..025cb57 100644 --- a/src/draw.c +++ b/src/draw.c @@ -179,7 +179,7 @@ void draw_box(struct term_buf* buf) } } -char* get_clock_string() +char* bigclock_str() { time_t timer; char* buffer = malloc(6); @@ -231,15 +231,15 @@ void alpha_blit(struct tb_cell* buf, uint16_t x, uint16_t y, uint16_t w, uint16_ } } -void draw_clock(struct term_buf* buf) +void draw_bigclock(struct term_buf* buf) { - if (!config.clock) + if (!config.bigclock) return; int xo = buf->box_x + buf->box_width / 2 - (5 * (CLOCK_W + 1)) / 2; int yo = buf->box_y - CLOCK_H - 2; - char* clockstr = get_clock_string(); + char* clockstr = bigclock_str(); struct tb_cell* clockcell; for (int i = 0; i < 5; i++) diff --git a/src/draw.h b/src/draw.h index 28a6477..2d5ef55 100644 --- a/src/draw.h +++ b/src/draw.h @@ -86,6 +86,6 @@ void animate_init(struct term_buf* buf); void animate(struct term_buf* buf); bool cascade(struct term_buf* buf, uint8_t* fails); -void draw_clock(struct term_buf *buf); +void draw_bigclock(struct term_buf *buf); #endif diff --git a/src/main.c b/src/main.c index 8e5f332..921d37f 100644 --- a/src/main.c +++ b/src/main.c @@ -188,7 +188,7 @@ int main(int argc, char** argv) (*input_handles[active_input])(input_structs[active_input], NULL); tb_clear(); animate(&buf); - draw_clock(&buf); + draw_bigclock(&buf); draw_box(&buf); draw_labels(&buf); if(!config.hide_f1_commands) @@ -211,7 +211,7 @@ int main(int argc, char** argv) if (config.animate) { error = tb_peek_event(&event, config.min_refresh_delta); - } else if (config.clock) { + } else if (config.bigclock) { struct timeval tv; gettimeofday(&tv, NULL); error = tb_peek_event(&event, (60 - tv.tv_sec % 60) * 1000 - tv.tv_usec / 1000);