mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-02-09 15:38:38 +00:00
loadgraph: convert to callbacks.print
This commit is contained in:
parent
ee40c63542
commit
42b71217e3
@ -466,6 +466,9 @@ void scan_loadgraph_arg(struct text_object *obj, const char *arg)
|
|||||||
|
|
||||||
void print_loadgraph(struct text_object *obj, char *p, int p_max_size)
|
void print_loadgraph(struct text_object *obj, char *p, int p_max_size)
|
||||||
{
|
{
|
||||||
|
if (!p_max_size)
|
||||||
|
return;
|
||||||
|
|
||||||
new_graph(obj, p, p_max_size, info.loadavg[0]);
|
new_graph(obj, p, p_max_size, info.loadavg[0]);
|
||||||
}
|
}
|
||||||
#endif /* X11 */
|
#endif /* X11 */
|
||||||
|
@ -895,9 +895,6 @@ void generate_text_internal(char *p, int p_max_size,
|
|||||||
OBJ(cpugraph) {
|
OBJ(cpugraph) {
|
||||||
new_graph(obj, p, p_max_size, round_to_int(cur->cpu_usage[obj->data.i] * 100));
|
new_graph(obj, p, p_max_size, round_to_int(cur->cpu_usage[obj->data.i] * 100));
|
||||||
}
|
}
|
||||||
OBJ(loadgraph) {
|
|
||||||
print_loadgraph(obj, p, p_max_size);
|
|
||||||
}
|
|
||||||
#endif /* X11 */
|
#endif /* X11 */
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
OBJ(disk_protect) {
|
OBJ(disk_protect) {
|
||||||
|
@ -394,6 +394,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
|||||||
if (buf) free(buf);
|
if (buf) free(buf);
|
||||||
END OBJ(loadgraph, &update_load_average)
|
END OBJ(loadgraph, &update_load_average)
|
||||||
scan_loadgraph_arg(obj, arg);
|
scan_loadgraph_arg(obj, arg);
|
||||||
|
obj->callbacks.print = &print_loadgraph;
|
||||||
#endif /* X11 */
|
#endif /* X11 */
|
||||||
END OBJ(diskio, &update_diskio)
|
END OBJ(diskio, &update_diskio)
|
||||||
parse_diskio_arg(obj, arg);
|
parse_diskio_arg(obj, arg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user