Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to read a list of messages displayed by notify-osd from time to time. I'm using 12.04 still, if it matters. Is this possible?

These two questions from 2010 indicate that a log file should exist at ~/.cache/notify-osd.log. I have no such file, and I'd like to know if this is a bug (in which case this question should be closed) or if this log file depends on another setting (like System Settings -> Privacy)?

I don't care about storing data between reboots. I just want to browse messages from the current session.

EDIT: Two good answers now but I'd like to know if these messages are stored anywhere, (total guess, /tmp? RAM?) for a short period after appearing on the screen. Some sort of buffer must exist as they appear one after another, a few seconds each, even if there are 20-30 notifications over the span of a minute or two.

I failed to mention in my original question that I'm not interested in yet another PPA + indicator or excessive drive writes, I just want to know if it is possible to see the messages for a short time after they appear.

My use case for this is to go back and find what song was played a few minutes ago on a streaming radio station. I have it on as background music, and occasionally a tune sticks in my head after I hear it. I have no way of going back to see what played 1-2 songs ago.

share|improve this question
1  
The reason you don't see the log anymore: bugs.launchpad.net/ubuntu/+source/notify-osd/+bug/904835 –  Seth May 4 '13 at 23:26
    
Which app/player you're using to play radio stream? –  Basharat Sialvi May 6 '13 at 2:14
    
@BasharatSial Radiotray –  Tom Brossman May 6 '13 at 7:22
1  
@TomBrossman Radiotray has a history plugin to keep the track of previously played songs. –  Basharat Sialvi May 6 '13 at 9:17
    
@BasharatSial Thanks, that's probably the simplest solution for me. –  Tom Brossman May 6 '13 at 20:23
add comment

3 Answers 3

up vote 4 down vote accepted

After carefully looking around (A LOT) I found a code change in 2011 about making notify-osd not output by default to the log file because this was used for debugging purposes and wrote to the HDD every time it did. To activate this feature you can do it 2 ways, a temporary method and a more permanent one.

Temporary Method

Open the terminal I type the following:

For 64 Bit Systems:

sudo killall notify-osd
LOG=1 /usr/lib/x86_64-linux-gnu/notify-osd &

For 32 Bit Systems:

sudo killall notify-osd
LOG=1 /usr/lib/notify-osd/notify-osd &

Now you will see the .cache/notify-osd.log file and the debug information in it.

Permanent Method (WARNING: Global Change)

For a more permanent solution do the following (Global Change. Read the Warning mentioned by Rinzwind below. This will affect everyone and kill the cat!):

sudo nano /etc/environment

Add the following line at the end and save:

LOG=1

Reboot the computer to test.

Permanent Method (User Specific Change)

For a more permanent solution do the following (User specific Change. This will only affect you and the dog. The cat will still survive.):

sudo nano ~/.bashrc

Add the following line at the end and save:

LOG=1

Reboot the computer to test.

You should see the information start to appear in the .cache/notify-osd.log file. For example, this me after disconnecting 2 times my wired connection:

GNU nano 2.2.6 File: .cache/notify-osd.log

[2013-05-04T18:49:55-00:00, NetworkManager ] Connected
Intel

[2013-05-04T18:50:26-00:00, NetworkManager ] Disconnected - you are now offline
Ethernet network

[2013-05-04T18:50:29-00:00, NetworkManager replaced] Connected
Intel
share|improve this answer
2  
Small warning: this could be a bad idea... LOG=1 in /etc/environment makes it a system wide variable and could break stuff... God knows what reacts on LOG (ofc. they should have made it something like NOTIFYOSDLOG). Maybe for starters I would add it to bashrc for 1 user just to be sure. –  Rinzwind May 4 '13 at 23:31
    
@Rinzwind Yeah I thought so. Added the bashrc. –  Luis Alvarado May 5 '13 at 2:08
    
Thanks Luis. I accepted this because it doesn't require another PPA which is great. (I gave the bounty to @Stump only because you have so much rep you won't miss it, hope you don't mind). –  Tom Brossman May 6 '13 at 20:22
1  
@TomBrossman I will hate you until Ubuntu buys Microsoft ^^. –  Luis Alvarado May 6 '13 at 20:42
add comment

This will show all notification messages from the time it is started until it is stopped.

dbus-monitor "interface='org.freedesktop.Notifications'"    |     \
grep --line-buffered  "member=Notify\|string"

Copy and paste it into a terminal window (Ctrl+Alt+T) .

To stop it use Ctrl+C or close the window.

This is effective though non-discriminating and crude but can be finessed to just monitor the exact details desired, of a specific notifying agent by altering the grep regular expression "member=Notify\|string". The text can then be massaged with sed, awk etc. to look good.

Penultimately, binding the script to automatically execute with the agent of choice to be monitored would be most useful.

cross reference:
- explicit details in Is there a way to view notification history?

share|improve this answer
    
+1 This is interesting but it must be running already to view past messages. –  Tom Brossman Oct 2 '13 at 9:24
    
exactly This will show all notification messages **from the time it is started** until it is stopped. All the other proposed solutions must be executed before being effective. This is no different, except ... To make it "sticky" the script can be included as part of the boot initialization routine. Also output can be piped to a log file. link added for more details ref. links to be added - many many many –  troll la la la Oct 2 '13 at 22:51
add comment

You can install the package indicator-notifications which keeps track of notifcations that you receive. You can install with the following

sudo add-apt-repository ppa:jconti/recent-notifications
sudo apt-get update
sudo apt-get install indicator-notifications

You'll have to log out and log back in. It shows up as a mailbox in the top panel and turns green when you get new messages.

Notifications

This is on 13.04 but should work on 12.04 as well.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.