Is it possible to temporarily disable notifications?

I certainly like notifications in 12.04, but depending on the work I do they can be quite distracting.

Is there an official way or a tweak to temporarily deactivate notifications?

UPDATE: To clearify, I am looking for a way to do that in Unity.


Solution 1:

This is how I achieved it

Create a sh file called stopNotification.sh and paste this line

killall -s SIGSTOP notify-osd

Create another sh file and continueNotification.sh and paste following line

killall -s SIGCONT notify-osd

Then goto system settings > keyboard and assign a shortcut for it.

Simple :)

Solution 2:

I don't believe there's an official way, but it's easy enough to disable in the terminal (for presentations, etc.):

  sudo chmod 000 /usr/lib/notify-osd/notify-osd
  killall notify-osd

Afterward, just chmod it back to 755 and notifications will resume.

Relevant: http://brainstorm.ubuntu.com/idea/25512/

Solution 3:

Use NoNotification and use don't disturb mode :)

https://launchpad.net/nonotifs

You can save lost notifications to check them later.

sudo add-apt-repository ppa:vlijm/nonotifs
sudo apt-get update
sudo apt-get install nonotifs

NoNotification

Solution 4:

You can disable popup notifications (the bubbles) graphically. Open System Monitor, find the process named notify-osd, right click on it and select stop; if you want notifications back, right click again on the process and click continue.

Notes.

  1. You can test if it's working trying to change audio level from keyboard.
  2. Be sure that there aren't bubbles opened when you stop notify-osd, otherwise they remain locked there.
  3. I don't know why, but when notify-osd is disabled, shortcuts doesn't work well; I mean, all shortcuts (even Ctrl+Alt+L for example). This doesn't always happen and is particularly evident when you use keyboard shortcuts for audio (e.g. to mute, increase or decrease volume, but also to pause or change the music).