aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2019-12-04 16:43:57 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2019-12-04 16:43:57 +0100
commit39558ba61c0477f14cec78a255d7f3df86bb45d4 (patch)
tree991009588ed58eb407904f1c78ff6a29a1e50a90
parentRemoved whitespace (diff)
downloadlowbat-gnu-39558ba61c0477f14cec78a255d7f3df86bb45d4.tar.gz
lowbat-gnu-39558ba61c0477f14cec78a255d7f3df86bb45d4.tar.bz2
lowbat-gnu-39558ba61c0477f14cec78a255d7f3df86bb45d4.tar.xz
lowbat-gnu-39558ba61c0477f14cec78a255d7f3df86bb45d4.tar.zst
lowbat-gnu-39558ba61c0477f14cec78a255d7f3df86bb45d4.zip
Now checks if acpi is installed
-rw-r--r--src/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 9fae9e1..1c9c160 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,4 +1,5 @@
#include <jo_lowbat.hpp>
+#include <iostream>
#include <cstring>
#include <thread>
#include <chrono>
@@ -15,6 +16,10 @@ int main(int argc, const char *argv[]) {
string arg_two;
int batlvlint;
+ if (system("acpi > /dev/null 2>&1")) {
+ cout << "acpi is not installed. Please install it in order to run lowbat." << endl;
+ return 1;
+ }
if (argc > 1) {
arg_one = argv[1];
}