DEV Community


Posted on • Updated on

Showing desktop notification in C using libnotify

Let me just start by saying this: it works on my machine.

The relevant piece of code is this.


NotifyNotification *notif;
notif = notify_notification_new(title, message, NULL);

notify_notification_show(notif, NULL);
Enter fullscreen mode Exit fullscreen mode

Taken from here: Working with libnotify.

This is probably the fifth time I've done a version of this thing. Here is an example that uses a list of parameters to show information about a song. I use this to add desktop notification to cmus.

I know almost nothing about C, so if anyone has an idea of how this could be improved let me know.

If you find this article useful and want to support my efforts, buy me a coffee ☕.

buy me a coffee

Top comments (0)