mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-28 13:00:45 +00:00
make format_human_readable a lua setting
This commit is contained in:
parent
06bf26b757
commit
9d8e89a119
@ -155,7 +155,8 @@ static conky::simple_config_setting<spacer_state> use_spacer("use_spacer", NO_SP
|
|||||||
|
|
||||||
/* variables holding various config settings */
|
/* variables holding various config settings */
|
||||||
static conky::simple_config_setting<bool> short_units("short_units", false, true);
|
static conky::simple_config_setting<bool> short_units("short_units", false, true);
|
||||||
int format_human_readable;
|
static conky::simple_config_setting<bool> format_human_readable("format_human_readable",
|
||||||
|
true, true);
|
||||||
int top_cpu, top_mem, top_time;
|
int top_cpu, top_mem, top_time;
|
||||||
#ifdef BUILD_IOSTATS
|
#ifdef BUILD_IOSTATS
|
||||||
int top_io;
|
int top_io;
|
||||||
@ -565,7 +566,7 @@ void human_readable(long long num, char *buf, int size)
|
|||||||
const char *format;
|
const char *format;
|
||||||
|
|
||||||
/* Possibly just output as usual, for example for stdout usage */
|
/* Possibly just output as usual, for example for stdout usage */
|
||||||
if (!format_human_readable) {
|
if (not format_human_readable.get(*state)) {
|
||||||
spaced_print(buf, size, "%d", 6, round_to_int(num));
|
spaced_print(buf, size, "%d", 6, round_to_int(num));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2491,7 +2492,6 @@ static void set_default_configurations(void)
|
|||||||
info.diskio_avg_samples = 2;
|
info.diskio_avg_samples = 2;
|
||||||
info.memmax = 0;
|
info.memmax = 0;
|
||||||
top_cpu = 0;
|
top_cpu = 0;
|
||||||
format_human_readable = 1;
|
|
||||||
top_mem = 0;
|
top_mem = 0;
|
||||||
top_time = 0;
|
top_time = 0;
|
||||||
#ifdef BUILD_IOSTATS
|
#ifdef BUILD_IOSTATS
|
||||||
@ -3114,9 +3114,6 @@ char load_config_file(const char *f)
|
|||||||
CONF_ERR;
|
CONF_ERR;
|
||||||
}
|
}
|
||||||
#endif /* __linux__ */
|
#endif /* __linux__ */
|
||||||
CONF("format_human_readable") {
|
|
||||||
format_human_readable = string_to_bool(value);
|
|
||||||
}
|
|
||||||
#ifdef HDDTEMP
|
#ifdef HDDTEMP
|
||||||
CONF("hddtemp_host") {
|
CONF("hddtemp_host") {
|
||||||
set_hddtemp_host(value);
|
set_hddtemp_host(value);
|
||||||
|
Loading…
Reference in New Issue
Block a user