/
notify.h
38 lines (28 loc) · 860 Bytes
/
notify.h
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
#include <dbus/dbus.h>
// default message delay in seconds
#define EXPIRE_DEFAULT 10
// multiply requested delay by this
// (slow it down since only one line)
#define EXPIRE_MULT 2
// default command
#define DEFAULT_CMD "xcowsay <[summary]> [body]"
// config dir
#define CFG_DIR "cow-notify"
// config file
#define CFG_FIL "config"
typedef struct _notification {
dbus_uint32_t nid;
time_t started_at;
time_t expires_after;
char closed;
char appname[20];
char summary[64];
char body[256];
struct _notification *next;
} notification;
// initialize notifications
char notify_init(char debug_enabled);
// returns the first current notification into status (number of total messages in n)
notification *notify_get_message(int *n);
// check the dbus for notifications (1=something happened, 0=nothing)
char notify_check();