28 #include <libnotify/notify.h>
58 printf(
"Skyld AV, version %s\n", VERSION);
63 int main(
int argc,
char **argv) {
65 NotifyNotification *n;
66 char filename[] =
"/run/skyldav/log";
67 char application[] =
"Skyld AV";
68 char title[] =
"Skyld AV";
74 for (i = 1; i < argc; i++) {
95 printf(
"Skyld AV notifier %s\n", VERSION);
96 printf(
"Exit with CTRL+C\n");
98 file = fopen(filename,
"r");
100 fprintf(stderr,
"File '%s' not found\n", filename);
104 fseek(file, 0, SEEK_END);
108 sigemptyset(&sa.sa_mask);
109 if (sigaction(SIGINT, &sa, NULL) == -1) {
118 gtk_init(&argc, &argv);
121 notify_init(application);
128 msg = fgets(body, 2047, file);
146 n = notify_notification_new(title,
"<Empty message>",
147 "dialog-information");
150 n = notify_notification_new(title, body + 1,
"dialog-error");
153 n = notify_notification_new(title, body + 1,
"dialog-warning");
156 n = notify_notification_new(title, body + 1,
"dialog-information");
159 n = notify_notification_new(title, body + 1,
"dialog-information");
163 notify_notification_set_timeout(n, 9000);
166 notify_notification_set_urgency(n, NOTIFY_URGENCY_CRITICAL);
169 GError *error = NULL;
170 notify_notification_show(n, &error);
172 ca_context_create(&c);
173 ca_context_play(c, 0,
174 CA_PROP_EVENT_ID,
"dialog-warning",
175 CA_PROP_EVENT_DESCRIPTION, title,
static void version()
Shows version information and exits.
const char * VERSION_TEXT
volatile sig_atomic_t status
static void sigint_handler(int sig)
int main(int argc, char **argv)
static void help()
Prints help message and exits.