diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-17 16:32:09 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-17 16:32:09 +0200 |
commit | 4a41fd428bfd4ed95446e6f24bbd6ec60d87bf50 (patch) | |
tree | c7c5a4ba58b7463659f6660fa56b76fc72fd57a6 /src/jo_lowbat.c | |
parent | espeak tests (diff) | |
download | lowbat-bsd-4a41fd428bfd4ed95446e6f24bbd6ec60d87bf50.tar.gz lowbat-bsd-4a41fd428bfd4ed95446e6f24bbd6ec60d87bf50.tar.bz2 lowbat-bsd-4a41fd428bfd4ed95446e6f24bbd6ec60d87bf50.tar.xz lowbat-bsd-4a41fd428bfd4ed95446e6f24bbd6ec60d87bf50.tar.zst lowbat-bsd-4a41fd428bfd4ed95446e6f24bbd6ec60d87bf50.zip |
Using libespeak and libnotify
Diffstat (limited to 'src/jo_lowbat.c')
-rw-r--r-- | src/jo_lowbat.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/jo_lowbat.c b/src/jo_lowbat.c new file mode 100644 index 0000000..da7c575 --- /dev/null +++ b/src/jo_lowbat.c @@ -0,0 +1,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); +} |