mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-29 05:12:41 +00:00
make short_units a lua setting
This commit is contained in:
parent
aa95dfdd5e
commit
06bf26b757
@ -154,7 +154,7 @@ conky::lua_traits<spacer_state>::Map conky::lua_traits<spacer_state>::map = {
|
|||||||
static conky::simple_config_setting<spacer_state> use_spacer("use_spacer", NO_SPACER, false);
|
static conky::simple_config_setting<spacer_state> use_spacer("use_spacer", NO_SPACER, false);
|
||||||
|
|
||||||
/* variables holding various config settings */
|
/* variables holding various config settings */
|
||||||
int short_units;
|
static conky::simple_config_setting<bool> short_units("short_units", false, true);
|
||||||
int format_human_readable;
|
int format_human_readable;
|
||||||
int top_cpu, top_mem, top_time;
|
int top_cpu, top_mem, top_time;
|
||||||
#ifdef BUILD_IOSTATS
|
#ifdef BUILD_IOSTATS
|
||||||
@ -569,7 +569,7 @@ void human_readable(long long num, char *buf, int size)
|
|||||||
spaced_print(buf, size, "%d", 6, round_to_int(num));
|
spaced_print(buf, size, "%d", 6, round_to_int(num));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (short_units) {
|
if (short_units.get(*state)) {
|
||||||
width = 5;
|
width = 5;
|
||||||
format = "%.*f%.1s";
|
format = "%.*f%.1s";
|
||||||
} else {
|
} else {
|
||||||
@ -2491,7 +2491,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;
|
||||||
short_units = 0;
|
|
||||||
format_human_readable = 1;
|
format_human_readable = 1;
|
||||||
top_mem = 0;
|
top_mem = 0;
|
||||||
top_time = 0;
|
top_time = 0;
|
||||||
@ -3115,9 +3114,6 @@ char load_config_file(const char *f)
|
|||||||
CONF_ERR;
|
CONF_ERR;
|
||||||
}
|
}
|
||||||
#endif /* __linux__ */
|
#endif /* __linux__ */
|
||||||
CONF("short_units") {
|
|
||||||
short_units = string_to_bool(value);
|
|
||||||
}
|
|
||||||
CONF("format_human_readable") {
|
CONF("format_human_readable") {
|
||||||
format_human_readable = string_to_bool(value);
|
format_human_readable = string_to_bool(value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user