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 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?

share|improve this question

3 Answers 3

up vote 1 down vote accepted

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:

share|improve this answer

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.

share|improve this answer

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 :)

share|improve this answer
    
adding this answer back in as it was deleted. –  Michael Butler Mar 18 '13 at 16:30

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.