diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2019-12-29 18:56:54 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2019-12-29 18:57:13 +0100 |
commit | c270c172dd67e9ab74d13fcf572688bceb3c61d6 (patch) | |
tree | 201cbafaa0888929404bafcdbbde802a5b626113 /src | |
parent | oriented object is fine (diff) | |
download | lowbat-gnu-c270c172dd67e9ab74d13fcf572688bceb3c61d6.tar.gz lowbat-gnu-c270c172dd67e9ab74d13fcf572688bceb3c61d6.tar.bz2 lowbat-gnu-c270c172dd67e9ab74d13fcf572688bceb3c61d6.tar.xz lowbat-gnu-c270c172dd67e9ab74d13fcf572688bceb3c61d6.tar.zst lowbat-gnu-c270c172dd67e9ab74d13fcf572688bceb3c61d6.zip |
espeak bug, searching
Diffstat (limited to 'src')
-rw-r--r-- | src/jo_lowbat.cpp | 13 | ||||
-rw-r--r-- | src/main.cpp | 7 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/jo_lowbat.cpp b/src/jo_lowbat.cpp index b6cc0d6..73a91b3 100644 --- a/src/jo_lowbat.cpp +++ b/src/jo_lowbat.cpp @@ -22,11 +22,11 @@ Lowbat::jo_testNotifySend(void) { cout << "notify-send is not installed. Please install it in order to run lowbat" << endl; return 1; } - cout << "notify-send is installed" + cout << "notify-send is installed" << endl; return 0; } -void +uint8_t Lowbat::jo_testEspeak(void) { if (system("which espeak > /dev/null 2>&1")) { cout << "espeak is not installed. Please install it in order to run --say option" << endl; @@ -47,11 +47,14 @@ Lowbat::jo_fetchBatlvl(void) { int Lowbat::jo_fetchAcstat(void) { - const int ret = system("acpi | grep -q Discharging"); + int ret; + + cout << "Fetching acstat: " + ret = system("acpi | grep -q Discharging"); if (ret != 0) - cout << ret << "acstat: Charging" << endl; + cout << "Charging" << endl; else - cout << "acstat: Discharging" << endl; + cout << "Discharging" << endl; return ret; } diff --git a/src/main.cpp b/src/main.cpp index 56ee872..d9f6874 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,6 @@ #include <jo_lowbat.hpp> #include <iostream> +#include <cstring> #include <cstdint> #include <thread> #include <chrono> @@ -12,10 +13,12 @@ int main(int argc, const char *argv[]) { uint8_t speaks; speaks = 0; - if (lowbat.jo_testAcpi()) + if (lowbat.jo_testAcpi()) { return 1; - if (lowbat.jo_testNotifySend()) + } + if (lowbat.jo_testNotifySend()) { return 2; + } if (argc > 2 && !strcmp(argv[1], "--say")) { if (lowbat.jo_testEspeak()) { lowbat.jo_setMsg(argv[2]); |