how to capture notification in linux

C++
dbus-monitor "interface='org.freedesktop.Notifications', member='Notify'"
Source

Also in C++: