2

I have a multimedia keyboard that allows me to easily mute the sound (Ubuntu 12.04). It would be nice to "link" this to also turn off libnotify messages that pop-up in the top right corner (i.e. Pidgin messages).

So when Ubuntu is muted, no libnotify messages would pop up. When not muted, messages show as normal.

Is this possible with a script of some kind or would it require changing source code?

0

3 Answers 3

1

See my script on github.

This answer includes a script to toggle notify-osd notifications on Ubuntu 12.04, and shows how to bind it to a keyboard shortcut.

Related:

1

It would require changing the source code of notify-osd to turn off all notifications (or at least, to filter some; you may want to keep the sound/brightness/etc… notifications active for example, or urgent ones).

Outside of changing the source code of notify-osd (the daemon which runs in the user session and handles the display of the notifications), there is no way to disable all notifications like this.

0

I'd try two approaches if I needed this facility.

Option 1:

Bind the key that does the mute to a script. This is a simple approach and removes any complication of knowing the inards of libnotify

Option 2:

Run a cron job that runs every second to interrogate the state of pulse audio and then disable or enable libnotify. I haven't given you detailed instructions, but sometimes some ideas can get you on the right track. I have done neither of these so I can't give you a step by step but the concepts are not out of the realm of impossibility.

By the way its a great idea! I will stick it on my things to do one I get the time as it's a great idea :)

1
  • adding this answer back in as it was deleted. Mar 18, 2013 at 16:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .