aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2019-12-30 11:31:17 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2019-12-30 11:31:17 +0100
commit08c053b71746337fcb8321433c97924cbcaa03a5 (patch)
tree5971608ef458fa06f7e9295da33b8a9361445df6
parentMan update (diff)
downloadlowbat-gnu-08c053b71746337fcb8321433c97924cbcaa03a5.tar.gz
lowbat-gnu-08c053b71746337fcb8321433c97924cbcaa03a5.tar.bz2
lowbat-gnu-08c053b71746337fcb8321433c97924cbcaa03a5.tar.xz
lowbat-gnu-08c053b71746337fcb8321433c97924cbcaa03a5.tar.zst
lowbat-gnu-08c053b71746337fcb8321433c97924cbcaa03a5.zip
Now uses error output for errors
Diffstat (limited to '')
-rw-r--r--src/jo_lowbat.cpp6
-rw-r--r--src/main.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/jo_lowbat.cpp b/src/jo_lowbat.cpp
index 73899a7..26e3713 100644
--- a/src/jo_lowbat.cpp
+++ b/src/jo_lowbat.cpp
@@ -9,7 +9,7 @@ using namespace std;
uint8_t
Lowbat::jo_testAcpi(void) {
if (system("which acpi > /dev/null 2>&1")) {
- cout << "acpi is not installed. Please install it in order to run lowbat" << endl;
+ cerr << "acpi is not installed. Please install it in order to run lowbat" << endl;
return 1;
}
cout << "acpi is installed" << endl;
@@ -19,7 +19,7 @@ Lowbat::jo_testAcpi(void) {
uint8_t
Lowbat::jo_testNotifySend(void) {
if (system("which notify-send > /dev/null 2>&1")) {
- cout << "notify-send is not installed. Please install it in order to run lowbat" << endl;
+ cerr << "notify-send is not installed. Please install it in order to run lowbat" << endl;
return 1;
}
cout << "notify-send is installed" << endl;
@@ -29,7 +29,7 @@ Lowbat::jo_testNotifySend(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;
+ cerr << "espeak is not installed. Please install it in order to run --say option" << endl;
return 1;
}
cout << "espeak is installed" << endl;
diff --git a/src/main.cpp b/src/main.cpp
index e66abf3..54f8a0f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -28,11 +28,11 @@ int main(int argc, const char *argv[]) {
while (true) {
while (lowbat.jo_fetchBatlvl() < 15 && !lowbat.jo_fetchAcstat()) {
if (lowbat.jo_notify()) {
- cout << "Error: could not use notify-send" << endl;
+ cerr << "Error: could not use notify-send" << endl;
return 3;
}
if (speaks && lowbat.jo_speak()) {
- cout << "Error: could not use espeak" << endl;
+ cerr << "Error: could not use espeak" << endl;
}
cout << "Sleep for 20s" << endl;
sleep_for(seconds(20));