1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

merge execibar to callbacks.barval

This commit is contained in:
Phil Sutter 2009-11-30 23:59:13 +01:00
parent 95fbecc385
commit a5ff5d39d0
3 changed files with 5 additions and 5 deletions

View File

@ -560,7 +560,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
#endif /* X11 */
END OBJ_ARG(execibar, 0, "execibar needs arguments")
scan_execi_arg(obj, arg);
obj->callbacks.print = &print_execibar;
obj->callbacks.barval = &execi_barval;
obj->callbacks.free = &free_execi;
#ifdef X11
END OBJ_ARG(execigraph, 0, "execigraph needs arguments")

View File

@ -414,18 +414,18 @@ uint8_t execbarval(struct text_object *obj)
return round_to_int(read_exec_barnum(obj->data.s) * 2.55);
}
void print_execibar(struct text_object *obj, char *p, int p_max_size)
uint8_t execi_barval(struct text_object *obj)
{
struct execi_data *ed = obj->data.opaque;
if (!ed)
return;
return 0;
if (time_to_update(ed)) {
ed->barnum = read_exec_barnum(ed->cmd) * 2.55;
ed->last_update = current_update_time;
}
new_bar(obj, p, p_max_size, round_to_int(ed->barnum * 2.55));
return round_to_int(ed->barnum * 2.55);
}
void free_exec(struct text_object *obj)

View File

@ -49,7 +49,7 @@ void print_execigraph(struct text_object *, char *, int);
#endif /* X11 */
uint8_t execigaugeval(struct text_object *);
uint8_t execbarval(struct text_object *);
void print_execibar(struct text_object *, char *, int);
uint8_t execi_barval(struct text_object *);
void free_exec(struct text_object *);
void free_execi(struct text_object *);
#endif /* _EXEC_H */