The comment linked here, Is there a way to view notification history?, asked:
Can this be done without adding another PPA?
Yes
Open two terminal windows (Ctrl+Alt+T+T). The extra window is needed only for test purposes.
Monitor notifications in one of the terminal windows with:
dbus-monitor "interface='org.freedesktop.Notifications'" | \
grep --line-buffered "member=Notify\|string"
(to stop it, close the window or type Ctrl+C)
Note that running this script only shows those notifications occurring from the time it is started and must be run prior to the processes and aps. for which the history is desired. If the terminal window has an insufficient scrollback size either change the scrollback lines in Edit > Profile Preferences > Scrolling or record the history as described next.
To record the output in a permanent log just redirect it to a file by adding
>>path/filename.ext
to the end of the grep
line. To record and view the notices
append | tee >>path/filename.ext
to the grep
line.
Test it.
- Using Pangolin 12.04 Live SD/USB
- Turn wireless networking off & on.
- Use the other terminal window to make some other notifications with:
for i in {0..100..20};
do
killall notify-osd;
notify-send "testing $i" $i;
sleep 0.5;
done
Results
Judicious use of grep
and sed
etc. can pretty print
the notifications that are crudely shown below for these monitored examples.
The text that matches the graffiti in the notification pop-up bubbles is shown in bold
. The two strings preceding those are the ap. making the graffiti (ie. "NetworkManager" or "notify-send") and the name of the icon, if any, (ie. "notification-network-wireless-disconnected") to show in the pop-up bubble.
string ":1.380"
method call sender=:1.14 -> dest=:1.379 serial=8691
path=/org/freedesktop/Notifications;
interface=org.freedesktop.Notifications; member=Notify
string "NetworkManager"
string "notification-network-wireless-disconnected"
string "MissingLink"
string "Disconnected - you are now offline"
string "urgency"
string "transient"
method call sender=:1.14 -> dest=:1.379 serial=8782
path=/org/freedesktop/Notifications;
interface=org.freedesktop.Notifications; member=Notify
string "NetworkManager"
string "notification-network-wireless-full"
string "MissingLink"
string "Connection Established"
string "urgency"
string "transient"
method call sender=:1.386 -> dest=:1.389 serial=7
path=/org/freedesktop/Notifications;
interface=org.freedesktop.Notifications; member=Notify
string "notify-send"
string ""
string "testing 0"
string "0"
string "urgency"
. . .
method call sender=:1.426 -> dest=:1.429 serial=7
path=/org/freedesktop/Notifications;
interface=org.freedesktop.Notifications; member=Notify
string "notify-send"
string ""
string "testing 80"
string "80"
string "urgency"
method call sender=:1.430 -> dest=:1.433 serial=7
path=/org/freedesktop/Notifications;
interface=org.freedesktop.Notifications; member=Notify
string "notify-send"
string ""
string "testing 100"
string "100"
string "urgency"
cross references:
... to be done ...