diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2019-12-04 01:38:13 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2019-12-04 01:38:13 +0100 |
commit | a907355703556bb7de838c4f4f71ab09b7bc75c8 (patch) | |
tree | e690bdf3ea3c5a4e7fa678540a7ff6b1069c7e46 /src | |
parent | README update (diff) | |
download | lowbat-gnu-a907355703556bb7de838c4f4f71ab09b7bc75c8.tar.gz lowbat-gnu-a907355703556bb7de838c4f4f71ab09b7bc75c8.tar.bz2 lowbat-gnu-a907355703556bb7de838c4f4f71ab09b7bc75c8.tar.xz lowbat-gnu-a907355703556bb7de838c4f4f71ab09b7bc75c8.tar.zst lowbat-gnu-a907355703556bb7de838c4f4f71ab09b7bc75c8.zip |
Better now
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index 66914ec..46f875c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,13 +15,13 @@ int main(int argc, const char *argv[]) { string arg_two; int batlvlint; - msg = "Beep beep - low battery"; + msg = "beep beep - low battery"; if (argc > 1) { arg_one = argv[1]; if (argc > 2) { arg_two = argv[2]; - if (!memcmp(arg_one.c_str(), "--say", strlen("--say"))) + if (!strcmp(arg_one.c_str(), "--say")) msg = arg_two; } } @@ -33,9 +33,9 @@ int main(int argc, const char *argv[]) { batlvl.erase(remove(batlvl.begin(), batlvl.end(), '\n'), batlvl.end()); batlvlint = stoi(batlvl); if (batlvlint < 90) { - while (!memcmp(acstat.c_str(), "Discharging", strlen("Discharging"))) { + while (!strcmp(acstat.c_str(), "Discharging")) { jo_notify(batlvl); - if (memcmp(arg_one.c_str(), "--silent", strlen("--silent"))) + if (strcmp(arg_one.c_str(), "--silent")) jo_speak(msg); sleep_for(seconds(20)); acstat = jo_exec("acpi | awk '{print $3}' | rev | cut -c 2- | rev"); |