aboutsummaryrefslogtreecommitdiffstats
path: root/src/jo_notify.cpp
blob: 16838710613d4175ab8a354511fc561da1877936 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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);
}