aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2019-12-04 17:51:40 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2019-12-04 17:51:40 +0100
commit19d2ec51fba82d6edc21693b3f0e12f7618b8289 (patch)
tree8782781a6c6ed53b347db58568d57a38d12d42d8
parentMore optimization (diff)
downloadlowbat-gnu-19d2ec51fba82d6edc21693b3f0e12f7618b8289.tar.gz
lowbat-gnu-19d2ec51fba82d6edc21693b3f0e12f7618b8289.tar.bz2
lowbat-gnu-19d2ec51fba82d6edc21693b3f0e12f7618b8289.tar.xz
lowbat-gnu-19d2ec51fba82d6edc21693b3f0e12f7618b8289.tar.zst
lowbat-gnu-19d2ec51fba82d6edc21693b3f0e12f7618b8289.zip
Debuged
-rw-r--r--src/main.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 36fe1b0..6a220f8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -24,9 +24,14 @@ int main(int argc, const char *argv[]) {
batlvl.erase(remove(batlvl.begin(), batlvl.end(), '\n'), batlvl.end());
batlvlint = stoi(batlvl);
cout << batlvlint << "%" << endl;
- while (batlvlint < 25 && !system("acpi | grep -q Discharging")) {
+ while (batlvlint < 60 && !system("acpi | grep -q Discharging")) {
jo_notify(batlvl);
- if (argc > 1 && strcmp(argv[1], "--silent")) {
+ if (argc == 1) {
+ msg = new string("beep beep - low battery");
+ jo_speak(*msg);
+ delete msg;
+ }
+ else if (argc > 1 && strcmp(argv[1], "--silent")) {
if (argc > 2 && !strcmp(argv[1], "--say")) {
msg = new string(argv[2]);
}