mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-25 04:06:03 +00:00
convert nodename to callbacks.print
This commit is contained in:
parent
d9e2f687b6
commit
e9dde6293b
@ -541,3 +541,9 @@ void print_machine(struct text_object *obj, char *p, int p_max_size)
|
||||
(void)obj;
|
||||
snprintf(p, p_max_size, "%s", info.uname_s.machine);
|
||||
}
|
||||
|
||||
void print_nodename(struct text_object *obj, char *p, int p_max_size)
|
||||
{
|
||||
(void)obj;
|
||||
snprintf(p, p_max_size, "%s", info.uname_s.nodename);
|
||||
}
|
||||
|
@ -88,5 +88,6 @@ uint8_t swap_barval(struct text_object *);
|
||||
|
||||
void print_kernel(struct text_object *, char *, int);
|
||||
void print_machine(struct text_object *, char *, int);
|
||||
void print_nodename(struct text_object *, char *, int);
|
||||
|
||||
#endif /* _COMMON_H */
|
||||
|
@ -956,9 +956,6 @@ void generate_text_internal(char *p, int p_max_size,
|
||||
DO_JUMP;
|
||||
}
|
||||
}
|
||||
OBJ(nodename) {
|
||||
snprintf(p, p_max_size, "%s", cur->uname_s.nodename);
|
||||
}
|
||||
OBJ(pid_chroot) {
|
||||
char buf[max_user_text];
|
||||
|
||||
|
@ -828,6 +828,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
||||
extract_variable_text_internal(obj->sub, arg);
|
||||
obj->callbacks.print = &print_format_time;
|
||||
END OBJ(nodename, 0)
|
||||
obj->callbacks.print = &print_nodename;
|
||||
END OBJ_ARG(cmdline_to_pid, 0, "cmdline_to_pid needs a command line as argument")
|
||||
scan_cmdline_to_pid_arg(obj, arg, free_at_crash);
|
||||
END OBJ_ARG(pid_chroot, 0, "pid_chroot needs a pid as argument")
|
||||
|
Loading…
Reference in New Issue
Block a user