Battery: support for ac connection event cmd
This add two new config options "ac_connected_cmd" and "ac_disconnected_cmd". These commands are executed when AC (mains supply) is connected or disconnected.
This commit is contained in:
12
src/config.c
12
src/config.c
@@ -392,6 +392,18 @@ void add_entry (char *key, char *value)
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
battery_low_cmd = strdup (value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp (key, "ac_connected_cmd") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
ac_connected_cmd = strdup (value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp (key, "ac_disconnected_cmd") == 0) {
|
||||
#ifdef ENABLE_BATTERY
|
||||
if (strlen(value) > 0)
|
||||
ac_disconnected_cmd = strdup (value);
|
||||
#endif
|
||||
}
|
||||
else if (strcmp (key, "bat1_font") == 0) {
|
||||
|
||||
Reference in New Issue
Block a user