aboutsummaryrefslogtreecommitdiffstats
path: root/src/jo_notify.cpp
blob: b357806cf86b08498ebd2457ae8f72d1c578c0b4 (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
#include <jo_lowbat.hpp>
#include <iostream>

int
jo_notify(const string batlvl) {
	string		str;

	str = "notify-send \"Low battery: ";
	str += batlvl;
	str += "%\" \"Please plug in computer\" -u critical -t 15000";
	cout << "Notifying" << endl;
	return system(str.c_str());
}

int
jo_speak(const string msg) {
	string		str;

	str = "echo \"";
	str += msg;
	str += "\" | espeak";
	cout << "Speaking" << endl;
	return system(str.c_str());
}