A bullet-proof method to see all notifications, full notification messages
(The method provides access to all, full notification messages.
A finer grained handling of them is possible).
The "basic" command dbus-monitor "interface='org.freedesktop.Notifications'"
will show info on every notification.
For instance, if in terminal #1 I execute that command, and in terminal #2 I execute notify-send -u normal 'testing'
, I get in terminal #1
method call time=1650533140.066199 sender=:1.357 -> destination=:1.69 serial=6 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=GetServerInformation
method call time=1650533140.067533 sender=:1.69 -> destination=:1.49 serial=305 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=GetServerInformation
method call time=1650533140.122757 sender=:1.357 -> destination=:1.69 serial=7 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
string "notify-send"
uint32 0
string ""
string "testing"
string ""
array [
]
array [
dict entry(
string "urgency"
variant byte 1
)
]
int32 -1
method call time=1650533140.131442 sender=:1.69 -> destination=:1.49 serial=310 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
string "notify-send"
uint32 0
string ""
string "testing"
string ""
array [
]
array [
dict entry(
string "urgency"
variant byte 1
)
dict entry(
string "sender-pid"
variant uint32 87009
)
]
int32 -1
From this point on, you could handle that information as you like.
For instance, you could:
- Send that info to a log file (surely needed). Note: This is enough to view the full messages, as requested in the OP
grep
/awk
/sed
, etc. the output
- Place your command in your
.bashrc
, .profile
, etc.
- Postprocess the timestamp.
- Automate maintenance of the log file (cleaning old notifications, etc.)
I don't know if there is anything already available as a starting point.
A few pointers I found are:
- How to read dbus-monitor output?. General info and python code to handle notifications. Also a link to indicator-notifications (recent-notifications).
- Parsing dbus monitor output messages
- https://github.com/tstack/lnav/issues/505
~/.local/share/gnome-shell/notifications
? Someone mentioned that today in the Matrix chat GNOME channel. For me that file has some of my notifications, maybe only (evolution) calendar event reminders.