diff options
author | Joe <bousset.rudy@gmail.com> | 2019-12-03 20:21:09 +0100 |
---|---|---|
committer | Joe <bousset.rudy@gmail.com> | 2019-12-03 20:21:09 +0100 |
commit | 89737ad005f4c066234a5282a1a46eb68b2c1ace (patch) | |
tree | 7b521091227050c84dca220715e20bf1347c39d3 /src/jo_notify.cpp | |
parent | README update (diff) | |
download | lowbat-gnu-89737ad005f4c066234a5282a1a46eb68b2c1ace.tar.gz lowbat-gnu-89737ad005f4c066234a5282a1a46eb68b2c1ace.tar.bz2 lowbat-gnu-89737ad005f4c066234a5282a1a46eb68b2c1ace.tar.xz lowbat-gnu-89737ad005f4c066234a5282a1a46eb68b2c1ace.tar.zst lowbat-gnu-89737ad005f4c066234a5282a1a46eb68b2c1ace.zip |
cpp mode
Diffstat (limited to '')
-rw-r--r-- | src/jo_notify.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/jo_notify.cpp b/src/jo_notify.cpp new file mode 100644 index 0000000..1683871 --- /dev/null +++ b/src/jo_notify.cpp @@ -0,0 +1,26 @@ +#include <jo_lowbat.hpp> + +void +jo_notify(const string batlvl) { + string str = nullptr; + const char *cmd = nullptr; + + str = "notify-send \""; + str += batlvl; + str += "%\" \"Please plug in computer\" -u critical -t 15000"; + + cmd = str.c_str(); + system(cmd); +} + +void +jo_speak(const string msg) { + string str = nullptr; + const char *cmd = nullptr; + + str = "echo \""; + str += msg; + str += "\" | espeak"; + cmd = str.c_str(); + system(cmd); +} |