forked from external/yambar
module/battery: remove unused left/right spacing options
This commit is contained in:
parent
0df1df2207
commit
e186c3447d
3 changed files with 3 additions and 10 deletions
8
config.c
8
config.c
|
@ -306,19 +306,13 @@ module_battery_from_config(const struct yml_node *node,
|
||||||
{
|
{
|
||||||
const struct yml_node *c = yml_get_value(node, "content");
|
const struct yml_node *c = yml_get_value(node, "content");
|
||||||
const struct yml_node *poll_interval = yml_get_value(node, "poll_interval");
|
const struct yml_node *poll_interval = yml_get_value(node, "poll_interval");
|
||||||
const struct yml_node *left_spacing = yml_get_value(node, "left_spacing");
|
|
||||||
const struct yml_node *right_spacing = yml_get_value(node, "right_spacing");
|
|
||||||
|
|
||||||
assert(yml_is_dict(c));
|
assert(yml_is_dict(c));
|
||||||
assert(poll_interval == NULL || yml_is_scalar(poll_interval));
|
assert(poll_interval == NULL || yml_is_scalar(poll_interval));
|
||||||
assert(left_spacing == NULL || yml_is_scalar(left_spacing));
|
|
||||||
assert(right_spacing == NULL || yml_is_scalar(right_spacing));
|
|
||||||
|
|
||||||
return module_battery(
|
return module_battery(
|
||||||
"BAT0", particle_from_config(c, parent_font),
|
"BAT0", particle_from_config(c, parent_font),
|
||||||
poll_interval != NULL ? yml_value_as_int(poll_interval) : 30,
|
poll_interval != NULL ? yml_value_as_int(poll_interval) : 30);
|
||||||
left_spacing != NULL ? yml_value_as_int(left_spacing) : 0,
|
|
||||||
right_spacing != NULL ? yml_value_as_int(right_spacing) : 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct bar *
|
struct bar *
|
||||||
|
|
|
@ -255,7 +255,7 @@ run(struct module_run_context *ctx)
|
||||||
|
|
||||||
struct module *
|
struct module *
|
||||||
module_battery(const char *battery, struct particle *label,
|
module_battery(const char *battery, struct particle *label,
|
||||||
int poll_interval_secs, int left_spacing, int right_spacing)
|
int poll_interval_secs)
|
||||||
{
|
{
|
||||||
struct private *m = malloc(sizeof(*m));
|
struct private *m = malloc(sizeof(*m));
|
||||||
m->label = label;
|
m->label = label;
|
||||||
|
|
|
@ -4,5 +4,4 @@
|
||||||
#include "../../particle.h"
|
#include "../../particle.h"
|
||||||
|
|
||||||
struct module *module_battery(
|
struct module *module_battery(
|
||||||
const char *battery, struct particle *label,
|
const char *battery, struct particle *label, int poll_interval_secs);
|
||||||
int poll_interval_secs, int left_spacing, int right_spacing);
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue