blob: da7c57540e10cd63347bcc4e550adffde8bf140d (
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
/****************************************************************************************/
/* */
/* File : jo_lowbat.c /_________/ */
/* Author : Joe | */
/* Date : 04/2020 | */
/* Info : The main | */
/* / | */
/* \ / */
/* \_____/ */
/* */
/****************************************************************************************/
#include <jo_lowbat.h>
#include <libnotify/notify.h>
/*
** Files prefixes
** --------------
** f: fetch
** n: notify
*/
int
main(
int argc,
const char *argv[]
)
{
int8_t status;
int8_t percent;
(void)argc;
(void)argv;
if ((status = jo_f_status()) == -2) {
return (JO_RET_RD_FAILED);
}
if ((percent = jo_f_percent()) == -3) {
return (JO_RET_RD_FAILED);
}
printf("status: %hhd, %hhd%%\n", status, percent);
/* NOTIFY-SEND */
jo_n_notify("VEGA: Yo", "Welcome", NOTIFY_URGENCY_LOW, 5000);
jo_n_speak("Heya!");
return (JO_RET_FINE);
}
|