disinclined.org
/
git
/
irssi-notify.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ce0a286
)
use libnotify for notifications
author
Dylan Lloyd
<dylan@dylansserver.com>
Tue, 12 Feb 2013 00:09:11 +0000
(19:09 -0500)
committer
Dylan Lloyd
<dylan@dylansserver.com>
Tue, 12 Feb 2013 00:09:11 +0000
(19:09 -0500)
Makefile
patch
|
blob
|
history
listen.c
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index
25921a5
..
2b45404
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-1,9
+1,9
@@
-all:
server client
+all:
irssi-listen irssi-notify
-
server
:
+
irssi-notify
:
gcc notify.c -o irssi-notify
gcc notify.c -o irssi-notify
-
client
:
- gcc
listen.c -o irssi-listen
+
irssi-listen
:
+ gcc
-o irssi-listen `pkg-config --cflags --libs libnotify` listen.c
clean:
rm irssi-notify irssi-listen
clean:
rm irssi-notify irssi-listen
diff --git
a/listen.c
b/listen.c
index
527d737
..
4c8eef7
100644
(file)
--- a/
listen.c
+++ b/
listen.c
@@
-10,6
+10,7
@@
#include <arpa/inet.h>
#include <sys/wait.h>
#include <signal.h>
#include <arpa/inet.h>
#include <sys/wait.h>
#include <signal.h>
+#include <libnotify/notify.h>
#define PORT "3490" // the port users will be connecting to
#define PORT "3490" // the port users will be connecting to
@@
-124,13
+125,10
@@
int main(void)
}
buf[4096] = '\0';
printf("irssi-notify: recieved '%s'\n", buf);
}
buf[4096] = '\0';
printf("irssi-notify: recieved '%s'\n", buf);
- if (!fork()){
- setenv("DISPLAY", ":0", 1); // doesn't seem to be doing the trick
- execlp("notify-display",
- "notify-display", buf, NULL);
- // the first argument to execl is the command, the second is the first argument
- // passed to the program ($0), customarily the evocation of the command
- }
+ notify_init("irssi-notify");
+ NotifyNotification * notification =
+ notify_notification_new("", buf, "irssi-notify");
+ notify_notification_show(notification, NULL);
close(activefd);
exit(0);
}
close(activefd);
exit(0);
}