Ubuntu – How to assign a keyboard shortcut to the ‘clear’ option in the messaging menu

messaging-menushortcut-keys

Say I get a new email, I get a notify osd message indicating subject and sender, and the messaging menu envelope turns blue. To clear the blue indicator, I usually click on the blue envelope, and select 'clear' – the last option in that menu. I would prefer to use a shortcut for doing this. Maybe a command in CCMS – but what would be the command?

Best Answer

Try this (tested only in 12.04):

  1. Open keyboard settings through the dash
  2. Go to the shortcuts tab
  3. Add a custom shortcut for this command: gdbus call --session --dest com.canonical.indicator.messages --object-path /com/canonical/indicator/messages/service --method com.canonical.indicator.messages.service.ClearAttention
  4. Click on the text "Disabled" and press your desired keys
Related Question