mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-02-14 18:06:32 +00:00
merge entropy_bar to callbacks.barval
This commit is contained in:
parent
b78664d8c5
commit
95fbecc385
@ -1375,7 +1375,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
|||||||
obj->callbacks.print = &print_entropy_poolsize;
|
obj->callbacks.print = &print_entropy_poolsize;
|
||||||
END OBJ(entropy_bar, &update_entropy)
|
END OBJ(entropy_bar, &update_entropy)
|
||||||
scan_bar(obj, arg);
|
scan_bar(obj, arg);
|
||||||
obj->callbacks.print = &print_entropy_bar;
|
obj->callbacks.barval = &entropy_barval;
|
||||||
END OBJ_ARG(include, 0, "include needs a argument")
|
END OBJ_ARG(include, 0, "include needs a argument")
|
||||||
struct conftree *leaf = conftree_add(currentconffile, arg);
|
struct conftree *leaf = conftree_add(currentconffile, arg);
|
||||||
if(leaf) {
|
if(leaf) {
|
||||||
|
@ -74,13 +74,9 @@ void print_entropy_poolsize(struct text_object *obj, char *p, int p_max_size)
|
|||||||
snprintf(p, p_max_size, "%u", entropy.poolsize);
|
snprintf(p, p_max_size, "%u", entropy.poolsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_entropy_bar(struct text_object *obj, char *p, int p_max_size)
|
uint8_t entropy_barval(struct text_object *obj)
|
||||||
{
|
{
|
||||||
double ratio;
|
|
||||||
|
|
||||||
(void)obj;
|
(void)obj;
|
||||||
|
|
||||||
ratio = (double) entropy.avail /
|
return round_to_int((double) entropy.avail * 255.0f / (double) entropy.poolsize);
|
||||||
(double) entropy.poolsize;
|
|
||||||
new_bar(obj, p, p_max_size, (int) (ratio * 255.0f));
|
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,6 @@ void update_entropy(void);
|
|||||||
void print_entropy_avail(struct text_object *, char *, int);
|
void print_entropy_avail(struct text_object *, char *, int);
|
||||||
void print_entropy_perc(struct text_object *, char *, int);
|
void print_entropy_perc(struct text_object *, char *, int);
|
||||||
void print_entropy_poolsize(struct text_object *, char *, int);
|
void print_entropy_poolsize(struct text_object *, char *, int);
|
||||||
void print_entropy_bar(struct text_object *, char *, int);
|
uint8_t entropy_barval(struct text_object *);
|
||||||
|
|
||||||
#endif /* _ENTROPY_H */
|
#endif /* _ENTROPY_H */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user