battery_log/sources/include/main.h
Sandy Mossgrave 15a20da1aa Quicksaving before I add the -f option.
Added ability to log the battery level continuously.
Added compile-time option #define USE_LIBNOTIFY to post a low-battery warning with libnotify.
2023-06-06 15:05:52 +00:00

27 lines
1.2 KiB
C

/**
* Main.h: contains definitions for battery.c
*/
#define DEFAULT_LOG_INTERVAL 15
#define DEFAULT_LOG_INTERVAL_STRING "15"
#define CHARGE_NOW_PATH "/sys/class/power_supply/BAT0/charge_now"
#define CHARGE_FULL_PATH "/sys/class/power_supply/BAT0/charge_full"
#define VERSION "v0.2"
#define TITLE "Battery Percentage, by Catluck Kettlemerry"
#define PROGNAME "battery"
#define USAGE0 "Usage:"
#define USAGE1 "[OPTION...]"
#define OPTIONS0 "Options:"
#define OPTIONS1 "\t-v run verbosely"
#define OPTIONS2 "\t-h show help and exit"
#define OPTIONS3 "\t-t provide terse output"
#define OPTIONS4 "\t-l Continuously log battery level every " DEFAULT_LOG_INTERVAL_STRING " seconds"
#define OPTIONS5 "\t-i <n> Set log interval to poll every <n> seconds"
#define OPTIONS6 "\t (This argument automatically activates continuous logging)"
#define OPTIONS7 "\t-u (If the interval is less than 15 seconds, " PROGNAME " will refuse to run."
#define OPTIONS8 "\t Specify -u to run anyway.)"
#define OPTIONS9 "\t-w <n> Warn the user if the battery charge drops below <n> percent"
#define OPTIONS10 "\t-p Print the effects of the given options for this invocation"
#define MESGLEN 25