mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-15 17:47:09 +00:00
merge apcupsd_loadbar to callbacks.barval
This commit is contained in:
parent
4988947829
commit
cba2460397
@ -259,15 +259,11 @@ void print_apcupsd_loadgauge(struct text_object *obj, char *p, int p_max_size)
|
||||
new_gauge(obj, p, p_max_size, (int)progress);
|
||||
}
|
||||
|
||||
void print_apcupsd_loadbar(struct text_object *obj, char *p, int p_max_size)
|
||||
uint8_t apcupsd_loadbarval(struct text_object *obj)
|
||||
{
|
||||
double progress;
|
||||
(void)obj;
|
||||
|
||||
if (!p_max_size)
|
||||
return;
|
||||
|
||||
progress = atof(info.apcupsd.items[APCUPSD_LOAD]) / 100.0 * 255.0;
|
||||
new_bar(obj, p, p_max_size, (int) progress);
|
||||
return round_to_int(atof(info.apcupsd.items[APCUPSD_LOAD]) * 2.55);
|
||||
}
|
||||
|
||||
#define APCUPSD_PRINT_GENERATOR(name, idx) \
|
||||
|
@ -54,7 +54,7 @@ void update_apcupsd(void);
|
||||
void print_apcupsd_nop(struct text_object *, char *, int);
|
||||
void print_apcupsd_loadgraph(struct text_object *, char *, int);
|
||||
void print_apcupsd_loadgauge(struct text_object *, char *, int);
|
||||
void print_apcupsd_loadbar(struct text_object *, char *, int);
|
||||
uint8_t apcupsd_loadbarval(struct text_object *);
|
||||
|
||||
void print_apcupsd_name(struct text_object *, char *, int);
|
||||
void print_apcupsd_model(struct text_object *, char *, int);
|
||||
|
@ -1444,7 +1444,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
||||
obj->callbacks.print = &print_apcupsd_load;
|
||||
END OBJ(apcupsd_loadbar, &update_apcupsd)
|
||||
scan_bar(obj, arg);
|
||||
obj->callbacks.print = &print_apcupsd_loadbar;
|
||||
obj->callbacks.barval = &apcupsd_loadbarval;
|
||||
#ifdef X11
|
||||
END OBJ(apcupsd_loadgraph, &update_apcupsd)
|
||||
char* buf = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user