-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathoptions.h
63 lines (49 loc) · 1.23 KB
/
options.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Copyright (c) 2018-2024 Corey Hinshaw
*/
#ifndef OPTIONS_H
#define OPTIONS_H
#include <stdbool.h>
#include <stddef.h>
typedef struct Config {
/* program operation options */
bool daemonize;
bool run_once;
bool battery_required;
bool show_notifications;
bool show_charging_msg;
bool help;
bool version;
/* Battery configuration */
char **battery_names;
int battery_count;
/* check frequency multiplier (seconds) */
int multiplier;
bool fixed;
/* battery warning levels */
int warning;
int critical;
int danger;
int full;
/* messages for battery levels */
char *warningmsg;
char *criticalmsg;
char *fullmsg;
char *chargingmsg;
char *dischargingmsg;
/* run this system command if battery reaches danger level */
char *dangercmd;
/* run this system command to display a message */
char *msgcmd;
/* app name for notification */
char *appname;
/* specify the icon used in notifications */
char *icon;
/* specify when the notification should expire */
int notification_expires;
} Config;
char* find_config_file();
char** read_config_file(char *path, int *argc, char *argv0);
void parse_args(int argc, char *argv[], Config *config);
void validate_options(Config *config);
#endif