From 86f4eeac510753024dd94b69988bed700446ef37 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 4 Dec 2019 00:23:45 +0100 Subject: Better now --- src/jo_notify.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/jo_notify.cpp') diff --git a/src/jo_notify.cpp b/src/jo_notify.cpp index bd14db0..154b0b7 100644 --- a/src/jo_notify.cpp +++ b/src/jo_notify.cpp @@ -2,25 +2,21 @@ int jo_notify(const string batlvl) { - string str = nullptr; - const char *cmd = nullptr; + string str; str = "notify-send \""; str += batlvl; str += "%\" \"Please plug in computer\" -u critical -t 15000"; - cmd = str.c_str(); - return system(cmd); + return system(str.c_str()); } int jo_speak(const string msg) { - string str = nullptr; - const char *cmd = nullptr; + string str; str = "echo \""; str += msg; str += "\" | espeak"; - cmd = str.c_str(); - return system(cmd); + return system(str.c_str()); } -- cgit v1.2.3